|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.iges.anagram.AbstractModule | +--org.iges.anagram.Tool
A tool for accessing and analyzing data.
This class encapsulates all operations that are specific to the particular data format and/or access mechanism being served by the Anagram server. Thus, implementing the Anagram framework simply means implementing this class, plus possibly TempDataHandle (see doAnalysis() and doUpload()).
Field Summary |
Fields inherited from class org.iges.anagram.AbstractModule |
log, moduleName, parent, server |
Constructor Summary | |
Tool()
|
Method Summary | |
abstract TempDataHandle |
doAnalysis(java.lang.String name,
java.lang.String ae,
Privilege privilege)
Performs an analysis task. |
abstract DataHandle[] |
doImport(Setting setting)
Creates usable handles for data objects specified by tags in the configuration file. |
abstract boolean |
doUpdate(DataHandle data)
Brings the data handle provided up to date with respect to the data source. |
abstract TempDataHandle |
doUpload(java.lang.String name,
java.io.InputStream input,
long size,
Privilege privilege)
Accepts an uploaded data object. |
abstract DAS |
getDAS(DataHandle data)
Provides an object representation of the DODS Data Attribute Structure for the specified data object. |
abstract ServerDDS |
getDDS(DataHandle data,
java.lang.String ce)
Provides an object representation of the DODS Data Descriptor Structure for the specified data object. |
abstract void |
writeASCIIData(DataHandle data,
java.lang.String ce,
Privilege privilege,
java.io.OutputStream out)
Writes a data subset to a stream as a text table. |
abstract void |
writeBinaryData(DataHandle data,
java.lang.String ce,
Privilege privilege,
java.io.OutputStream out)
Writes a subset of the specified data object to the specified stream, in DODS binary format. |
void |
writeDAS(DataHandle data,
java.io.OutputStream out)
Writes the DODS Data Attribute Structure for the specified data object to the specified stream. |
void |
writeDDS(DataHandle data,
java.lang.String ce,
java.io.OutputStream out)
Writes the DODS Data Descriptor Structure for the specified data object to the specified stream. |
abstract void |
writeWebInfo(DataHandle data,
java.io.OutputStream out)
Writes a customized summary of the dataset, in the form of an HTML fragment, to the specified stream. |
Methods inherited from class org.iges.anagram.AbstractModule |
configModule, configure, debug, debug, error, fail, fail, fail, getModuleID, getModuleName, info, init, toString, verbose, verbose |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Tool()
Method Detail |
public abstract DataHandle[] doImport(Setting setting)
If possible, the import method should skip data objects that are already loaded, and whose attributes have not changed.
This method does not need to be threadsafe.
setting
- The tag tree specifying the data objects. This will be
the tree rooted at the subtag of the public abstract TempDataHandle doAnalysis(java.lang.String name, java.lang.String ae, Privilege privilege) throws ModuleException
If analysis is not supported, this method should throw an exception.
This method must be threadsafe.
ae
- The analysis expression to be evaluated. The format
of this expression is up to the implementor of this method.
ModuleException
- If the analysis fails for any reasonpublic abstract TempDataHandle doUpload(java.lang.String name, java.io.InputStream input, long size, Privilege privilege) throws ModuleException
If uploads are not supported, this method should throw an exception.
This method must be threadsafe.
input
- The stream of data to be stored
ModuleException
- if the upload fails for any reasonpublic abstract boolean doUpdate(DataHandle data) throws ModuleException
This method must be threadsafe.
ModuleException
- If the data source has become unusable.public abstract ServerDDS getDDS(DataHandle data, java.lang.String ce) throws ModuleException
data
parameter before
this method is called. Other than that, this method must guarantee its own
thread-safety.
data
- The data object to be accessedce
- The DODS constraint to be applied to the DDS. Null indicates that
the DDS should not be constrained.
ModuleException
- if the request fails for any reasonHandle.getSynch()
public abstract DAS getDAS(DataHandle data) throws ModuleException
data
parameter before
this method is called. Other than that, this method must guarantee its own
thread-safety.
data
- The data object to be accessed
ModuleException
- if the request fails for any reasonHandle.getSynch()
public void writeDDS(DataHandle data, java.lang.String ce, java.io.OutputStream out) throws ModuleException
data
parameter before
this method is called. Other than that, this method must guarantee its own
thread-safety. This method has a default implementation, which creates a DDS object using getDDS(), and serializes it to the stream. For optimal performance it is recommended to override this default implementation with a faster approach, such as streaming the DDS text directly from a cached disk file.
data
- The data object to be accessedce
- The DODS constraint to be applied to the DDS. Null indicates that
the DDS should not be constrained.out
- A stream to which to write the DDS
ModuleException
- if the request fails for any reasonHandle.getSynch()
public void writeDAS(DataHandle data, java.io.OutputStream out) throws ModuleException
data
parameter before
this method is called. Other than that, this method must guarantee its own
thread-safety. This method has a default implementation, which creates a DAS object using getDAS(), and serializes it to the stream. For optimal performance it is recommended to override this default implementation with a faster approach, such as streaming the DAS text directly from a cached disk file.
data
- The data object to be accessedout
- A stream to which to write the DAS
ModuleException
- if the request fails for any reasonHandle.getSynch()
public abstract void writeWebInfo(DataHandle data, java.io.OutputStream out) throws ModuleException
data
parameter before
this method is called. Other than that, this method must guarantee its own
thread-safety.
data
- The data object to be accessedout
- A stream to which to write the DAS
ModuleException
- if the request fails for any reasonHandle.getSynch()
public abstract void writeBinaryData(DataHandle data, java.lang.String ce, Privilege privilege, java.io.OutputStream out) throws ModuleException
It is guaranteed that the calling thread
will already have a non-exclusive lock on the data
parameter before
this method is called. Other than that, this method must guarantee its own
thread-safety.
data
- The data object to be accessedce
- The DODS constraint expression specifying the subset to be sentout
- The stream to which to write the subset
ModuleException
- if the request fails for any reasonHandle.getSynch()
public abstract void writeASCIIData(DataHandle data, java.lang.String ce, Privilege privilege, java.io.OutputStream out) throws ModuleException
It is guaranteed that the calling thread
will already have a non-exclusive lock on the data
parameter before
this method is called. Other than that, this method must guarantee its own
thread-safety.
data
- The data object to be accessedce
- The DODS constraint expression specifying the subset to be sentout
- The stream to which to write the subset
ModuleException
- if the request fails for any reasonHandle.getSynch()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |