anon.infoservice
Class AbstractCascadeIDEntry

java.lang.Object
  extended by anon.infoservice.AbstractDatabaseEntry
      extended by anon.infoservice.AbstractCascadeIDEntry
All Implemented Interfaces:
anon.util.IXMLEncodable
Direct Known Subclasses:
BlacklistedCascadeIDEntry, CascadeIDEntry, NewCascadeIDEntry, PreviouslyKnownCascadeIDEntry

public abstract class AbstractCascadeIDEntry
extends AbstractDatabaseEntry
implements anon.util.IXMLEncodable

This database class stores the IDs of all mixes in a cascade in a single string. It may be used to determine previously known cascades.

Author:
Rolf Wendolsky

Field Summary
 
Fields inherited from class anon.infoservice.AbstractDatabaseEntry
XML_ATTR_LAST_UPDATE, XML_LAST_UPDATE
 
Fields inherited from interface anon.util.IXMLEncodable
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_VERSION
 
Constructor Summary
AbstractCascadeIDEntry(AbstractCascadeIDEntry a_entry, long a_expireTime)
          Creates a new CascadeIDEntry from the mix IDs of a given cascade.
AbstractCascadeIDEntry(org.w3c.dom.Element a_xmlElement)
           
AbstractCascadeIDEntry(MixCascade a_cascade, long a_expireTime)
          Creates a new CascadeIDEntry from the mix IDs of a given cascade.
 
Method Summary
 java.lang.String getCascadeId()
          The cascade ID, that means the ID of the first mix in the cascade.
 java.lang.String getId()
          The concatenated ID of all mixes in the cascade.
 long getLastUpdate()
          Returns the time in milliseconds when this db entry was created from the origin instance.
 long getVersionNumber()
          Returns version number which is used to determine the more recent infoservice entry, if two entries are compared (higher version number -> more recent entry).
 org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
          Return an element that can be appended to the document.
 
Methods inherited from class anon.infoservice.AbstractDatabaseEntry
getCreationTime, getExpireTime, isNewerThan, isUserDefined, resetCreationTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCascadeIDEntry

public AbstractCascadeIDEntry(MixCascade a_cascade,
                              long a_expireTime)
                       throws java.lang.IllegalArgumentException
Creates a new CascadeIDEntry from the mix IDs of a given cascade.

Parameters:
a_cascade - MixCascade
a_expireTime - the time in ms when this databse entry expires
Throws:
java.lang.IllegalArgumentException - if the given cascade is null

AbstractCascadeIDEntry

public AbstractCascadeIDEntry(AbstractCascadeIDEntry a_entry,
                              long a_expireTime)
                       throws java.lang.IllegalArgumentException
Creates a new CascadeIDEntry from the mix IDs of a given cascade.

Parameters:
a_entry - MixCascade
a_expireTime - the time in ms when this databse entry expires
Throws:
java.lang.IllegalArgumentException - if the given AbstractCascadeIDEntry is null

AbstractCascadeIDEntry

public AbstractCascadeIDEntry(org.w3c.dom.Element a_xmlElement)
                       throws anon.util.XMLParseException
Throws:
anon.util.XMLParseException
Method Detail

getCascadeId

public final java.lang.String getCascadeId()
The cascade ID, that means the ID of the first mix in the cascade.

Returns:
the ID of the first mix in the cascade

getId

public final java.lang.String getId()
The concatenated ID of all mixes in the cascade.

Specified by:
getId in class AbstractDatabaseEntry
Returns:
the concatenated ID of all mixes in the cascade

getLastUpdate

public long getLastUpdate()
Description copied from class: AbstractDatabaseEntry
Returns the time in milliseconds when this db entry was created from the origin instance. Never (!) insert the local creation time here, as this will DoS the InfoServices in an endless loop.

Specified by:
getLastUpdate in class AbstractDatabaseEntry
Returns:
the time in milliseconds when this db entry was created from the origin instance

getVersionNumber

public final long getVersionNumber()
Returns version number which is used to determine the more recent infoservice entry, if two entries are compared (higher version number -> more recent entry).

Specified by:
getVersionNumber in class AbstractDatabaseEntry
Returns:
The version number for this entry.

toXmlElement

public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
Description copied from interface: anon.util.IXMLEncodable
Return an element that can be appended to the document. This Method must not change the document in any way!

Specified by:
toXmlElement in interface anon.util.IXMLEncodable
Parameters:
a_doc - a document
Returns:
the interface as xml element