ucar.nc2.iosp
Class AbstractIOServiceProvider

java.lang.Object
  extended by ucar.nc2.iosp.AbstractIOServiceProvider
All Implemented Interfaces:
IOServiceProvider
Direct Known Subclasses:
AddeServiceProvider, BufrIosp, Cinrad2IOServiceProvider, DMSPiosp, Doradeiosp, Giniiosp, GribServiceProvider, GridServiceProvider, GtopoIosp, H4iosp, H5iosp, N3iosp, Nexrad2IOServiceProvider, Nidsiosp, NmcObsLegacy

public abstract class AbstractIOServiceProvider
extends java.lang.Object
implements IOServiceProvider


Constructor Summary
AbstractIOServiceProvider()
           
 
Method Summary
static java.lang.String createValidNetcdfObjectName(java.lang.String name)
           
 java.lang.String getDetailInfo()
          Show debug / underlying implementation details
 Array readSection(ParsedSectionSpec cer)
          Allows reading sections of nested variables
 long readToByteChannel(Variable v2, Section section, java.nio.channels.WritableByteChannel channel)
          Read data from a top level Variable and send data to a WritableByteChannel.
 java.lang.Object sendIospMessage(java.lang.Object message)
          A way to communicate arbitrary information to an iosp.
 boolean sync()
          Check if file has changed, and reread metadata if needed.
 boolean syncExtend()
          Extend the file if needed in a way that is compatible with the current metadata.
 java.lang.String toStringDebug(java.lang.Object o)
          Debug info for this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ucar.nc2.iosp.IOServiceProvider
close, isValidFile, open, readData
 

Constructor Detail

AbstractIOServiceProvider

public AbstractIOServiceProvider()
Method Detail

createValidNetcdfObjectName

public static java.lang.String createValidNetcdfObjectName(java.lang.String name)

readToByteChannel

public long readToByteChannel(Variable v2,
                              Section section,
                              java.nio.channels.WritableByteChannel channel)
                       throws java.io.IOException,
                              InvalidRangeException
Description copied from interface: IOServiceProvider
Read data from a top level Variable and send data to a WritableByteChannel. Must be in big-endian order.

Specified by:
readToByteChannel in interface IOServiceProvider
Parameters:
v2 - a top-level Variable
section - the section of data to read. There must be a Range for each Dimension in the variable, in order. Note: no nulls allowed. IOSP may not modify.
channel - write data to this WritableByteChannel
Returns:
the number of bytes written to the channel
Throws:
java.io.IOException - if read error
InvalidRangeException - if invalid section

readSection

public Array readSection(ParsedSectionSpec cer)
                  throws java.io.IOException,
                         InvalidRangeException
Description copied from interface: IOServiceProvider
Allows reading sections of nested variables

Specified by:
readSection in interface IOServiceProvider
Returns:
requested data array
Throws:
java.io.IOException
InvalidRangeException

sendIospMessage

public java.lang.Object sendIospMessage(java.lang.Object message)
Description copied from interface: IOServiceProvider
A way to communicate arbitrary information to an iosp.

Specified by:
sendIospMessage in interface IOServiceProvider
Parameters:
message - opaque message.
Returns:
opaque return, may be null.

syncExtend

public boolean syncExtend()
                   throws java.io.IOException
Description copied from interface: IOServiceProvider
Extend the file if needed in a way that is compatible with the current metadata. For example, if the unlimited dimension has grown.

Specified by:
syncExtend in interface IOServiceProvider
Returns:
true if file was extended.
Throws:
java.io.IOException - if read error

sync

public boolean sync()
             throws java.io.IOException
Description copied from interface: IOServiceProvider
Check if file has changed, and reread metadata if needed.

Specified by:
sync in interface IOServiceProvider
Returns:
true if file was changed.
Throws:
java.io.IOException - if read error

toStringDebug

public java.lang.String toStringDebug(java.lang.Object o)
Description copied from interface: IOServiceProvider
Debug info for this object.

Specified by:
toStringDebug in interface IOServiceProvider
Parameters:
o - which object
Returns:
debug info for this object

getDetailInfo

public java.lang.String getDetailInfo()
Description copied from interface: IOServiceProvider
Show debug / underlying implementation details

Specified by:
getDetailInfo in interface IOServiceProvider
Returns:
debug info