de.fhg.igd.atlas.core
Class MemoryDBEntry

java.lang.Object
  extended byde.fhg.igd.atlas.core.MemoryDBEntry
All Implemented Interfaces:
StorageDBEntry

public class MemoryDBEntry
extends Object
implements StorageDBEntry

Entry objects which can be stored in MemoryDB databases. The implicit name is the unique identifier of an mobile object for instance the hashcode of its static part. The contact address should consist of a URL string that specifies the protocol, address, and port of a management service provided by the server, which is in possession of the specified object. The cookie is used as authorisation mechanism within the Location Service Protocol (LSP) permitting a client to update or delete an entry. The timestamp represents the last modification time in milliseconds since January 1, 1970, 00:00:00 GMT.

Version:
"$Id: MemoryDBEntry.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Jan Peters
See Also:
StorageDBEntry

Field Summary
protected  URL contactAddress_
          The contact address of this entry.
protected  byte[] cookie_
          The contact address of this entry.
protected  byte[] implicitName_
          The implicit name of this entry.
protected  long timestamp_
          The timestamp of this entry.
 
Constructor Summary
MemoryDBEntry(byte[] implicitName, URL contactAddress, byte[] cookie)
          Creates an instance of this class with the given implicitName, contaceAddress, cookie and timestamp.
 
Method Summary
 URL getContactAddress()
          Returns the contact address.
 byte[] getCookie()
          Returns the cookie.
 byte[] getImplicitName()
          Returns the implicit name.
 long getTimestamp()
          Returns the timestamp in milliseconds since January 1, 1970, 00:00:00 GMT.
 void touch()
          Sets the timestamp of the entry to the current time.
 void update(URL contactAddress, byte[] cookie)
          Updates the entry with the given contactAddress and cookie.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

implicitName_

protected byte[] implicitName_
The implicit name of this entry.


contactAddress_

protected URL contactAddress_
The contact address of this entry.


cookie_

protected byte[] cookie_
The contact address of this entry.


timestamp_

protected long timestamp_
The timestamp of this entry.

Constructor Detail

MemoryDBEntry

public MemoryDBEntry(byte[] implicitName,
                     URL contactAddress,
                     byte[] cookie)
Creates an instance of this class with the given implicitName, contaceAddress, cookie and timestamp.

Parameters:
implicitName - The implicit name.
contactAddress - The contact address.
cookie - The cookie.
Method Detail

update

public void update(URL contactAddress,
                   byte[] cookie)
Updates the entry with the given contactAddress and cookie. The timestamp of the entry is set to the current time.

Specified by:
update in interface StorageDBEntry
Parameters:
contactAddress - The contact address.
cookie - The cookie.

touch

public void touch()
Sets the timestamp of the entry to the current time.

Specified by:
touch in interface StorageDBEntry

getImplicitName

public byte[] getImplicitName()
Returns the implicit name.

Specified by:
getImplicitName in interface StorageDBEntry
Returns:
The implicit name.

getContactAddress

public URL getContactAddress()
Returns the contact address.

Specified by:
getContactAddress in interface StorageDBEntry
Returns:
The contact address.

getCookie

public byte[] getCookie()
Returns the cookie.

Specified by:
getCookie in interface StorageDBEntry
Returns:
The cookie.

getTimestamp

public long getTimestamp()
Returns the timestamp in milliseconds since January 1, 1970, 00:00:00 GMT.

Specified by:
getTimestamp in interface StorageDBEntry
Returns:
The timestamp.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.