|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Provides the interface for storage databases which are used
to store entries of type StorageDBEntry
.
These databases are needed in the context of the Location Service
Protocol (LSP) as part of a Location Service Server
(LSServer
). Implementations of this interface should
be efficient enough to keep up with the high update rates which are
typical for a location service for mobile objects.
An event mechanism informs registered listeners whenever the state of
the database has changed due to the modification or deletion of
existing entries or the initialization of a new entry.
LSServerService
,
StorageDBEntry
,
StorageDBImmutableEntry
,
StorageDBEvent
Method Summary | |
boolean |
delete(byte[] implicitName)
Deletes an existing entry with the given implicitName . |
boolean |
getEventFlag()
Returns the current state of the event flag. |
EventReflector |
getEventReflector()
Returns the reference to the database's event reflector which is notified with StorageDBEvent objects
incrementally describing the state of the database. |
int |
getSize()
Returns the current number of entries in the database. |
long |
getTimeout()
Returns the timeout of entries in the database. |
boolean |
init(byte[] implicitName,
URL contactAddress,
byte[] cookie)
Initializes a new entry with the given implicitName ,
contactAddress and cookie . |
Set |
list(long timestamp)
Returns the content of the database as set of entries with a timestamp newer then the given one. |
StorageDBImmutableEntry |
lookup(byte[] implicitName)
Returns the result of a database lookup with the given implicitName as immutable entry. |
boolean |
refresh(byte[] implicitName)
Refreshes an existing entry with the given implicitName ,
by updating the entries timestamp to the current time. |
void |
setEventFlag(boolean flag)
Sets the event flag to enable respectively disable the generation of events. |
void |
setTimeout(long timeout)
Sets the timeout of entries in the database. |
boolean |
update(byte[] implicitName,
URL contactAddress,
byte[] cookie)
Updates an existing entry with the given implicitName . |
Method Detail |
public StorageDBImmutableEntry lookup(byte[] implicitName)
implicitName
as immutable entry.
implicitName
- The implicit name.
implicitName
or null
if the entry was not found.public boolean init(byte[] implicitName, URL contactAddress, byte[] cookie)
implicitName
,
contactAddress
and cookie
.
If an entry with the implicitName
already exists,
false
is returned.
implicitName
- The implicit name.contactAddress
- The contact address.cookie
- The cookie.
true
if has been created successfully;
false
otherwise.public boolean update(byte[] implicitName, URL contactAddress, byte[] cookie)
implicitName
.
If no entry with the implicitName
exists,
false
is returned.
implicitName
- The implicit name.contactAddress
- The contact address.cookie
- The cookie.
true
if has been updated successfully;
false
otherwise.public boolean delete(byte[] implicitName)
implicitName
.
If no entry with the implicitName
exists,
false
is returned.
implicitName
- The implicit name.
true
if has been deleted successfully;
false
otherwise.public boolean refresh(byte[] implicitName)
implicitName
,
by updating the entries timestamp to the current time.
If no entry with the implicitName
exists,
false
is returned.
implicitName
- The implicit name.
true
if has been deleted refreshed;
false
otherwise.public Set list(long timestamp)
timestamp
- The timestamp in milliseconds
since January 1, 1970, 00:00:00 GMT
StorageDBEntry
.public int getSize()
Integer.MAX_VALUE
,
iff the number of entries is larger than
Integer.MAX_VALUE
.public long getTimeout()
public void setTimeout(long timeout)
timeout
- The timeout in milli seconds.public EventReflector getEventReflector()
StorageDBEvent
objects
incrementally describing the state of the database.
These envents are triggered every time the content of
the database has changed, iff the event flag is set.
public void setEventFlag(boolean flag)
flag
- The event flag to be set.public boolean getEventFlag()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |