org.iges.grads.server
Class GradsExtracter

java.lang.Object
  |
  +--org.iges.anagram.AbstractModule
        |
        +--org.iges.grads.server.GradsExtracter
All Implemented Interfaces:
Module
Direct Known Subclasses:
GradsGridExtracter, GradsStnExtracter

public abstract class GradsExtracter
extends AbstractModule

Shared interface for modules that extract and cache metadata for GrADS datasets. I am bending my own rules here - this class is inherits from Module, but it is not a reusable component. A new extracter is created for each extraction operation. This wouldn't be hard to fix by just putting all the parsing data into an inner class. Also, the construction of the DAS and DDS documents could be mostly abstracted out into this top-level class. But it would only be worth bothering if another basic dataset "shape" (presumably swath?) were to be added on top of grid and stn.


Field Summary
protected  DataHandle data
           
protected  GradsDataInfo gradsInfo
           
protected  java.util.List metadata
           
protected  java.lang.String storagePrefix
           
protected  GradsTaskModule tasker
           
 
Fields inherited from class org.iges.anagram.AbstractModule
log, moduleName, parent, server
 
Constructor Summary
GradsExtracter()
           
 
Method Summary
 void configure(Setting setting)
          Configures the module according to the settings provided.
protected  java.lang.String getHistoryString()
           
 java.lang.String getModuleID()
          Returns an ID for this module.
protected abstract  void load()
          Reads CTL file for dataset into internal structures
protected  void loadMetadata()
           
 void parse(DataHandle data, GradsTaskModule tasker, java.lang.String storagePrefix)
          Extracts metadata for the dataset given, and stores it in a set of temporary files under the prefix given, for use by the request handling modules.
protected  void printDODSAttributes(java.io.PrintWriter out, java.lang.String var)
           
protected abstract  void writeDAS()
          Takes the parsed metadata and writes a DAS file.
protected abstract  void writeDDS()
          Takes the parsed metadata and writes a DAS
protected abstract  void writeSubsetInfo()
          Caches any precalculated values for subsetting
protected abstract  void writeWebSummary()
          Takes the parsed metadata and writes a ".info" page
 
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

tasker

protected GradsTaskModule tasker

storagePrefix

protected java.lang.String storagePrefix

data

protected DataHandle data

gradsInfo

protected GradsDataInfo gradsInfo

metadata

protected java.util.List metadata
Constructor Detail

GradsExtracter

public GradsExtracter()
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

parse

public void parse(DataHandle data,
                  GradsTaskModule tasker,
                  java.lang.String storagePrefix)
           throws AnagramException
Extracts metadata for the dataset given, and stores it in a set of temporary files under the prefix given, for use by the request handling modules.

AnagramException

load

protected abstract void load()
                      throws AnagramException
Reads CTL file for dataset into internal structures

AnagramException

writeDDS

protected abstract void writeDDS()
                          throws AnagramException
Takes the parsed metadata and writes a DAS

AnagramException

writeDAS

protected abstract void writeDAS()
                          throws AnagramException
Takes the parsed metadata and writes a DAS file.

AnagramException

writeWebSummary

protected abstract void writeWebSummary()
                                 throws AnagramException
Takes the parsed metadata and writes a ".info" page

AnagramException

writeSubsetInfo

protected abstract void writeSubsetInfo()
                                 throws AnagramException
Caches any precalculated values for subsetting

AnagramException

loadMetadata

protected void loadMetadata()

printDODSAttributes

protected void printDODSAttributes(java.io.PrintWriter out,
                                   java.lang.String var)

getHistoryString

protected java.lang.String getHistoryString()