org.iges.grads.server
Class GradsDODSModule

java.lang.Object
  |
  +--org.iges.anagram.AbstractModule
        |
        +--org.iges.grads.server.GradsDODSModule
All Implemented Interfaces:
Module

public class GradsDODSModule
extends AbstractModule

Provides DODS metadata and subsets for GrADS data objects. This is the main back end for the GradsTool class. Uses cache files for DDS, DAS, and INFO data.


Field Summary
protected  BaseTypeFactory baseTypeFactory
           
protected  long defaultSubsetSize
           
protected  java.util.Map functionMap
           
protected  GradsSubsetter gridSubsetter
           
protected  GradsSubsetter stnSubsetter
           
protected  Store store
           
protected  GradsTool tool
           
 
Fields inherited from class org.iges.anagram.AbstractModule
log, moduleName, parent, server
 
Constructor Summary
GradsDODSModule(GradsTool tool)
           
 
Method Summary
protected  void buildFunctionMap()
           
 void configure(Setting setting)
          Configures the module according to the settings provided.
 void extract(DataHandle data)
           
 DAS getDAS(DataHandle data)
          Creates a DAS object for the given dataset (which is the Java-DODS encapsulation of a subset request).
 ServerDDS getDDS(DataHandle data, java.lang.String ce)
          Creates a constrained DDS object for the given dataset (which is the Java-DODS encapsulation of a subset request).
 java.lang.String getModuleID()
          Returns an ID for this module.
protected  java.io.InputStream loadDAS(DataHandle data)
           
protected  java.io.InputStream loadDDS(DataHandle data)
           
 void writeASCIIData(DataHandle data, java.lang.String ce, Privilege privilege, java.io.OutputStream out)
          Writes a data subset to a stream in ASCII format.
 void writeBinaryData(DataHandle data, java.lang.String ce, Privilege privilege, java.io.OutputStream out)
          Writes a data subset to a stream in binary format.
 void writeDAS(DataHandle data, java.io.OutputStream out)
          Writes a DAS object directly to an output stream.
 void writeDDS(DataHandle data, java.lang.String ce, java.io.OutputStream out)
          Writes a DDS object directly to an output stream.
 void writeWebInfo(DataHandle data, java.io.OutputStream out)
          Writes an info page directly to an output stream.
 
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

tool

protected GradsTool tool

gridSubsetter

protected GradsSubsetter gridSubsetter

stnSubsetter

protected GradsSubsetter stnSubsetter

defaultSubsetSize

protected long defaultSubsetSize

store

protected Store store

baseTypeFactory

protected BaseTypeFactory baseTypeFactory

functionMap

protected java.util.Map functionMap
Constructor Detail

GradsDODSModule

public GradsDODSModule(GradsTool tool)
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

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

getDDS

public ServerDDS getDDS(DataHandle data,
                        java.lang.String ce)
                 throws ModuleException
Creates a constrained DDS object for the given dataset (which is the Java-DODS encapsulation of a subset request).

Parameters:
ce - The constraint to apply to the DDS
ModuleException
See Also:
loadDDS()

getDAS

public DAS getDAS(DataHandle data)
           throws ModuleException
Creates a DAS object for the given dataset (which is the Java-DODS encapsulation of a subset request).

ModuleException
See Also:
loadDDS()

writeDDS

public void writeDDS(DataHandle data,
                     java.lang.String ce,
                     java.io.OutputStream out)
              throws ModuleException
Writes a DDS object directly to an output stream. If there is no constraint to apply, the DDS can simply be streamed directly from disk, avoiding the parsing overhead of getDDS().

ModuleException

writeDAS

public void writeDAS(DataHandle data,
                     java.io.OutputStream out)
              throws ModuleException
Writes a DAS object directly to an output stream. The DAS is cached and streamed directly from disk, avoiding the parsing overhead of getDAS().

ModuleException

writeWebInfo

public void writeWebInfo(DataHandle data,
                         java.io.OutputStream out)
                  throws ModuleException
Writes an info page directly to an output stream. The info page is cached and streamed directly from disk.

ModuleException

writeBinaryData

public void writeBinaryData(DataHandle data,
                            java.lang.String ce,
                            Privilege privilege,
                            java.io.OutputStream out)
                     throws ModuleException
Writes a data subset to a stream in binary format.

ModuleException

writeASCIIData

public void writeASCIIData(DataHandle data,
                           java.lang.String ce,
                           Privilege privilege,
                           java.io.OutputStream out)
                    throws ModuleException
Writes a data subset to a stream in ASCII format.

ModuleException

loadDDS

protected java.io.InputStream loadDDS(DataHandle data)
                               throws ModuleException
ModuleException

loadDAS

protected java.io.InputStream loadDAS(DataHandle data)
                               throws ModuleException
ModuleException

extract

public void extract(DataHandle data)
             throws ModuleException
ModuleException

buildFunctionMap

protected void buildFunctionMap()