|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.ibm.tspaces.SuperTuple
|
+--com.ibm.tspaces.SubclassableTuple
|
+--com.ibm.tspaces.examples.handler.StaleTuple
A StaleTuple is an ordered sequence of Fields where the first field is a TimeToDie timestamp that is stored at the time that the Tuple is written. This first field is hidden from the application.
For the purposes of this example the 2nd field is a string and and is indexed. The 3rd field is also a String but is not indexed. Other applications would define these differently.
Tuple,
SuperTuple,
Field,
TupleSpace, Serialized Form| Constructor Summary | |
StaleTuple()
constructor with no arguments builds a template tuple |
|
StaleTuple(StaleTimestamp timestamp)
constructor with StaleTimestamp specified. |
|
StaleTuple(java.lang.String key)
constructor with one String argument builds a template tuple to do simple match retrieve based on Field2 |
|
StaleTuple(java.lang.String key,
java.lang.String data)
constructor just calls the super tuple constructor |
|
| Method Summary | |
java.lang.String |
getData()
This method will return the data Field from the tuple. |
java.lang.String |
getKey()
This method will return the key Field from the tuple. |
void |
setData(java.lang.String data)
This method will set the data Field from the tuple. |
void |
setKey(java.lang.String key)
This method will set the Key Field from the tuple. |
void |
setTimeToLive(long time)
Sets the time to live value |
void |
updateExpirationDate()
Sets the first Field to the date/time stanp when the object is elgible for deletion. |
| 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 |
| Constructor Detail |
public StaleTuple()
throws TupleSpaceException
public StaleTuple(StaleTimestamp timestamp)
throws TupleSpaceException
public StaleTuple(java.lang.String key)
throws TupleSpaceException
public StaleTuple(java.lang.String key,
java.lang.String data)
throws TupleSpaceException
obj1 - an object that will be in a fieldobj2 - an object that will be in a field| Method Detail |
public java.lang.String getData()
throws TupleSpaceException
public void setData(java.lang.String data)
throws TupleSpaceException
data - String that should be placed in the "Data" field of Tuple
public java.lang.String getKey()
throws TupleSpaceException
public void setKey(java.lang.String key)
throws TupleSpaceException
key - String that should be placed in the "Key" field of Tuplepublic void setTimeToLive(long time)
timetolive - The time in MS that should expire before
the Tuple is elgible for deletion..
public void updateExpirationDate()
throws TupleSpaceException
This method is used by the StaleTupleSpaceHandler to update field 0 when the Write command is invoked in the server.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||