## dods.dap.Server
Interface ServerMethods

All Known Subinterfaces:
  ServerArrayMethods

All Known Implementing Classes:
  SDArray, SDBoolean, SDByte, SDFloat32, SDFloat64, SDGrid, SDInt16, SDInt32, SDList, SDSequence, SDString, SDStructure, SDUInt16, SDUInt32, SDURL

public interface ServerMethods

This interface defines the additional behaviors that Server side types need to support. These include:

The file I/O operations of which each variable must be capable.

The projection information. A projection defines the variables specified by a constraint to be returned by the server. These methods store projection information for a non-vector variable. Each variable type used on the server-side of DODS must implement this interface or one of its descendents.

The methods that define how each type responds to relational operators. Most (all?) types will not have sensible responses to all of the relational operators (e.g. SDByte won't know how to match a regular expression but SDString will). For those operators that are nonsensical a class should throw InvalidOperator.

See Also:
  `ServerArrayMethods`, `Operator`

Method Summary
`boolean` `equal(BaseType bt)` The `Operator` class contains a generalized implementation of this method.
`boolean` `greater_eql(BaseType bt)` The `Operator` class contains a generalized implementation of this method.
`boolean` `greater(BaseType bt)` The `Operator` class contains a generalized implementation of this method.
`boolean` `isProject()` Is the given variable marked as projected? If the variable is listed in the projection part of a constraint expression, then the CE parser should mark it as projected.
`boolean` `isRead()` Get the value of the Read property.
`boolean` `isSynthesized()` Get the value of the Synthesized property.
`boolean` `less_eql(BaseType bt)` The `Operator` class contains a generalized implementation of this method.
`boolean` `less(BaseType bt)` The `Operator` class contains a generalized implementation of this method.
`boolean` `not_equal(BaseType bt)` The `Operator` class contains a generalized implementation of this method.
`boolean` `read(String datasetName, Object specialO)` Read a value from the named dataset for this variable.
`boolean` `regexp(BaseType bt)` The `Operator` class contains a generalized implementation of this method.
`void` `serialize(String dataset, DataOutputStream sink, CEEvaluator ce, Object specialO)` Server-side serialization for DODS variables (sub-classes of `BaseType`).
`void` `setProject(boolean state)` Set the Project property of this variable.
`void` `setProject(boolean state, boolean all)` Set the state of this variable's projection.
`void` `setRead(boolean state)` Set the Read property.
`void` `setSynthesized(boolean state)` Set the Synthesized property.

Method Detail

### setSynthesized

    public void setSynthesized(boolean state)

  Set the Synthesized property.

  Parameters:
    `state` - If `true` then the variable is considered a synthetic variable and no part of DODS will ever try to read it from a file, otherwise if `false` the variable is considered a normal variable whose value should be read using the `read()` method. By default this property is false.
  See Also:
    `isSynthesized()`, `read(String, Object)`

### isSynthesized

    public boolean isSynthesized()

  Get the value of the Synthesized property.

  Returns:
    `true` if this is a synthetic variable, `false` otherwise.

### setRead

    public void setRead(boolean state)

  Set the Read property. A normal variable is read using the `read()` method. Once read the Read property is `true`. Use this function to manually set the property value. By default this property is false.

  Parameters:
    `state` - `true` if the variable has been read, `false` otherwise.
  See Also:
    `isRead()`, `read(String, Object)`

### isRead

    public boolean isRead()

  Get the value of the Read property.

  Returns:
    `true` if the variable has been read, `false` otherwise.
  See Also:
    `read(String, Object)`, `setRead(boolean)`

### read

    public boolean read(String datasetName,
                        Object specialO)
                 throws NoSuchVariableException,
                        IOException,
                        EOFException

  Read a value from the named dataset for this variable.

  Parameters:
    `datasetName` - String identifying the file or other data store from which to read a vaue for this variable.
  Returns:
    `true` if more data remains to be read, otehrwise `false`.
  Throws:
    `NoSuchVariableException`
    `IOException`
    `EOFException`

### setProject

    public void setProject(boolean state,
                           boolean all)

  Set the state of this variable's projection. `true` means that this variable is part of the current projection as defined by the current constraint expression, otherwise the current projection for this variable should be `false`.

  For simple variables and for children of DVector, the variable either is or is not projected. For children of DConstructor, it may be that the request is for only part of the constructor type (e.g., only oe field of a structure). However, the structure variable itself must be marked as projected given the implementation of serialize. The serialize() method does not search the entire tree of variables; it relies on the fact that for a particular variable to be sent, the path from the top of the DDS to that variable must be marked as `projected', not just the variable itself. This keeps the CEEvaluator.send() method from having to search the entire tree for the variables to be sent.

  Parameters:
    `state` - `true` if the variable is part of the current projection, `false` otherwise.
    `all` - set (or clear) the Project property of any children.
  See Also:
    `CEEvaluator`

### setProject

    public void setProject(boolean state)

  Set the Project property of this variable. This is equivalent to calling setProject(<state>, true).

  Parameters:
    `state` - `true` if the variable is part of the current projection, `false` otherwise.
  See Also:
    `setProject(boolean)`, `CEEvaluator`

### isProject

    public boolean isProject()

  Is the given variable marked as projected? If the variable is listed in the projection part of a constraint expression, then the CE parser should mark it as projected. When this method is called on such a variable it should return `true`, otherwise it should return `false`.

  Returns:
    `true` if the variable is part of the current projections, `false` otherwise.
  See Also:
    `setProject(boolean,boolean)`, `setProject(boolean)`, `CEEvaluator`

### equal

    public boolean equal(BaseType bt)
                  throws InvalidOperatorException,
                         RegExpException,
                         SBHException

  The `Operator` class contains a generalized implementation of this method. It should be used unless a localized architecture/implementation requires otherwise.

  Throws:
    `InvalidOperatorException`
    `RegExpException`
    `SBHException`
  See Also:
    `Operator`

### not_equal

    public boolean not_equal(BaseType bt)
                      throws InvalidOperatorException,
                             RegExpException,
                             SBHException

  The `Operator` class contains a generalized implementation of this method. It should be used unless a localized architecture/implementation requires otherwise.

  Throws:
    `InvalidOperatorException`
    `RegExpException`
    `SBHException`
  See Also:
    `Operator`

### greater

    public boolean greater(BaseType bt)
                    throws InvalidOperatorException,
                           RegExpException,
                           SBHException

  The `Operator` class contains a generalized implementation of this method. It should be used unless a localized architecture/implementation requires otherwise.

  Throws:
    `InvalidOperatorException`
    `RegExpException`
    `SBHException`
  See Also:
    `Operator`

### greater_eql

    public boolean greater_eql(BaseType bt)
                        throws InvalidOperatorException,
                               RegExpException,
                               SBHException

  The `Operator` class contains a generalized implementation of this method. It should be used unless a localized architecture/implementation requires otherwise.

  Throws:
    `InvalidOperatorException`
    `RegExpException`
    `SBHException`
  See Also:
    `Operator`

### less

    public boolean less(BaseType bt)
                 throws InvalidOperatorException,
                        RegExpException,
                        SBHException

  The `Operator` class contains a generalized implementation of this method. It should be used unless a localized architecture/implementation requires otherwise.

  Throws:
    `InvalidOperatorException`
    `RegExpException`
    `SBHException`
  See Also:
    `Operator`

### less_eql

    public boolean less_eql(BaseType bt)
                     throws InvalidOperatorException,
                            RegExpException,
                            SBHException

  The `Operator` class contains a generalized implementation of this method. It should be used unless a localized architecture/implementation requires otherwise.

  Throws:
    `InvalidOperatorException`
    `RegExpException`
    `SBHException`
  See Also:
    `Operator`

### regexp

    public boolean regexp(BaseType bt)
                   throws InvalidOperatorException,
                          RegExpException,
                          SBHException

  The `Operator` class contains a generalized implementation of this method. It should be used unless a localized architecture/implementation requires otherwise.

  Throws:
    `InvalidOperatorException`
    `RegExpException`
    `SBHException`
  See Also:
    `Operator`

### serialize

    public void serialize(String dataset,
                          DataOutputStream sink,
                          CEEvaluator ce,
                          Object specialO)
                   throws NoSuchVariableException,
                          SDODSException,
                          IOException

  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.

  For children of DConstructor, this method should call itself on each of the components. For other types this method should call externalize().

  Parameters:
    `dataset` - a `String` indicated which dataset to read from (Or something else if you so desire).
    `sink` - a `DataOutputStream` to write to.
    `ce` - the `CEEvaluator` to use in the parse process.
  Throws:
    `IOException` - thrown on any `OutputStream` exception.
    `NoSuchVariableException`
    `SDODSException`
  See Also:
    `BaseType`, `DDS`, `ServerDDS`