org.iges.grads.server
Class GradsSubsetter

java.lang.Object
  |
  +--org.iges.anagram.AbstractModule
        |
        +--org.iges.grads.server.GradsSubsetter
All Implemented Interfaces:
Module
Direct Known Subclasses:
GradsGridSubsetter, GradsStnSubsetter

public abstract class GradsSubsetter
extends AbstractModule

Generic interface for modules that handle subsetting of GrADS datasets.


Field Summary
protected  int bufferSize
           
protected  GradsTool tool
           
 
Fields inherited from class org.iges.anagram.AbstractModule
log, moduleName, parent, server
 
Constructor Summary
GradsSubsetter()
           
 
Method Summary
 void configure(Setting setting)
          Configures the module according to the settings provided.
 java.lang.String getModuleID()
          Returns an ID for this module.
 void setBufferSize(int bufferSize)
           
 void setTool(GradsTool tool)
           
abstract  void subset(DataHandle data, CEEvaluator ce, long subsetLimit, boolean useASCII, java.io.OutputStream out)
          Streams a subset to the output stream given, using the CEEvaluator given.
 
Methods inherited from class org.iges.anagram.AbstractModule
configModule, debug, debug, error, fail, fail, fail, getModuleName, info, init, toString, verbose, verbose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

bufferSize

protected int bufferSize

tool

protected GradsTool tool
Constructor Detail

GradsSubsetter

public GradsSubsetter()
Method Detail

getModuleID

public java.lang.String getModuleID()
Description copied from interface: Module
Returns an ID for this module. This ID should be a legal XML tag name. It has two uses: as a tag name in the server's configuration file, and as the final element of the complete module name.

Specified by:
getModuleID in interface Module
Specified by:
getModuleID in class AbstractModule

setTool

public void setTool(GradsTool tool)
Parameters:
tool - Used to access other GrADS-specific modules

configure

public void configure(Setting setting)
Description copied from class: AbstractModule
Configures the module according to the settings provided. The server supports dynamic reconfiguration. Thus this method may be called at any time in the life of the module. If the module cannot be reconfigured, it should throw an exception.

Specified by:
configure in interface Module
Specified by:
configure in class AbstractModule

setBufferSize

public void setBufferSize(int bufferSize)
Parameters:
bufferSize - Size of memory buffer to use when streaming subsets from disk

subset

public abstract void subset(DataHandle data,
                            CEEvaluator ce,
                            long subsetLimit,
                            boolean useASCII,
                            java.io.OutputStream out)
                     throws ModuleException
Streams a subset to the output stream given, using the CEEvaluator given.

Parameters:
useASCII - If true, print ASCII text; if false, send DODS/3.2 binary stream.
subsetLimit - maximum allowable size for the subset
Throws:
ModuleException - if subsetLimit bytes have already been written and there is still more data; or, if any errors occur during the subset operation