ucar.nc2.iosp.grib
Class GribServiceProvider

java.lang.Object
  extended by ucar.nc2.iosp.AbstractIOServiceProvider
      extended by ucar.nc2.iosp.grib.GribServiceProvider
All Implemented Interfaces:
IOServiceProvider
Direct Known Subclasses:
Grib1ServiceProvider, Grib2ServiceProvider

Deprecated.

public abstract class GribServiceProvider
extends AbstractIOServiceProvider

Superclass for grib1 and grib2 iosp.


Nested Class Summary
static class GribServiceProvider.IndexExtendMode
          Deprecated.  
 
Field Summary
static boolean addLatLon
          Deprecated.  
static GribServiceProvider.IndexExtendMode extendMode
          Deprecated.  
protected  FmrcCoordSys fmrcCoordSys
          Deprecated.  
static boolean forceNewIndex
          Deprecated.  
protected  NetcdfFile ncfile
          Deprecated.  
static GribServiceProvider.IndexExtendMode syncMode
          Deprecated.  
static boolean useMaximalCoordSys
          Deprecated.  
 
Fields inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
raf
 
Constructor Summary
GribServiceProvider()
          Deprecated.  
 
Method Summary
protected abstract  float[] _readData(long offset1, long offset2, int decimalScale, boolean bmsExists)
          Deprecated.  
 java.lang.String getDetailInfo()
          Deprecated. Show debug / underlying implementation details
protected  ucar.grib.Index getIndex(int edition, java.lang.String location)
          Deprecated. Open the index file.
 boolean isMissingXY(Variable v2, int timeIdx, int levIdx)
          Deprecated.  
protected abstract  void open(ucar.grib.Index index, CancelTask cancelTask)
          Deprecated.  
 void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask)
          Deprecated. Open existing file, and populate ncfile with it.
 Array readData(Variable v2, Section section)
          Deprecated. Read data from a top level Variable and return a memory resident Array.
 void readLevel(Variable v2, int timeIdx, Range levelRange, Range yRange, Range xRange, IndexIterator ii)
          Deprecated.  
 void readXY(Variable v2, int timeIdx, int levIdx, Range yRange, Range xRange, IndexIterator ii)
          Deprecated.  
 java.lang.Object sendIospMessage(java.lang.Object special)
          Deprecated. A way to communicate arbitrary information to an iosp.
static void setDebugFlags(DebugFlags debugFlag)
          Deprecated.  
static void setExtendIndex(boolean b)
          Deprecated. Set how indexes are used
static void setIndexAlwaysInCache(boolean b)
          Deprecated. Set disk cache policy for index files.
static void setIndexExtendMode(GribServiceProvider.IndexExtendMode mode)
          Deprecated. This controls the case where the GRIB file has changed, which is detected by comparing the GRIB file length with the file length recorded in the index file.
static void setIndexSyncMode(GribServiceProvider.IndexExtendMode mode)
          Deprecated. This controls what happens when sync() is called on a GRIB file.
 boolean sync()
          Deprecated. Update the metadata in the NetcdfFile if the underlying dataset has changed.
 java.lang.String toStringDebug(java.lang.Object o)
          Deprecated. Debug info for this object.
static void useMaximalCoordSys(boolean b)
          Deprecated.  
 
Methods inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
close, copyToByteChannel, createValidNetcdfObjectName, getFileTypeVersion, getStructureIterator, readSection, readToByteChannel, syncExtend
 
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
getFileTypeDescription, getFileTypeId, isValidFile
 

Field Detail

ncfile

protected NetcdfFile ncfile
Deprecated. 

fmrcCoordSys

protected FmrcCoordSys fmrcCoordSys
Deprecated. 

addLatLon

public static boolean addLatLon
Deprecated. 

forceNewIndex

public static boolean forceNewIndex
Deprecated. 

useMaximalCoordSys

public static boolean useMaximalCoordSys
Deprecated. 

extendMode

public static GribServiceProvider.IndexExtendMode extendMode
Deprecated. 

syncMode

public static GribServiceProvider.IndexExtendMode syncMode
Deprecated. 
Constructor Detail

GribServiceProvider

public GribServiceProvider()
Deprecated. 
Method Detail

useMaximalCoordSys

public static void useMaximalCoordSys(boolean b)
Deprecated. 

setIndexExtendMode

public static void setIndexExtendMode(GribServiceProvider.IndexExtendMode mode)
Deprecated. 
This controls the case where the GRIB file has changed, which is detected by comparing the GRIB file length with the file length recorded in the index file. If there is no index, one will be created. Default is IndexExtendMode.rewrite.
  1. IndexExtendMode.extend: when GRIB file length increases, extend the index. This is the case when the file is being appended to, as new data arrives.
  2. IndexExtendMode.rewrite: when GRIB file length changes, rewrite the index. This is the safest thing to do, at the expense of performance.
  3. IndexExtendMode.none: never modify an existing index. If there is no index, one will be created.

Parameters:
mode - IndexExtendMode when file is opened

setIndexSyncMode

public static void setIndexSyncMode(GribServiceProvider.IndexExtendMode mode)
Deprecated. 
This controls what happens when sync() is called on a GRIB file. The main use of sync() is when you are using NetcdfFile object caching. Before NetcdfFile is returned from a cache hit, sync() is called on it. Default is IndexExtendMode.extend.

Parameters:
mode - IndexExtendMode when sync() is called. Same meaning as setIndexExtendMode(IndexExtendMode mode)

setExtendIndex

public static void setExtendIndex(boolean b)
Deprecated. 
Set how indexes are used

Parameters:
b - if true, same as setIndexExtendMode(IndexExtendMode.extend), if false, same as setIndexExtendMode(IndexExtendMode.none)

setIndexAlwaysInCache

public static void setIndexAlwaysInCache(boolean b)
Deprecated. 
Set disk cache policy for index files. Default = false, meaning try to write index files in same directory as grib file. True means always use the DiskCache area. TDS sets this to true, so it wont interfere with external indexer.

Parameters:
b - set to this value

setDebugFlags

public static void setDebugFlags(DebugFlags debugFlag)
Deprecated. 

open

protected abstract void open(ucar.grib.Index index,
                             CancelTask cancelTask)
                      throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

open

public void open(RandomAccessFile raf,
                 NetcdfFile ncfile,
                 CancelTask cancelTask)
          throws java.io.IOException
Deprecated. 
Description copied from interface: IOServiceProvider
Open existing file, and populate ncfile with it. This method is only called by the NetcdfFile constructor on itself. The provided NetcdfFile object will be empty except for the location String and the IOServiceProvider associated with this NetcdfFile object.

Parameters:
raf - the file to work on, it has already passed the isValidFile() test.
ncfile - add objects to this empty NetcdfFile
cancelTask - used to monitor user cancellation; may be null.
Throws:
java.io.IOException - if read error

toStringDebug

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

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

getIndex

protected ucar.grib.Index getIndex(int edition,
                                   java.lang.String location)
                            throws java.io.IOException
Deprecated. 
Open the index file. If not exists, create it. When writing use DiskCache, to make sure location is writeable.

Parameters:
edition - which grib edition
location - location of the file. The index file has ".gbx" appended.
Returns:
ucar.grib.Index
Throws:
java.io.IOException - on io error

sync

public boolean sync()
             throws java.io.IOException
Deprecated. 
Description copied from interface: IOServiceProvider
Update the metadata in the NetcdfFile if the underlying dataset has changed.

Specified by:
sync in interface IOServiceProvider
Overrides:
sync in class AbstractIOServiceProvider
Returns:
true if the NetcdfFile was changed.
Throws:
java.io.IOException - if a read error occured when accessing the underlying dataset.

readData

public Array readData(Variable v2,
                      Section section)
               throws java.io.IOException,
                      InvalidRangeException
Deprecated. 
Description copied from interface: IOServiceProvider
Read data from a top level Variable and return a memory resident Array. This Array has the same element type as the Variable, and the requested shape.

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.
Returns:
the requested data in a memory-resident Array
Throws:
java.io.IOException - if read error
InvalidRangeException - if invalid section
See Also:
Range

readLevel

public void readLevel(Variable v2,
                      int timeIdx,
                      Range levelRange,
                      Range yRange,
                      Range xRange,
                      IndexIterator ii)
               throws java.io.IOException,
                      InvalidRangeException
Deprecated. 
Throws:
java.io.IOException
InvalidRangeException

readXY

public void readXY(Variable v2,
                   int timeIdx,
                   int levIdx,
                   Range yRange,
                   Range xRange,
                   IndexIterator ii)
            throws java.io.IOException,
                   InvalidRangeException
Deprecated. 
Throws:
java.io.IOException
InvalidRangeException

isMissingXY

public boolean isMissingXY(Variable v2,
                           int timeIdx,
                           int levIdx)
                    throws InvalidRangeException
Deprecated. 
Throws:
InvalidRangeException

_readData

protected abstract float[] _readData(long offset1,
                                     long offset2,
                                     int decimalScale,
                                     boolean bmsExists)
                              throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

sendIospMessage

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

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

getDetailInfo

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

Specified by:
getDetailInfo in interface IOServiceProvider
Overrides:
getDetailInfo in class AbstractIOServiceProvider
Returns:
debug info