dods.servers.agg
Class Agg1SDArray

java.lang.Object
  extended by dods.dap.BaseType
      extended by dods.dap.DVector
          extended by dods.dap.DArray
              extended by dods.dap.Server.SDArray
                  extended by dods.servers.agg.Agg1SDArray
All Implemented Interfaces:
ClientIO, RelOps, ServerArrayMethods, ServerMethods, Cloneable

public class Agg1SDArray
extends SDArray

Aggregates an SDArray distributed across multiple datasets (type 1), where the outer dimension is synthesized, and there is one AggFile per step.

Version:
$Revision: 1.4 $
Author:
jcaron

Method Summary
 boolean read(String datasetName, Object specialO)
          Read a value from the named dataset for this variable.
 void serialize(String dataset, DataOutputStream sink, CEEvaluator ce, Object specialO)
           Server-side serialization for DODS variables (sub-classes of BaseType).
 
Methods inherited from class dods.dap.Server.SDArray
appendDim, appendDim, equal, getStart, getStop, getStride, greater_eql, greater, isProject, isRead, isSynthesized, less_eql, less, not_equal, printDecl, printVal, regexp, setProject, setProject, setProjection, setRead, setSynthesized
 
Methods inherited from class dods.dap.DArray
checkSemantics, clone, getDimension, getDimensions, getFirstDimension, getTypeName, numDimensions
 
Methods inherited from class dods.dap.DVector
addVariable, deserialize, externalize, getLength, getPrimitiveVector, setLength
 
Methods inherited from class dods.dap.BaseType
checkSemantics, elementCount, elementCount, getLongName, getName, getParent, newPrimitiveVector, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printVal, printVal, printVal, setName, setParent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

read

public boolean read(String datasetName,
                    Object specialO)
             throws IOException,
                    EOFException
Description copied from class: SDArray
Read a value from the named dataset for this variable.

Specified by:
read in interface ServerMethods
Specified by:
read in class SDArray
Parameters:
datasetName - String identifying the file or other data store from which to read a vaue for this variable.
specialO - This Object is a goody that is used by Server implementations to deliver important, and as yet unknown, stuff to the read method. If you don't need it, make it a null.
Returns:
true if more data remains to be read, otherwise false. This is an abtsract method that must be implemented as part of the installation/localization of a DODS server.
Throws:
IOException
EOFException

serialize

public void serialize(String dataset,
                      DataOutputStream sink,
                      CEEvaluator ce,
                      Object specialO)
               throws NoSuchVariableException,
                      SDODSException,
                      IOException
Description copied from class: SDArray

Server-side serialization for DODS variables (sub-classes of BaseType). This does not send the entire class as the Java Serializable interface does, rather it sends only the binary data values. Other software is responsible for sending variable type information (see DDS).

Writes data to a DataOutputStream. This method is used on the server side of the DODS client/server connection, and possibly by GUI clients which need to download DODS data, manipulate it, and then re-save it as a binary file.

Caution:

When serializing arrays of sequences (children of DSequence) it is crucial that it be handled with great care. Sequences have been implemented so that only one instance (or row if you will) is retained in memory at a given time. In order to correctly serialize an array of sequences the read() method for the array must create an instance of the sequence for each member of the array, typically by repeatedly cloning the template variable in the PrimitiveVector. The important next step is to NOT attempt to read any data into the sequences from within the read() method of the parent array. The sequence's data will get read, and constraint expressions applied when the serialze() method of the array calls the serialize method of the sequence. Good Luck!

Specified by:
serialize in interface ServerMethods
Overrides:
serialize in class SDArray
Parameters:
dataset - a String indicated which dataset to read from (Or something else if you so desire).
sink - a DataOutputStream to write to.
ce - a CEEvaluator containing constraint Clauses.
specialO - a Object to be used by ServerMethods.read()
Throws:
IOException - thrown on any OutputStream exception.
NoSuchVariableException
SDODSException
See Also:
BaseType, DDS, ServerDDS