|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object anon.infoservice.AbstractDatabaseEntry anon.infoservice.AbstractDistributableDatabaseEntry anon.infoservice.AbstractDistributableCertifiedDatabaseEntry anon.infoservice.MixCascade
public class MixCascade
Holds the information for a mixcascade.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class anon.infoservice.AbstractDistributableDatabaseEntry |
---|
AbstractDistributableDatabaseEntry.SerialDBEntry, AbstractDistributableDatabaseEntry.Serials |
Field Summary | |
---|---|
private boolean |
m_bDefaultVerified
|
private boolean |
m_bFromCascade
If this MixCascade has been recevied directly from a cascade connection. |
private boolean |
m_bImplicitTrust
|
private CertPath |
m_certPath
|
private byte[] |
m_compressedXmlStructure
|
private boolean |
m_isPayment
True, if this MixCascade is a payment cascade. |
private long |
m_lastUpdate
Time (see System.currentTimeMillis()) when the mixcascade (first mix) has sent this HELO message. |
private java.util.Vector |
m_listenerInterfaces
Holds the information about the interfaces (IP, Port) the mixcascade (first mix) is listening on. |
private JAPCertificate |
m_mixCascadeCertificate
Stores the certificate for verifying the status messages of the mixcascade. |
private java.lang.String |
m_mixCascadeId
This is the ID of the mixcascade. |
private java.util.Vector |
m_mixIds
Holds IDs of all mixes in the cascade. |
private MixInfo[] |
m_mixInfos
|
private java.util.Vector |
m_mixNodes
|
private java.lang.String |
m_mixProtocolVersion
|
private java.lang.String |
m_paymentProtocolVersion
|
private long |
m_serial
|
private XMLSignature |
m_signature
|
private java.lang.String |
m_strMixIds
|
private java.lang.String |
m_strName
The name of the mixcascade. |
private boolean |
m_userDefined
True, if this MixCascade is user defined, false if the Information comes from the InfoService. |
private org.w3c.dom.Element |
m_xmlStructure
Stores the XML structure for this mixcascade. |
static java.lang.String |
SUPPORTED_PAYMENT_PROTOCOL_VERSION
|
private static java.lang.String |
XML_ATTR_USER_DEFINED
|
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_VERSION |
Constructor Summary | |
---|---|
|
MixCascade(byte[] a_bCompressedMixCascadeNode)
Creates a new MixCascade from XML description (MixCascade node). |
private |
MixCascade(byte[] a_compressedMixCascadeNode,
org.w3c.dom.Element a_mixCascadeNode,
long a_expireTime,
java.lang.String a_mixIDFromCascade)
Creates a new MixCascade from XML description (MixCascade node). |
|
MixCascade(org.w3c.dom.Element a_mixCascadeNode)
Creates a new MixCascade from XML description (MixCascade node). |
|
MixCascade(org.w3c.dom.Element a_mixCascadeNode,
long a_expireTime)
Creates a new MixCascade from XML description (MixCascade node). |
|
MixCascade(org.w3c.dom.Element a_mixCascadeNode,
long a_expireTime,
java.lang.String a_mixIDFromCascade)
Creates a new MixCascade from XML description (MixCascade node). |
|
MixCascade(java.lang.String a_hostName,
int a_port)
Creates a new MixCascade from the hostName / IP and the port. |
|
MixCascade(java.lang.String a_name,
java.lang.String a_id,
java.lang.String a_hostName,
int a_port)
Creates a new MixCascade from the hostName / IP and the port. |
|
MixCascade(java.lang.String a_name,
java.lang.String a_id,
java.util.Vector a_listenerInterfaces)
|
|
MixCascade(java.lang.String a_name,
java.lang.String a_id,
java.util.Vector a_mixIDs,
java.util.Vector a_listenerInterfaces)
|
|
MixCascade(java.lang.String a_name,
java.lang.String a_id,
java.util.Vector a_mixIDs,
java.util.Vector a_listenerInterfaces,
long a_timeout)
|
Method Summary | |
---|---|
boolean |
checkId()
Checks if the ID is valid. |
boolean |
compareMixIDs(MixCascade a_cascade)
Returns whether a given cascade has another number of mixes or mixes with other IDs than this one. |
private void |
createMixIDString()
|
boolean |
equals(java.lang.Object a_object)
Compares this object to another one. |
StatusInfo |
fetchCurrentStatus()
Fetches the current status of the mixcascade from the InfoService. |
private org.w3c.dom.Element |
generateXmlRepresentation()
Creates an XML node without signature for this MixCascade. |
JAPCertificate |
getCertificate()
Returns the certificate appended to the signature of the MixCascade XML structure. |
CertPath |
getCertPath()
|
byte[] |
getCompressedData()
|
StatusInfo |
getCurrentStatus()
Returns the current status of this mixcascade. |
java.lang.String |
getId()
Returns the ID of the mixcascade. |
long |
getLastUpdate()
Returns the time in milliseconds when this db entry was created from the origin instance. |
ListenerInterface |
getListenerInterface(int i)
Returns the ListenerInterface with the number i from the list of all listener interfaces (count starts with 0). |
java.lang.String |
getMixId(int a_mixNumber)
Returns the Mix ID of the mix with the specified position in the cascade. |
java.util.Vector |
getMixIds()
Returns the IDs of all mixes in the cascade. |
java.lang.String |
getMixIDsAsString()
|
MixInfo |
getMixInfo(int a_mixNumber)
Returns the MixInfo object (if available) of the mix in the specified position in the cascade. |
MixInfo |
getMixInfo(java.lang.String a_mixId)
Returns the MixInfo object (if available) of the mix with the specified id if this mix is part of this cascade. |
java.lang.String |
getMixProtocolVersion()
Returns the cascade protocol version, but only if this cascade entry was received directly from a first mix. |
java.lang.String |
getName()
Returns the name of the mixcascade. |
int |
getNumberOfListenerInterfaces()
Returns the number of interfaces (IP, Port) the mixcascade (first mix) is listening on. |
int |
getNumberOfMixes()
Returns the number of mixes in the cascade. |
java.lang.String |
getPaymentProtocolVersion()
|
byte[] |
getPostData()
This returns the data posted when this MixCascade information is forwarded to other infoservices. |
int |
getPostEncoding()
Returns the content encoding of the post data. |
java.lang.String |
getPostFile()
This returns the filename (InfoService command), where this MixCascade entry is posted at other InfoServices. |
long |
getVersionNumber()
Returns the time when this MixCascade entry was created by the origin mixcascade (or by the JAP client if it is a user-defined entry). |
org.w3c.dom.Element |
getXmlStructure()
Returns the XML structure for this MixCascade entry. |
int |
hashCode()
Returns a hashcode for this instance of MixCascade. |
boolean |
isFromCascade()
Returns if this MixCascade has been recevied directly from a cascade connection. |
boolean |
isPayment()
|
boolean |
isShownAsTrusted()
|
boolean |
isUserDefined()
Returns whether this MixCascade entry was generated by a user within the JAP client (true) or was generated by the original mixcascade itself (false). |
boolean |
isValid()
Returns if the object is valid at this time |
boolean |
isVerified()
Returns if this entry has been verified with a certificate chain. |
void |
setUserDefined(boolean a_bUserDefined,
MixCascade a_oldMixCascade)
|
void |
showAsTrusted(boolean a_bImplicitTrust)
May be set by this application to show this service as trusted. |
java.lang.String |
toString()
Returns a String representation for this MixCascade object. |
Methods inherited from class anon.infoservice.AbstractDistributableDatabaseEntry |
---|
getHttpRequestString, getHttpSerialsRequestString, toXmlElement |
Methods inherited from class anon.infoservice.AbstractDatabaseEntry |
---|
getCreationTime, getExpireTime, isNewerThan, resetCreationTime |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SUPPORTED_PAYMENT_PROTOCOL_VERSION
public static final java.lang.String XML_ELEMENT_NAME
public static final java.lang.String XML_ELEMENT_CONTAINER_NAME
private static final java.lang.String XML_ATTR_USER_DEFINED
private boolean m_bDefaultVerified
private boolean m_bImplicitTrust
private java.lang.String m_mixCascadeId
private long m_lastUpdate
private java.lang.String m_strName
private java.util.Vector m_listenerInterfaces
private java.util.Vector m_mixIds
private java.lang.String m_strMixIds
private MixInfo[] m_mixInfos
private java.util.Vector m_mixNodes
private long m_serial
private JAPCertificate m_mixCascadeCertificate
private org.w3c.dom.Element m_xmlStructure
private byte[] m_compressedXmlStructure
private XMLSignature m_signature
private CertPath m_certPath
private boolean m_userDefined
private boolean m_isPayment
private java.lang.String m_mixProtocolVersion
private java.lang.String m_paymentProtocolVersion
private boolean m_bFromCascade
Constructor Detail |
---|
public MixCascade(byte[] a_bCompressedMixCascadeNode) throws XMLParseException
a_bCompressedMixCascadeNode
- The MixCascade node from a compressed XML document.
XMLParseException
public MixCascade(org.w3c.dom.Element a_mixCascadeNode) throws XMLParseException
a_mixCascadeNode
- The MixCascade node from an XML document.
XMLParseException
public MixCascade(org.w3c.dom.Element a_mixCascadeNode, long a_expireTime) throws XMLParseException
a_mixCascadeNode
- The MixCascade node from an XML document.a_expireTime
- forces a specific expire time; takes default expire time if <= 0
XMLParseException
public MixCascade(org.w3c.dom.Element a_mixCascadeNode, long a_expireTime, java.lang.String a_mixIDFromCascade) throws XMLParseException
a_mixCascadeNode
- The MixCascade node from an XML document.a_expireTime
- forces a specific expire time; takes default expire time if <= 0a_mixIDFromCascade
- if this is a MixCascade node directly received from a cascade
(it is stripped) it gets this mix id; otherwise it must be null
XMLParseException
private MixCascade(byte[] a_compressedMixCascadeNode, org.w3c.dom.Element a_mixCascadeNode, long a_expireTime, java.lang.String a_mixIDFromCascade) throws XMLParseException
a_mixCascadeNode
- The MixCascade node from an XML document.a_expireTime
- forces a specific expire time; takes default expire time if <= 0a_mixIDFromCascade
- if this is a MixCascade node directly received from a cascade
(it is stripped) it gets this mix id; otherwise it must be null
XMLParseException
public MixCascade(java.lang.String a_hostName, int a_port) throws java.lang.Exception
a_hostName
- The hostname or IP address the mixcascade (first mix) is listening on.a_port
- The port the mixcascade (first mix) is listening on.
java.lang.Exception
public MixCascade(java.lang.String a_name, java.lang.String a_id, java.lang.String a_hostName, int a_port) throws java.lang.Exception
a_name
- A human readable name of this cascade, which could be display on the UI. If
this value is null the name will be constructed from hostName and port.a_id
- The ID of this cascade. If null than it will be constructed from hostName and
port.a_hostName
- The hostname or IP address the mixcascade (first mix) is listening on.a_port
- The port the mixcascade (first mix) is listening on.
java.lang.Exception
public MixCascade(java.lang.String a_name, java.lang.String a_id, java.util.Vector a_listenerInterfaces) throws java.lang.Exception
java.lang.Exception
public MixCascade(java.lang.String a_name, java.lang.String a_id, java.util.Vector a_mixIDs, java.util.Vector a_listenerInterfaces) throws java.lang.Exception
java.lang.Exception
public MixCascade(java.lang.String a_name, java.lang.String a_id, java.util.Vector a_mixIDs, java.util.Vector a_listenerInterfaces, long a_timeout) throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
public boolean compareMixIDs(MixCascade a_cascade)
a_cascade
- MixCascade
public java.lang.String getId()
getId
in interface IDistributable
getId
in class AbstractDatabaseEntry
public java.lang.String getMixProtocolVersion()
public java.lang.String getPaymentProtocolVersion()
public boolean isFromCascade()
public long getVersionNumber()
getVersionNumber
in class AbstractDatabaseEntry
public long getLastUpdate()
AbstractDatabaseEntry
getLastUpdate
in class AbstractDatabaseEntry
public java.lang.String getName()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object a_object)
equals
in class java.lang.Object
a_object
- The object with which to compare.
public boolean checkId()
AbstractDistributableCertifiedDatabaseEntry
checkId
in class AbstractDistributableCertifiedDatabaseEntry
public int hashCode()
hashCode
in class java.lang.Object
public int getNumberOfListenerInterfaces()
public ListenerInterface getListenerInterface(int i)
i
- The number of the ListenerInterface.
public int getNumberOfMixes()
public java.lang.String getMixIDsAsString()
public MixInfo getMixInfo(int a_mixNumber)
a_mixNumber
- a mix position from 0 to getNumberOfMixes() - 1
public MixInfo getMixInfo(java.lang.String a_mixId)
a_mixId
- a Mix id
public java.lang.String getMixId(int a_mixNumber)
a_mixNumber
- a mix position from 0 to getNumberOfMixes() - 1
public java.util.Vector getMixIds()
public boolean isUserDefined()
isUserDefined
in class AbstractDatabaseEntry
public void showAsTrusted(boolean a_bImplicitTrust)
a_bImplicitTrust
- if this service is shown as trusted in this applicationpublic boolean isShownAsTrusted()
public void setUserDefined(boolean a_bUserDefined, MixCascade a_oldMixCascade)
public StatusInfo fetchCurrentStatus()
public StatusInfo getCurrentStatus()
public java.lang.String getPostFile()
getPostFile
in interface IDistributable
public int getPostEncoding()
AbstractDistributableDatabaseEntry
getPostEncoding
in interface IDistributable
getPostEncoding
in class AbstractDistributableDatabaseEntry
public byte[] getPostData()
getPostData
in interface IDistributable
getPostData
in class AbstractDistributableDatabaseEntry
public byte[] getCompressedData()
public org.w3c.dom.Element getXmlStructure()
getXmlStructure
in class AbstractDistributableDatabaseEntry
public JAPCertificate getCertificate()
getCertificate
in class AbstractDistributableCertifiedDatabaseEntry
public CertPath getCertPath()
getCertPath
in interface IVerifyable
public boolean isVerified()
AbstractDistributableCertifiedDatabaseEntry
isVerified
in interface IVerifyable
isVerified
in class AbstractDistributableCertifiedDatabaseEntry
public boolean isValid()
IVerifyable
isValid
in interface IVerifyable
private org.w3c.dom.Element generateXmlRepresentation()
public boolean isPayment()
private void createMixIDString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |