|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.iids.aos.systemservices.lookupservice.LookupResult
public class LookupResult
From the Lookupservice we receive an answer to a lookup() query in the form of a mapping of a 'key' to a bag of (expirytime, creationtime, value, userid) tuples. Each tuple corresponds to an entry in the lookup service that (a) matches the query and (b) whose 'key' field corresponds to the key of this mapping. The key->bag mapping is a Hashtable; the bag is a Vector; a tuple is also a Vector. This looks rather complicated (and it is) but is necessary to support multiple entries making different assertions about an ID, all with different expiry times or values. Note that the 'ID' field of a lookup service entry does not appear anywhere in the above. The find() and list() queries of the lookup service return another mapping in which the above mapping is embedded, namely a mapping of 'ID' field to the above key->bag mapping. This mapping is also a Hashtable. This utility class parses the key->bag mapping, and provides some accessor methods.
| Field Summary | |
|---|---|
java.util.Hashtable |
result
|
| Constructor Summary | |
|---|---|
LookupResult(java.util.Hashtable _result)
|
|
| Method Summary | |
|---|---|
java.lang.String |
getEarliestExpiry(java.lang.String key)
|
java.lang.String |
getLatestExpiry(java.lang.String key)
|
java.lang.String |
getNewest(java.lang.String key)
Get newest tuple with corresponding key from the lookup result. |
long |
getNewestExpiryTime(java.lang.String key)
Returns the Expiry time in milliseconds since the UNIX epoch of the newest entry for the specified key. |
java.lang.String |
getOldest(java.lang.String key)
Get oldest tuple with corresponding key from the lookup result. |
java.lang.Object |
getSorted(java.lang.String key,
int sortKeyPosition,
int valuePosition,
boolean head)
Sorts all the entries with 'key' in the result set. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.util.Hashtable result
| Constructor Detail |
|---|
public LookupResult(java.util.Hashtable _result)
| Method Detail |
|---|
public java.lang.Object getSorted(java.lang.String key,
int sortKeyPosition,
int valuePosition,
boolean head)
head parameter.
key - Key to filter the tuples. If it is null, then all
tuples will match.sortKeyPosition - Column in the resulting tuples to use for sorting.valuePosition - Column in the resulting tuples containing results.head - If true then returns head element of sorted
result tuples, otherwise returns the tail element.
public java.lang.String getOldest(java.lang.String key)
key - The key of the tuple to look for, or null if
no key filtering is required for the result.
public java.lang.String getNewest(java.lang.String key)
key - The key of the tuple to look for, or null if
no key filtering is required for the result.
public long getNewestExpiryTime(java.lang.String key)
public java.lang.String getEarliestExpiry(java.lang.String key)
public java.lang.String getLatestExpiry(java.lang.String key)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||