anon.infoservice
Class MixCascade

java.lang.Object
  extended by anon.infoservice.AbstractDatabaseEntry
      extended by anon.infoservice.AbstractDistributableDatabaseEntry
          extended by anon.infoservice.AbstractDistributableCertifiedDatabaseEntry
              extended by anon.infoservice.MixCascade
All Implemented Interfaces:
AnonServerDescription, IVerifyable, Database.IWebInfo, ICertifiedDatabaseEntry, IDistributable, IServiceContextContainer, IXMLEncodable

public class MixCascade
extends AbstractDistributableCertifiedDatabaseEntry
implements AnonServerDescription, IVerifyable, IServiceContextContainer, Database.IWebInfo

Holds the information for a mixcascade.


Nested Class Summary
 
Nested classes/interfaces inherited from class anon.infoservice.AbstractDistributableDatabaseEntry
AbstractDistributableDatabaseEntry.SerialDBEntry, AbstractDistributableDatabaseEntry.Serials
 
Field Summary
static int DISTRIBUTION_MAX
           
static int DISTRIBUTION_MIN
           
static java.lang.String INFOSERVICE_COMMAND_WEBINFO
           
static java.lang.String INFOSERVICE_COMMAND_WEBINFOS
           
private  boolean m_bDefaultVerified
           
private  boolean m_bFromCascade
          If this MixCascade has been received directly from a cascade connection.
private  boolean m_bImplicitTrust
           
private  boolean m_bSock5Support
           
private  boolean m_bStudy
          If this Cascade participates in a study.
private  MultiCertPath m_certPath
           
private  byte[] m_compressedXmlStructure
           
private  java.lang.String m_context
           
private  DataRetentionInformation m_dataRetentionInfo
           
private  java.util.Vector m_decomposedCascadeName
           
private  int m_distributionPoints
           
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  int m_maxUsers
          Is greater zero if user number is restricted.
private  java.lang.String m_mixCascadeId
          This is the ID of the mixcascade.
private  boolean[] m_mixCertVerifiedAndValid
           
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  int m_nrCountries
           
private  int m_nrOperators
           
private  int m_nrOperatorsCountForDistribution
           
private  int m_nrOperatorsShown
           
private  int m_nrPriceCerts
           
private  java.lang.String m_paymentProtocolVersion
           
private  java.lang.String m_piid
           
private  long m_prepaidInterval
           
private  java.util.Hashtable m_priceCertificateHashes
           
private  java.util.Vector m_priceCertificates
           
private  long m_serial
           
private  XMLSignature m_signature
           
private  java.lang.String m_strHosts
           
private  java.lang.String m_strMixIds
           
private  java.lang.String m_strMixNames
           
private  java.lang.String m_strName
          The name of the mixcascade.
private  java.lang.String m_strPorts
           
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 int MAX_CASCADE_NAME_LENGTH
           
static java.lang.String SUPPORTED_PAYMENT_PROTOCOL_VERSION
           
private  java.lang.Object SYNC_NAME
           
private  java.lang.Object SYNC_OPERATORS_AND_COUNTRIES
           
static java.lang.String TC_REQUIRED_VERSION_SUFFIX
           
private  boolean termsAndConditionsConfirmationRequired
           
private static java.lang.String XML_ATTR_MAX_USERS
           
private static java.lang.String XML_ATTR_PAYMENT
           
private static java.lang.String XML_ATTR_STUDY
           
private static java.lang.String XML_ATTR_USER_DEFINED
           
static java.lang.String XML_ATTR_WEBINFO_MIX_COUNTRY
           
static java.lang.String XML_ATTR_WEBINFO_MIX_POSITION
           
static java.lang.String XML_ATTR_WEBINFO_OP_COUNTRY
           
static java.lang.String XML_ELEMENT_CONTAINER_NAME
           
static java.lang.String XML_ELEMENT_NAME
           
static java.lang.String XML_ELEMENT_WEBINFO
           
static java.lang.String XML_ELEMENT_WEBINFO_CASCADE_NAME
           
static java.lang.String XML_ELEMENT_WEBINFO_COMPOSED_NAME
           
static java.lang.String XML_ELEMENT_WEBINFO_CONTAINER
           
static java.lang.String XML_ELEMENT_WEBINFO_CURR_USERS
           
static java.lang.String XML_ELEMENT_WEBINFO_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.IServiceContextContainer
CONTEXT_JONDONYM, CONTEXT_JONDONYM_COMPATIBILITY, CONTEXT_JONDONYM_PREMIUM, XML_ATTR_CONTEXT
 
Fields inherited from interface anon.infoservice.Database.IWebInfo
FIELD_XML_ELEMENT_WEBINFO_CONTAINER
 
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
  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
private  void cacheHostAndPortsAsString()
           
private  void calculateOperatorsAndCountries()
           
 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()
           
 void deletePersistence()
           
 boolean equals(java.lang.Object a_object)
          Compares this object to another one.
 StatusInfo fetchCurrentStatus()
           
 StatusInfo fetchCurrentStatus(long a_timeout)
          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.
 MultiCertPath getCertPath()
           
 byte[] getCompressedData()
           
 java.lang.String getContext()
           
 StatusInfo getCurrentStatus()
          Returns the current status of this mixcascade.
 DataRetentionInformation getDataRetentionInformation()
           
 java.util.Vector getDecomposedCascadeName()
           
 int getDistribution()
          Returns a number that tells how distributed this service is.
 java.util.Vector getHosts()
           
 java.lang.String getHostsAsString()
           
 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).
 int getMaxUsers()
          Tells if this Cascade has a maximum number of users.
 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 getMixNames()
          Gets (and sets) the concatenated names of the Mixes in 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 getNrOfPriceCerts()
           
 int getNumberOfCountries()
          Returns the number of Mixes in the cascade that differ from others in the cascade in their location and in the location of their operator.
 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.
 int getNumberOfOperators()
          Returns the number of really independent operators in this cascade.
 int getNumberOfOperatorsShown()
          Returns the same as getNumberOfOperators(), is all operator and mix certificates are valid.
 java.lang.String getPaymentProtocolVersion()
           
 java.lang.String getPIID()
           
 java.lang.String getPortsAsString()
           
 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 getPrepaidInterval()
           
 java.util.Hashtable getPriceCertificateHashes()
           
 java.util.Vector getPriceCertificates()
          getPriceCertificates: utility method, equivalent to getting the MixInfo for all Mixes, and calling getPriceCertificate on each one
 XMLSignature getSignature()
           
 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 getWebInfo(org.w3c.dom.Document webInfoDoc)
           
 org.w3c.dom.Element getXmlStructure()
          Returns the XML structure for this MixCascade entry.
 int hashCode()
          Returns a hashcode for this instance of MixCascade.
 boolean isActiveStudy()
           
 boolean isFromCascade()
          Returns if this MixCascade has been recevied directly from a cascade connection.
 boolean isPayment()
           
 boolean isPaymentProtocolSupported()
           
 boolean isPersistanceDeletionAllowed()
           
 boolean isShownAsTrusted()
           
 boolean isSocks5Supported()
           
 boolean isTermsAndConditionsConfirmationRequired()
           
 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

SUPPORTED_PAYMENT_PROTOCOL_VERSION

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

TC_REQUIRED_VERSION_SUFFIX

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

DISTRIBUTION_MIN

public static final int DISTRIBUTION_MIN
See Also:
Constant Field Values

DISTRIBUTION_MAX

public static final int DISTRIBUTION_MAX
See Also:
Constant Field Values

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_ATTR_USER_DEFINED

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

XML_ATTR_STUDY

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

XML_ATTR_MAX_USERS

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

XML_ATTR_PAYMENT

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

XML_ELEMENT_WEBINFO_CONTAINER

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

XML_ELEMENT_WEBINFO

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

XML_ELEMENT_WEBINFO_CASCADE_NAME

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

XML_ELEMENT_WEBINFO_NAME

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

XML_ELEMENT_WEBINFO_COMPOSED_NAME

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

XML_ELEMENT_WEBINFO_CURR_USERS

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

XML_ATTR_WEBINFO_MIX_COUNTRY

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

XML_ATTR_WEBINFO_MIX_POSITION

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

XML_ATTR_WEBINFO_OP_COUNTRY

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

INFOSERVICE_COMMAND_WEBINFOS

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

INFOSERVICE_COMMAND_WEBINFO

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

MAX_CASCADE_NAME_LENGTH

public static final int MAX_CASCADE_NAME_LENGTH
See Also:
Constant Field Values

m_bDefaultVerified

private boolean m_bDefaultVerified

m_bImplicitTrust

private boolean m_bImplicitTrust

m_bSock5Support

private boolean m_bSock5Support

m_dataRetentionInfo

private DataRetentionInformation m_dataRetentionInfo

m_mixCascadeId

private java.lang.String m_mixCascadeId
This is the ID of the mixcascade.


m_lastUpdate

private long m_lastUpdate
Time (see System.currentTimeMillis()) when the mixcascade (first mix) has sent this HELO message.


m_strName

private java.lang.String m_strName
The name of the mixcascade.


SYNC_NAME

private final java.lang.Object SYNC_NAME

m_decomposedCascadeName

private java.util.Vector m_decomposedCascadeName

m_listenerInterfaces

private java.util.Vector m_listenerInterfaces
Holds the information about the interfaces (IP, Port) the mixcascade (first mix) is listening on.


m_mixIds

private java.util.Vector m_mixIds
Holds IDs of all mixes in the cascade.


m_strMixIds

private java.lang.String m_strMixIds

m_piid

private java.lang.String m_piid

m_mixInfos

private MixInfo[] m_mixInfos

m_strMixNames

private java.lang.String m_strMixNames

m_nrPriceCerts

private int m_nrPriceCerts

m_mixNodes

private java.util.Vector m_mixNodes

m_serial

private long m_serial

m_xmlStructure

private org.w3c.dom.Element m_xmlStructure
Stores the XML structure for this mixcascade.


m_compressedXmlStructure

private byte[] m_compressedXmlStructure

m_signature

private XMLSignature m_signature

m_certPath

private MultiCertPath m_certPath

m_nrCountries

private int m_nrCountries

m_nrOperators

private int m_nrOperators

m_nrOperatorsCountForDistribution

private int m_nrOperatorsCountForDistribution

m_nrOperatorsShown

private int m_nrOperatorsShown

m_distributionPoints

private int m_distributionPoints

m_mixCertVerifiedAndValid

private boolean[] m_mixCertVerifiedAndValid

SYNC_OPERATORS_AND_COUNTRIES

private java.lang.Object SYNC_OPERATORS_AND_COUNTRIES

termsAndConditionsConfirmationRequired

private volatile boolean termsAndConditionsConfirmationRequired

m_userDefined

private boolean m_userDefined
True, if this MixCascade is user defined, false if the Information comes from the InfoService. This value is only meaningful within the context of the JAP client.


m_bStudy

private boolean m_bStudy
If this Cascade participates in a study.


m_maxUsers

private int m_maxUsers
Is greater zero if user number is restricted.


m_strPorts

private java.lang.String m_strPorts

m_strHosts

private java.lang.String m_strHosts

m_isPayment

private boolean m_isPayment
True, if this MixCascade is a payment cascade.


m_prepaidInterval

private long m_prepaidInterval

m_mixProtocolVersion

private java.lang.String m_mixProtocolVersion

m_paymentProtocolVersion

private java.lang.String m_paymentProtocolVersion

m_priceCertificateHashes

private java.util.Hashtable m_priceCertificateHashes

m_priceCertificates

private java.util.Vector m_priceCertificates

m_bFromCascade

private boolean m_bFromCascade
If this MixCascade has been received directly from a cascade connection.


m_context

private java.lang.String m_context
Constructor Detail

MixCascade

public MixCascade(byte[] a_bCompressedMixCascadeNode)
           throws XMLParseException
Creates a new MixCascade from XML description (MixCascade node).

Parameters:
a_bCompressedMixCascadeNode - The MixCascade node from a compressed XML document.
Throws:
XMLParseException

MixCascade

public MixCascade(org.w3c.dom.Element a_mixCascadeNode)
           throws XMLParseException
Creates a new MixCascade from XML description (MixCascade node).

Parameters:
a_mixCascadeNode - The MixCascade node from an XML document.
Throws:
XMLParseException

MixCascade

public MixCascade(org.w3c.dom.Element a_mixCascadeNode,
                  long a_expireTime)
           throws XMLParseException
Creates a new MixCascade from XML description (MixCascade node).

Parameters:
a_mixCascadeNode - The MixCascade node from an XML document.
a_expireTime - forces a specific expire time; takes default expire time if <= 0
Throws:
XMLParseException

MixCascade

public MixCascade(org.w3c.dom.Element a_mixCascadeNode,
                  long a_expireTime,
                  java.lang.String a_mixIDFromCascade)
           throws XMLParseException
Creates a new MixCascade from XML description (MixCascade node).

Parameters:
a_mixCascadeNode - The MixCascade node from an XML document.
a_expireTime - forces a specific expire time; takes default expire time if <= 0
a_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
Throws:
XMLParseException

MixCascade

private MixCascade(byte[] a_compressedMixCascadeNode,
                   org.w3c.dom.Element a_mixCascadeNode,
                   long a_expireTime,
                   java.lang.String a_mixIDFromCascade)
            throws XMLParseException
Creates a new MixCascade from XML description (MixCascade node).

Parameters:
a_mixCascadeNode - The MixCascade node from an XML document.
a_expireTime - forces a specific expire time; takes default expire time if <= 0
a_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
Throws:
XMLParseException

MixCascade

public MixCascade(java.lang.String a_hostName,
                  int a_port)
           throws java.lang.Exception
Creates a new MixCascade from the hostName / IP and the port. The hostName and port are directly used for creating the ListenerInterface for this MixCascade. ID and the name are set to a generic value derived from the name and the port. The lastUpdate time is the current system time. One mixId is created, it is the same as the mixCascadeId. The current status is set to dummy value. Cause the infoservice does not know this mixCascadeId and the created mixId, you will never get a StatusInfo or a MixInfo other than the dummy one.

Parameters:
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.
Throws:
java.lang.Exception

MixCascade

public MixCascade(java.lang.String a_name,
                  java.lang.String a_id,
                  java.lang.String a_hostName,
                  int a_port)
           throws java.lang.Exception
Creates a new MixCascade from the hostName / IP and the port. The hostName and port are directly used for creating the ListenerInterface for this MixCascade. If ID and the name are not provided, than they are set to a generic value derived from the name and the port. The lastUpdate time is the current system time. One mixId is created, it is the same as the mixCascadeId. The current status is set to dummy value. Cause the infoservice does not know this mixCascadeId and the created mixId, you will never get a StatusInfo or a MixInfo other than the dummy one.

Parameters:
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.
Throws:
java.lang.Exception

MixCascade

public MixCascade(java.lang.String a_name,
                  java.lang.String a_id,
                  java.util.Vector a_listenerInterfaces)
           throws java.lang.Exception
Throws:
java.lang.Exception

MixCascade

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
Throws:
java.lang.Exception

MixCascade

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
Throws:
java.lang.Exception
Method Detail

isPersistanceDeletionAllowed

public boolean isPersistanceDeletionAllowed()
Overrides:
isPersistanceDeletionAllowed in class AbstractDatabaseEntry

deletePersistence

public void deletePersistence()
Overrides:
deletePersistence in class AbstractDatabaseEntry

compareMixIDs

public boolean compareMixIDs(MixCascade a_cascade)
Returns whether a given cascade has another number of mixes or mixes with other IDs than this one.

Parameters:
a_cascade - MixCascade
Returns:
if both cascades contain the same mix IDs (and are therefore identical); false otherwise

getId

public java.lang.String getId()
Returns the ID of the mixcascade.

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

getMixProtocolVersion

public java.lang.String getMixProtocolVersion()
Returns the cascade protocol version, but only if this cascade entry was received directly from a first mix.

Returns:
String

getPaymentProtocolVersion

public java.lang.String getPaymentProtocolVersion()

getPIID

public java.lang.String getPIID()

getPrepaidInterval

public long getPrepaidInterval()

isFromCascade

public boolean isFromCascade()
Returns if this MixCascade has been recevied directly from a cascade connection.

Returns:
if this MixCascade has been recevied directly from a cascade connection

getVersionNumber

public 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).

Specified by:
getVersionNumber in class AbstractDatabaseEntry
Returns:
A version number which is used to determine the more recent MixCascade 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

getMixNames

public java.lang.String getMixNames()
Gets (and sets) the concatenated names of the Mixes in this Cascade.

Returns:

getName

public java.lang.String getName()
Returns the name of the mixcascade.

Returns:
The name of this mixcascade.

getMaxUsers

public int getMaxUsers()
Tells if this Cascade has a maximum number of users.

Returns:
> 0 if user number is restricted; 0 otherwise

toString

public java.lang.String toString()
Returns a String representation for this MixCascade object. It's just the name of the mixcascade.

Overrides:
toString in class java.lang.Object
Returns:
The name of this mixcascade.

getDecomposedCascadeName

public java.util.Vector getDecomposedCascadeName()
Returns:

equals

public boolean equals(java.lang.Object a_object)
Compares this object to another one. This method returns only true, if the other object is also a MixCascade and has the same ID as this MixCascade.

Overrides:
equals in class java.lang.Object
Parameters:
a_object - The object with which to compare.
Returns:
True, if the object with which to compare is also a MixCascade which has the same ID as this instance. In any other case, false is returned.

checkId

public boolean checkId()
Description copied from class: AbstractDistributableCertifiedDatabaseEntry
Checks if the ID is valid.

Specified by:
checkId in interface ICertifiedDatabaseEntry
Overrides:
checkId in class AbstractDistributableCertifiedDatabaseEntry
Returns:
boolean

hashCode

public int hashCode()
Returns a hashcode for this instance of MixCascade. The hashcode is calculated from the ID, so if two instances of MixCascade have the same ID, they will have the same hashcode.

Overrides:
hashCode in class java.lang.Object
Returns:
The hashcode for this MixCascade.

getNumberOfListenerInterfaces

public int getNumberOfListenerInterfaces()
Returns the number of interfaces (IP, Port) the mixcascade (first mix) is listening on.

Returns:
The number of listener interfaces.

getListenerInterface

public ListenerInterface getListenerInterface(int i)
Returns the ListenerInterface with the number i from the list of all listener interfaces (count starts with 0). If there is no ListenerInterface with this number, null is returned.

Parameters:
i - The number of the ListenerInterface.
Returns:
The ListenerInterface with the number i from the list of all listener interfaces of this MixCascade.

getHostsAsString

public java.lang.String getHostsAsString()

getPortsAsString

public java.lang.String getPortsAsString()

getHosts

public java.util.Vector getHosts()

getNumberOfMixes

public int getNumberOfMixes()
Returns the number of mixes in the cascade.

Returns:
the number of mixes in the cascade

getMixIDsAsString

public java.lang.String getMixIDsAsString()

getMixInfo

public MixInfo getMixInfo(int a_mixNumber)
Returns the MixInfo object (if available) of the mix in the specified position in the cascade.

Parameters:
a_mixNumber - a mix position from 0 to getNumberOfMixes() - 1
Returns:
the MixInfo object for the specified mix or null if it was not found in this cascade

getMixInfo

public 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.

Parameters:
a_mixId - a Mix id
Returns:
the MixInfo object for the specified mix or null if it was not found

getMixId

public java.lang.String getMixId(int a_mixNumber)
Returns the Mix ID of the mix with the specified position in the cascade.

Parameters:
a_mixNumber - a mix position from 0 to getNumberOfMixes() - 1
Returns:
the Mix ID of the mix with the specified position in the cascade or null if the specified mix is not present in this cascade

getMixIds

public java.util.Vector getMixIds()
Returns the IDs of all mixes in the cascade.

Returns:
A snapshot of the list with all mix IDs within the cascade.

isUserDefined

public 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).

Overrides:
isUserDefined in class AbstractDatabaseEntry
Returns:
Whether this MixCascade entry is user-defined.

isSocks5Supported

public boolean isSocks5Supported()

showAsTrusted

public void showAsTrusted(boolean a_bImplicitTrust)
May be set by this application to show this service as trusted. TrustModel.isTrusted will then return true, but TrustModel.checkTrust will still check the correct trust.

Parameters:
a_bImplicitTrust - if this service is shown as trusted in this application

isShownAsTrusted

public boolean isShownAsTrusted()

setUserDefined

public void setUserDefined(boolean a_bUserDefined,
                           MixCascade a_oldMixCascade)
                    throws XMLParseException
Throws:
XMLParseException

fetchCurrentStatus

public StatusInfo fetchCurrentStatus()

fetchCurrentStatus

public StatusInfo fetchCurrentStatus(long a_timeout)
Fetches the current status of the mixcascade from the InfoService. The StatusInfo is available by calling getCurrentStatus().


getCurrentStatus

public StatusInfo getCurrentStatus()
Returns the current status of this mixcascade. If there is no status available at the infoservice, a dummy StatusInfo (every value = -1) is returned. The current status is every time updated, when fetchCurrentStatus() is called.

Returns:
The current status of the mixcascade.

getPostFile

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

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

getPostEncoding

public int getPostEncoding()
Description copied from class: AbstractDistributableDatabaseEntry
Returns the content encoding of the post data.

Specified by:
getPostEncoding in interface IDistributable
Overrides:
getPostEncoding in class AbstractDistributableDatabaseEntry
Returns:
the content encoding of the post data

getPostData

public byte[] getPostData()
This returns the data posted when this MixCascade information is forwarded to other infoservices. It's the XML structure of this MixCascade as we received it.

Specified by:
getPostData in interface IDistributable
Overrides:
getPostData in class AbstractDistributableDatabaseEntry
Returns:
The data posted to other infoservices when this entry is forwarded.

getCompressedData

public byte[] getCompressedData()

getXmlStructure

public org.w3c.dom.Element getXmlStructure()
Returns the XML structure for this MixCascade entry.

Specified by:
getXmlStructure in class AbstractDistributableDatabaseEntry
Returns:
The XML node for this MixCascade (MixCascade node).

getPriceCertificateHashes

public java.util.Hashtable getPriceCertificateHashes()

getPriceCertificates

public java.util.Vector getPriceCertificates()
getPriceCertificates: utility method, equivalent to getting the MixInfo for all Mixes, and calling getPriceCertificate on each one

Returns:
Vector containing one XMLPriceCertificate per Mix of the cascade

getNrOfPriceCerts

public int getNrOfPriceCerts()

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

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

getDataRetentionInformation

public DataRetentionInformation getDataRetentionInformation()

isActiveStudy

public boolean isActiveStudy()

getNumberOfOperators

public int getNumberOfOperators()
Returns the number of really independent operators in this cascade.

Returns:
the number of really independent operators in this cascade

getNumberOfOperatorsShown

public int getNumberOfOperatorsShown()
Returns the same as getNumberOfOperators(), is all operator and mix certificates are valid. If one or more of them are expired, this method will ignore it and count them as "full" operators. It should therefore not be used for security purposes (filters etc.) but for presentation only.

Returns:

getNumberOfCountries

public int getNumberOfCountries()
Returns the number of Mixes in the cascade that differ from others in the cascade in their location and in the location of their operator.

Returns:
int

getDistribution

public int getDistribution()
Returns a number that tells how distributed this service is. The higher, the better. Numbers range from 0 to 6, where 0 is an unknown state.

Returns:
a number that tells how distributed this service is

cacheHostAndPortsAsString

private void cacheHostAndPortsAsString()

calculateOperatorsAndCountries

private void calculateOperatorsAndCountries()

generateXmlRepresentation

private org.w3c.dom.Element generateXmlRepresentation()
Creates an XML node without signature for this MixCascade.

Returns:
The MixCascade XML node.

isPaymentProtocolSupported

public boolean isPaymentProtocolSupported()

isPayment

public boolean isPayment()

isTermsAndConditionsConfirmationRequired

public boolean isTermsAndConditionsConfirmationRequired()

createMixIDString

private void createMixIDString()

getContext

public java.lang.String getContext()
Specified by:
getContext in interface IServiceContextContainer

getWebInfo

public org.w3c.dom.Element getWebInfo(org.w3c.dom.Document webInfoDoc)
Specified by:
getWebInfo in interface Database.IWebInfo