anon.pay
Class PaymentInstanceDBEntry

java.lang.Object
  extended by anon.infoservice.AbstractDatabaseEntry
      extended by anon.infoservice.AbstractDistributableDatabaseEntry
          extended by anon.infoservice.AbstractDistributableCertifiedDatabaseEntry
              extended by anon.pay.PaymentInstanceDBEntry
All Implemented Interfaces:
IVerifyable, ICertifiedDatabaseEntry, IDistributable, IXMLEncodable

public class PaymentInstanceDBEntry
extends AbstractDistributableCertifiedDatabaseEntry
implements IVerifyable

Holds the information of a payment instance for storing in the InfoService.


Nested Class Summary
 
Nested classes/interfaces inherited from class anon.infoservice.AbstractDistributableDatabaseEntry
AbstractDistributableDatabaseEntry.SerialDBEntry, AbstractDistributableDatabaseEntry.Serials
 
Field Summary
private  MultiCertPath m_certPath
           
private  long m_creationTimeStamp
          Stores the time when this payment instance entry was created by the origin payment instance.
private  java.util.Vector m_listenerInterfaces
           
private  java.lang.String m_name
           
private  long m_serialNumber
           
private  XMLSignature m_signature
           
private  java.lang.String m_strOrganisation
           
private  java.lang.String m_strPaymentInstanceId
          This is the ID of this payment instance.
private  org.w3c.dom.Element m_xmlDescription
          Stores the XML representation of this PaymentInstanceDBEntry.
private static java.lang.String XML_ELEM_CERT
           
private static java.lang.String XML_ELEM_NAME
           
private static java.lang.String XML_ELEM_NET
           
static java.lang.String XML_ELEMENT_CONTAINER_NAME
           
static java.lang.String XML_ELEMENT_NAME
           
 
Fields inherited from class anon.infoservice.AbstractDistributableDatabaseEntry
XML_ATTR_LAST_UPDATE, XML_ATTR_SERIAL, XML_ATTR_VALID, XML_ATTR_VERIFIED
 
Fields inherited from class anon.infoservice.AbstractDatabaseEntry
XML_LAST_UPDATE
 
Fields inherited from interface anon.infoservice.IDistributable
FIELD_HTTP_REQUEST_STRING, FIELD_HTTP_SERIALS_REQUEST_STRING
 
Fields inherited from interface anon.util.IXMLEncodable
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION
 
Constructor Summary
PaymentInstanceDBEntry(org.w3c.dom.Element elemRoot)
           
PaymentInstanceDBEntry(org.w3c.dom.Element elemRoot, long a_expireTime)
          Creates a PaymentInstanceDBEntry which represents a payment instance.
PaymentInstanceDBEntry(java.lang.String a_id, java.lang.String a_name, JAPCertificate a_cert, java.util.Enumeration a_listeners, java.lang.String software_version, long creationTime, long a_serialNumber)
           
 
Method Summary
 void deletePersistence()
           
 boolean equals(java.lang.Object a_paymentInstance)
           
 MultiCertPath getCertPath()
           
 java.lang.String getId()
          Returns a unique ID for a database entry.
 long getLastUpdate()
          Returns the time in milliseconds when this db entry was created from the origin instance.
 java.util.Enumeration getListenerInterfaces()
          Returns the listener interfaces of this PI in a random order.
 java.lang.String getName()
           
 java.lang.String getOrganisation()
           
 java.lang.String getPostFile()
          This returns the filename (InfoService command), where this PaymentInstanceDBEntry is posted at other InfoServices.
 XMLSignature getSignature()
           
 long getVersionNumber()
          Returns the time when this payment instance entry was created by the origin payment instance.
 org.w3c.dom.Element getXmlStructure()
          Returns the XML structure for this db entry.
 int hashCode()
           
 boolean isPersistanceDeletionAllowed()
           
 boolean isValid()
          Returns if the object is valid at this time
 boolean isVerified()
          Returns if this entry has been verified with a certificate chain.
 java.lang.String toString()
           
 
Methods inherited from class anon.infoservice.AbstractDistributableCertifiedDatabaseEntry
checkId
 
Methods inherited from class anon.infoservice.AbstractDistributableDatabaseEntry
getHttpRequestString, getHttpSerialsRequestString, getPostData, getPostEncoding, toXmlElement
 
Methods inherited from class anon.infoservice.AbstractDatabaseEntry
getCreationTime, getExpireTime, isNewerThan, isUserDefined, resetCreationTime
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

XML_ELEMENT_NAME

public static final java.lang.String XML_ELEMENT_NAME
See Also:
Constant Field Values

XML_ELEMENT_CONTAINER_NAME

public static final java.lang.String XML_ELEMENT_CONTAINER_NAME
See Also:
Constant Field Values

XML_ELEM_NAME

private static final java.lang.String XML_ELEM_NAME
See Also:
Constant Field Values

XML_ELEM_CERT

private static final java.lang.String XML_ELEM_CERT
See Also:
Constant Field Values

XML_ELEM_NET

private static final java.lang.String XML_ELEM_NET
See Also:
Constant Field Values

m_strPaymentInstanceId

private java.lang.String m_strPaymentInstanceId
This is the ID of this payment instance.


m_xmlDescription

private org.w3c.dom.Element m_xmlDescription
Stores the XML representation of this PaymentInstanceDBEntry.


m_signature

private XMLSignature m_signature

m_certPath

private MultiCertPath m_certPath

m_creationTimeStamp

private long m_creationTimeStamp
Stores the time when this payment instance entry was created by the origin payment instance. This value is used to determine the more recent payment instance entry, if two entries are compared (higher version number -> more recent entry).


m_serialNumber

private long m_serialNumber

m_listenerInterfaces

private java.util.Vector m_listenerInterfaces

m_name

private java.lang.String m_name

m_strOrganisation

private java.lang.String m_strOrganisation
Constructor Detail

PaymentInstanceDBEntry

public PaymentInstanceDBEntry(org.w3c.dom.Element elemRoot)
                       throws XMLParseException
Throws:
XMLParseException

PaymentInstanceDBEntry

public PaymentInstanceDBEntry(org.w3c.dom.Element elemRoot,
                              long a_expireTime)
                       throws XMLParseException
Creates a PaymentInstanceDBEntry which represents a payment instance.

Throws:
XMLParseException

PaymentInstanceDBEntry

public PaymentInstanceDBEntry(java.lang.String a_id,
                              java.lang.String a_name,
                              JAPCertificate a_cert,
                              java.util.Enumeration a_listeners,
                              java.lang.String software_version,
                              long creationTime,
                              long a_serialNumber)
Method Detail

isPersistanceDeletionAllowed

public boolean isPersistanceDeletionAllowed()
Overrides:
isPersistanceDeletionAllowed in class AbstractDatabaseEntry

deletePersistence

public void deletePersistence()
Overrides:
deletePersistence in class AbstractDatabaseEntry

isVerified

public boolean isVerified()
Description copied from class: AbstractDistributableCertifiedDatabaseEntry
Returns if this entry has been verified with a certificate chain.

Specified by:
isVerified in interface IVerifyable
Specified by:
isVerified in interface ICertifiedDatabaseEntry
Specified by:
isVerified in class AbstractDistributableCertifiedDatabaseEntry
Returns:
if this entry has been verified with a certificate chain

isValid

public boolean isValid()
Description copied from interface: IVerifyable
Returns if the object is valid at this time

Specified by:
isValid in interface IVerifyable
Specified by:
isValid in interface ICertifiedDatabaseEntry
Returns:
if the object is valid at this time

getSignature

public XMLSignature getSignature()
Specified by:
getSignature in interface ICertifiedDatabaseEntry
Specified by:
getSignature in class AbstractDistributableCertifiedDatabaseEntry

getCertPath

public MultiCertPath getCertPath()
Specified by:
getCertPath in interface IVerifyable
Specified by:
getCertPath in interface ICertifiedDatabaseEntry

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getOrganisation

public java.lang.String getOrganisation()

getId

public java.lang.String getId()
Description copied from class: AbstractDatabaseEntry
Returns a unique ID for a database entry.

Specified by:
getId in interface IDistributable
Specified by:
getId in class AbstractDatabaseEntry
Returns:
The ID of this database entry.

equals

public boolean equals(java.lang.Object a_paymentInstance)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getName

public java.lang.String getName()

getListenerInterfaces

public java.util.Enumeration getListenerInterfaces()
Returns the listener interfaces of this PI in a random order.

Returns:
the listener interfaces of this PI in a random order

getVersionNumber

public long getVersionNumber()
Returns the time when this payment instance entry was created by the origin payment instance.

Specified by:
getVersionNumber in class AbstractDatabaseEntry
Returns:
A version number which is used to determine the more recent payment instance entry, if two entries are compared (higher version number -> more recent entry).

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

getPostFile

public java.lang.String getPostFile()
This returns the filename (InfoService command), where this PaymentInstanceDBEntry is posted at other InfoServices. It's always '/paymentinstance'.

Specified by:
getPostFile in interface IDistributable
Returns:
The filename where the information about this PaymentInstanceDBEntry is posted at other InfoServices when this entry is forwarded.

getXmlStructure

public org.w3c.dom.Element getXmlStructure()
Description copied from class: AbstractDistributableDatabaseEntry
Returns the XML structure for this db entry.

Specified by:
getXmlStructure in class AbstractDistributableDatabaseEntry
Returns:
The XML node of this db entry