com.ibm.tspaces
Class ConfigTuple

java.lang.Object
  |
  +--com.ibm.tspaces.SuperTuple
        |
        +--com.ibm.tspaces.SubclassableTuple
              |
              +--com.ibm.tspaces.ConfigTuple

public class ConfigTuple
extends SubclassableTuple
implements java.io.Serializable

A ConfigTuple is an ordered sequence of Fields that defines desired configuration information that is being based from the client to the server.

Author:
John Thomas
See Also:
Tuple, SuperTuple, Field, TupleSpace, Serialized Form

Field Summary
static java.lang.String FIFO
          Result Order Option Option set to true or false
static java.lang.String INDEX_FIELD
          IndexField number
static java.lang.String INDEX_UNIQUE
          Index items must be Unique.
static java.lang.String NO_INDEX
          No Index for this Field name
static java.lang.String PERSISTENCE
          Persistance Option
static java.lang.String STRUCT_INDEX
          The name of the index for structural queries
static java.lang.String TIMESTAMP_INDEX
          The name of the index for timeStamp (FIFO) queries
static java.lang.String TSDBTYPE
          DataBase Type Option
 
Constructor Summary
ConfigTuple()
          Default Constructor The Configuration name will default to "Configuration" which is the name for the TupleSpace ConfigTuple
ConfigTuple(java.lang.String name)
          Constructor with name specified.
 
Method Summary
 java.lang.Object getOption(java.lang.String name)
          Get an Option from the ConfigTuple.
 boolean getOptionBoolean(java.lang.String name, boolean optDefault)
          Convenience method to get obtain a boolean option.
 int getOptionInt(java.lang.String name, int optDefault)
          Convenience method to get obtain an int option.
 java.lang.String getOptionString(java.lang.String name, java.lang.String optDefault)
          Convenience method to get obtain a String option.
static void main(java.lang.String[] args)
          Run a quick test.
 void setOption(java.lang.String name, java.io.Serializable value)
          Set an Option.
 
Methods inherited from class com.ibm.tspaces.SuperTuple
add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addFieldType, changeName, clone, equals, fieldExists, fields, getExpire, getField, getField, getFieldType, getTimeStamp, getTupleID, isExpired, matches, numberOfFields, putField, setExpire, setField, setFields, setFormal, setFormal, setFormal, setFormal, setName, setTimeStamp, setTupleID, setType, setType, setValue, setValue, structureName, template, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TSDBTYPE

public static final java.lang.String TSDBTYPE
DataBase Type Option

INDEX_FIELD

public static final java.lang.String INDEX_FIELD
IndexField number

PERSISTENCE

public static final java.lang.String PERSISTENCE
Persistance Option

FIFO

public static final java.lang.String FIFO
Result Order Option Option set to true or false

INDEX_UNIQUE

public static final java.lang.String INDEX_UNIQUE
Index items must be Unique. No duplicates allowed

NO_INDEX

public static final java.lang.String NO_INDEX
No Index for this Field name

STRUCT_INDEX

public static final java.lang.String STRUCT_INDEX
The name of the index for structural queries

TIMESTAMP_INDEX

public static final java.lang.String TIMESTAMP_INDEX
The name of the index for timeStamp (FIFO) queries
Constructor Detail

ConfigTuple

public ConfigTuple()
Default Constructor The Configuration name will default to "Configuration" which is the name for the TupleSpace ConfigTuple

ConfigTuple

public ConfigTuple(java.lang.String name)
Constructor with name specified. The name will be the name of the Index which this ConfigTuple describes.
Parameters:
name - Index name that is being configured
Method Detail

setOption

public void setOption(java.lang.String name,
                      java.io.Serializable value)
Set an Option. The name will be the name of the Index which this ConfigTuple describes.
Parameters:
name - Option name
value - Option value (could be Boolean,String or Integer)

getOption

public java.lang.Object getOption(java.lang.String name)
Get an Option from the ConfigTuple. The name will be the name of the Option that we want
Parameters:
name - Option name

getOptionBoolean

public boolean getOptionBoolean(java.lang.String name,
                                boolean optDefault)
Convenience method to get obtain a boolean option. The name will be the name of the Option that we want
Parameters:
name - Option name
default - Default value

getOptionString

public java.lang.String getOptionString(java.lang.String name,
                                        java.lang.String optDefault)
Convenience method to get obtain a String option. The name will be the name of the Option that we want
Parameters:
name - Option name
default - Default value

getOptionInt

public int getOptionInt(java.lang.String name,
                        int optDefault)
Convenience method to get obtain an int option. The name will be the name of the Option that we want
Parameters:
name - Option name
default - Default value

main

public static void main(java.lang.String[] args)
Run a quick test.
Parameters:
name - Option name
value - Option value (could be Boolean,String or Integer)