anon.infoservice
Class InfoServiceDBEntry

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

public class InfoServiceDBEntry
extends AbstractDistributableCertifiedDatabaseEntry
implements IVerifyable, IBoostrapable

Holds the information for an infoservice.


Nested Class Summary
private static class InfoServiceDBEntry.EntryGetter
           
 
Nested classes/interfaces inherited from class anon.infoservice.AbstractDistributableDatabaseEntry
AbstractDistributableDatabaseEntry.SerialDBEntry, AbstractDistributableDatabaseEntry.Serials
 
Field Summary
private static int BLOCK_FACTOR_IF_UNREACHABLE
           
static int DEFAULT_GET_XML_CONNECTION_TIMEOUT
           
static java.lang.String HEADER_STATISTICS
           
private  boolean m_bPerfServerEnabled
           
private  boolean m_bPrimaryForwarderList
          Stores whether this infoservice has a primary forwarder list (true) or not (false).
private  boolean m_bTemp
          Indicates if this is a temporary InfoService entry creates for bootstrapping.
private  MultiCertPath m_certPath
           
private  long m_creationTimeStamp
          Stores the time when this infoservice entry was created by the origin infoservice or by the JAP client (if it is a user-defined entry).
private static int m_getXmlConnectionTimeout
           
private  ServiceSoftware m_infoserviceSoftware
          Some information about the used infoservice software.
private  java.util.Vector m_listenerInterfaces
          The ListenerInterfaces of all interfaces (internet-address and port) this infoservice is (virtually) listening on.
private  boolean m_neighbour
          Describes whether this infoservice is a neighbour of our one.
private  int m_preferedListenerInterface
          Stores the number of the preferred ListenerInterface in the listenerInterfaces list.
private  long m_serial
           
private  XMLSignature m_signature
           
private  java.lang.String m_strInfoServiceId
          This is the ID of this infoservice.
private  java.lang.String m_strName
          The name of the infoservice.
private static java.lang.Runnable m_threadHandleAfterJVMSocketError
           
private static long m_timeFirstJVMSocketError
           
private static long m_timeHandleAfterJVMSocketError
           
private  boolean m_userDefined
          Stores whether this InfoServiceDBEntry is user-defined within the JAP client (true) or was generated from the InfoService itself (false).
private  org.w3c.dom.Element m_xmlDescription
          Stores the XML representation of this InfoServiceDBEntry.
private static IBrowserIdentification ms_browserIdentification
           
private static IMutableProxyInterface ms_proxyInterface
          A proxy interface that is used for all connections and may change over time.
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
InfoServiceDBEntry(org.w3c.dom.Element a_infoServiceNode)
          Creates a new InfoService from XML description (InfoService node).
InfoServiceDBEntry(org.w3c.dom.Element a_infoServiceNode, long a_timeout)
          Creates a new InfoService from XML description (InfoService node).
InfoServiceDBEntry(java.lang.String a_host, int a_port)
          This is a JAP-only constructor needed to initialise JAP with default InfoServices.
InfoServiceDBEntry(java.lang.String a_strName, java.lang.String a_id, java.util.Vector a_listeners, boolean a_primaryForwarderList, boolean a_japClientContext, long a_creationTime, long a_serialNumber, boolean a_bPerfServerEnabled)
          Creates a new InfoServiceDBEntry.
InfoServiceDBEntry(java.util.Vector a_ListenerInterfaces)
           
 
Method Summary
private static void addPropertyHeader(java.lang.String a_systemPropertyName, java.lang.String strVersion, java.util.Vector a_headers)
           
private static void addPropertyHeader(java.lang.String a_systemPropertyName, java.util.Vector a_headers)
           
private static void addPropertyHeader(java.util.Vector a_systemPropertyNames, java.lang.String strVersion, java.util.Vector a_headers)
           
private static void addPropertyHeader(java.util.Vector a_systemPropertyNames, java.util.Vector a_headers)
           
 boolean checkId()
          Checks if the ID is valid.
private  HTTPConnectionDescriptor connectToInfoService(HTTPConnectionDescriptor lastConnectionDescriptor, ImmutableProxyInterface a_proxy, int a_supportedEncodings)
          Creates a new HTTPConnection to a ListenerInterface from the list of all listener interfaces.
 void deletePersistence()
           
private  byte[] doHttpRequest(HttpRequestStructure a_httpRequest, int a_supportedEncodings)
           
 boolean equals(java.lang.Object a_object)
          Compares this object to another one.
private static java.lang.String generateId(ListenerInterface a_listenerInterface)
          This is only for compatibility and will be rewritten next time.
private  org.w3c.dom.Element generateXmlRepresentation()
          Generates the XML representation for this InfoServiceDBEntry.
 MultiCertPath getCertPath()
           
static int getConnectionTimeout()
           
private  java.util.Hashtable getEntries(InfoServiceDBEntry.EntryGetter a_getter)
           
 java.lang.Object getExitAddresses()
           
 org.w3c.dom.Element getForwarder()
          Downloads a forwarder entry from the infoservice.
 java.lang.String getId()
          Returns the ID of the infoservice.
 java.util.Hashtable getInfoServices()
          Get a Vector of all infoservices the infoservice knows.
 java.util.Hashtable getInfoServices(boolean a_bJAPClientContext)
           
 java.util.Hashtable getInfoServiceSerials()
           
 JAPVersionInfo getJAPVersionInfo(int a_japVersionType)
          Returns the JAPVersionInfo for the specified type.
 long getLastUpdate()
          Returns the time in milliseconds when this db entry was created from the origin instance.
 java.util.Hashtable getLatestJava()
          Get the latest java versions the infoservice knows ordered by vendors.
 java.util.Hashtable getLatestJavaSerials()
           
 java.util.Vector getListenerInterfaces()
          Returns a snapshot of all listener interfaces of this infoservice.
 ListenerInterface[] getListenerInterfacesArray()
           
 java.util.Hashtable getMessages()
           
 java.util.Hashtable getMessageSerials()
           
 MixCascade getMixCascadeInfo(java.lang.String a_cascadeID)
          Gets information about a specific cascade from the InfoService.
 java.util.Hashtable getMixCascades()
          Get a Vector of all mixcascades the infoservice knows.
 java.util.Hashtable getMixCascades(boolean a_bJAPClientContext)
           
 java.util.Hashtable getMixCascadeSerials()
           
 java.util.Hashtable getMixes(boolean a_bJAPClientContext)
           
 MixInfo getMixInfo(java.lang.String mixId)
          Get the MixInfo for the mix with the given ID.
 byte[] getMixminionNodesList()
          Get the list with the mixminion nodes from the infoservice.
 java.lang.String getName()
          Returns the name of the infoservice.
 JAPMinVersion getNewVersionNumber()
          Get the version String of the currently minimum required JAP version from the infoservice.
 PaymentInstanceDBEntry getPaymentInstance(java.lang.String a_piID)
           
 java.util.Hashtable getPaymentInstances()
          Get a Vector of all payment instances the infoservice knows.
 java.util.Hashtable getPaymentInstances(boolean a_bJAPClientContext)
           
 PerformanceInfo getPerformanceInfo()
          Sends a /performanceinfo request to the Info Service, retrieves the data and creates a new PerformanceInfo object.
 java.lang.String getPostFile()
          This returns the filename (InfoService command), where this InfoServerDBEntry is posted at other InfoServices.
 XMLSignature getSignature()
           
 StatusInfo getStatusInfo(MixCascade a_cascade)
          Get the StatusInfo for the cascade with the given ID.
 StatusInfo getStatusInfo(MixCascade a_cascade, long a_timeout)
          Get the StatusInfo for the cascade with the given ID.
 TermsAndConditionsTemplate getTCTemplate(java.lang.String a_id)
          Get the MixInfo for the mix with the given ID.
 byte[] getTorNodesList()
          Get the list with the tor nodes from the infoservice.
private  java.util.Hashtable getUpdateEntries(java.lang.Class a_distributable, boolean a_bSerials)
           
 long getVersionNumber()
          Returns the time when this infoservice entry was created by the origin infoservice or by the JAP client (if it is a user-defined entry).
private  org.w3c.dom.Document getXmlDocument(HttpRequestStructure a_httpRequest)
           
private  org.w3c.dom.Document getXmlDocument(HttpRequestStructure a_httpRequest, int a_supportedEncodings)
           
 org.w3c.dom.Element getXmlStructure()
          Returns the XML structure for this db entry.
 int hashCode()
          Returns a hashcode for this instance of InfoServiceDBEntry.
 boolean hasPrimaryForwarderList()
          Returns, whether this infoservice keeps a list of JAP forwarders (true) or not (false).
 boolean isBootstrap()
           
 boolean isNeighbour()
          Returns whether this infoservice is a neighbour of our one.
 boolean isPerfServerEnabled()
           
 boolean isPersistanceDeletionAllowed()
           
 boolean isUserDefined()
          Returns whether this InfoServiceDBEntry was generated by a user within the JAP client (true) or was generated by the InfoService 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 markAsBootstrap()
           
 org.w3c.dom.Element postNewForwarder(org.w3c.dom.Element a_japForwarderNode)
          Posts a new forwarder to an infoservice with a JAP forwarder list.
 org.w3c.dom.Element postRenewForwarder(org.w3c.dom.Element a_japForwarderNode)
          Posts the renew message for a forwarder to an infoservice with a JAP forwarder list.
static void setBrowserIdentification(IBrowserIdentification a_browserIdentification)
           
static void setConnectionTimeout(int a_timeoutMS)
           
static void setJVMNetworkErrorHandling(java.lang.Runnable a_threadRestartAfterJVMSocketError, long a_timeRestartAfterJVMSocketError)
          Sets the options for handling a JVM socket error that cannot be recovered.
static void setMutableProxyInterface(IMutableProxyInterface a_proxyInterface)
           
 void setNeighbour(boolean a_bNeighbour)
          Forces this InfoService to be a neighbour or not.
 void setUserDefined(boolean b)
           
 java.lang.String toString()
          Returns a String representation for this InfoService object.
 
Methods inherited from class anon.infoservice.AbstractDistributableDatabaseEntry
getHttpRequestString, getHttpSerialsRequestString, getPostData, getPostEncoding, 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

XML_ELEMENT_CONTAINER_NAME

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

XML_ELEMENT_NAME

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

HEADER_STATISTICS

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

DEFAULT_GET_XML_CONNECTION_TIMEOUT

public static final int DEFAULT_GET_XML_CONNECTION_TIMEOUT
See Also:
Constant Field Values

BLOCK_FACTOR_IF_UNREACHABLE

private static final int BLOCK_FACTOR_IF_UNREACHABLE
See Also:
Constant Field Values

m_getXmlConnectionTimeout

private static int m_getXmlConnectionTimeout

m_timeFirstJVMSocketError

private static long m_timeFirstJVMSocketError

m_timeHandleAfterJVMSocketError

private static long m_timeHandleAfterJVMSocketError

m_threadHandleAfterJVMSocketError

private static java.lang.Runnable m_threadHandleAfterJVMSocketError

ms_proxyInterface

private static IMutableProxyInterface ms_proxyInterface
A proxy interface that is used for all connections and may change over time.


ms_browserIdentification

private static IBrowserIdentification ms_browserIdentification

m_strInfoServiceId

private java.lang.String m_strInfoServiceId
This is the ID of this infoservice.


m_strName

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


m_bTemp

private boolean m_bTemp
Indicates if this is a temporary InfoService entry creates for bootstrapping.


m_infoserviceSoftware

private ServiceSoftware m_infoserviceSoftware
Some information about the used infoservice software.


m_listenerInterfaces

private java.util.Vector m_listenerInterfaces
The ListenerInterfaces of all interfaces (internet-address and port) this infoservice is (virtually) listening on.


m_preferedListenerInterface

private int m_preferedListenerInterface
Stores the number of the preferred ListenerInterface in the listenerInterfaces list. If we have to connect to the infoservice, this interface is used first. If there is a connection error, all other interfaces will be tested. If we can get the connection over another interface, this interface will be set as new preferedListenerInterface.


m_bPrimaryForwarderList

private boolean m_bPrimaryForwarderList
Stores whether this infoservice has a primary forwarder list (true) or not (false).


m_neighbour

private boolean m_neighbour
Describes whether this infoservice is a neighbour of our one. We send all messages only to neighbours, so we have less traffic. For now, every remote infoservice is a neighbour and it is only false for the local one.


m_xmlDescription

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


m_userDefined

private boolean m_userDefined
Stores whether this InfoServiceDBEntry is user-defined within the JAP client (true) or was generated from the InfoService itself (false).


m_creationTimeStamp

private long m_creationTimeStamp
Stores the time when this infoservice entry was created by the origin infoservice or by the JAP client (if it is a user-defined entry). This value is used to determine the more recent infoservice entry, if two entries are compared (higher version number -> more recent entry).


m_signature

private XMLSignature m_signature

m_certPath

private MultiCertPath m_certPath

m_serial

private long m_serial

m_bPerfServerEnabled

private boolean m_bPerfServerEnabled
Constructor Detail

InfoServiceDBEntry

public InfoServiceDBEntry(org.w3c.dom.Element a_infoServiceNode)
                   throws XMLParseException
Creates a new InfoService from XML description (InfoService node). The new entry will be created within the context of the JAP client (the timeout for infoservice entries within the JAP client is used).

Parameters:
a_infoServiceNode - The InfoService node from an XML document.
Throws:
XMLParseException - if an error in the xml structure occurs

InfoServiceDBEntry

public InfoServiceDBEntry(org.w3c.dom.Element a_infoServiceNode,
                          long a_timeout)
                   throws XMLParseException
Creates a new InfoService from XML description (InfoService node).

Parameters:
a_infoServiceNode - The InfoService node from an XML document.
a_timeout - The timeout of the new InfoServiceDBEntry within the database of all InfoServices, see System.currentTimeMillis().
Throws:
XMLParseException - if an error in the xml structure occurs

InfoServiceDBEntry

public InfoServiceDBEntry(java.lang.String a_host,
                          int a_port)
                   throws java.lang.IllegalArgumentException
This is a JAP-only constructor needed to initialise JAP with default InfoServices.

Parameters:
a_host - host name of this info service
a_port - the port where this IS is reachable
Throws:
java.lang.IllegalArgumentException

InfoServiceDBEntry

public InfoServiceDBEntry(java.util.Vector a_ListenerInterfaces)
                   throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

InfoServiceDBEntry

public InfoServiceDBEntry(java.lang.String a_strName,
                          java.lang.String a_id,
                          java.util.Vector a_listeners,
                          boolean a_primaryForwarderList,
                          boolean a_japClientContext,
                          long a_creationTime,
                          long a_serialNumber,
                          boolean a_bPerfServerEnabled)
                   throws java.lang.IllegalArgumentException
Creates a new InfoServiceDBEntry. The ID is set to a generic value derived from the host and the port of the first listener interface. If you supply a name for the infoservice then it will get that name, if you supply null, the name will be of the type "hostname:port". If the new infoservice entry is created within the context of the JAP client, the software info is set to a dummy value. If it is created within the context of the infoservice, the software info is set to the current infoservice version (see Constants.INFOSERVICE_VERSION).

Parameters:
a_strName - The name of the infoservice or null, if a generic name shall be used.
a_listeners - The listeners the infoservice is (virtually) listening on.
a_primaryForwarderList - Whether the infoservice holds a primary forwarder list.
a_japClientContext - Whether the new entry will be created within the context of the JAP client (true) or the context of the InfoService (false). This setting influences the timeout of the created entry within the database of all infoservices.
a_serialNumber - the serial number that indicates if the document has changed since the last time it was updated
Throws:
java.lang.IllegalArgumentException - if invalid listener interfaces are given
Method Detail

generateId

private static java.lang.String generateId(ListenerInterface a_listenerInterface)
This is only for compatibility and will be rewritten next time.

Parameters:
a_listenerInterface - a ListenerInterface of this InfoService
Returns:
Returns an ID for the infoservice (IP:Port of the first listener interface).

isPersistanceDeletionAllowed

public boolean isPersistanceDeletionAllowed()
Overrides:
isPersistanceDeletionAllowed in class AbstractDatabaseEntry

deletePersistence

public void deletePersistence()
Overrides:
deletePersistence in class AbstractDatabaseEntry

setConnectionTimeout

public static void setConnectionTimeout(int a_timeoutMS)

getConnectionTimeout

public static int getConnectionTimeout()

setBrowserIdentification

public static void setBrowserIdentification(IBrowserIdentification a_browserIdentification)

setMutableProxyInterface

public static void setMutableProxyInterface(IMutableProxyInterface a_proxyInterface)

setJVMNetworkErrorHandling

public static void setJVMNetworkErrorHandling(java.lang.Runnable a_threadRestartAfterJVMSocketError,
                                              long a_timeRestartAfterJVMSocketError)
Sets the options for handling a JVM socket error that cannot be recovered.

Parameters:
a_threadRestartAfterJVMSocketError - Runnable
a_timeRestartAfterJVMSocketError - long

generateXmlRepresentation

private org.w3c.dom.Element generateXmlRepresentation()
Generates the XML representation for this InfoServiceDBEntry. That XML representation is returned when calling the toXmlElement method.

Returns:
The generated XML representation for this InfoServiceDBEntry.

getId

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

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

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

getName

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

Returns:
The name of this infoservice.

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

isPerfServerEnabled

public boolean isPerfServerEnabled()

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

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

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 long getVersionNumber()
Returns the time when this infoservice entry was created by the origin infoservice 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 infoservice entry, if two entries are compared (higher version number -> more recent entry).

hasPrimaryForwarderList

public boolean hasPrimaryForwarderList()
Returns, whether this infoservice keeps a list of JAP forwarders (true) or not (false).

Returns:
Whether this infoservice keeps a list of JAP forwarders.

getListenerInterfaces

public java.util.Vector getListenerInterfaces()
Returns a snapshot of all listener interfaces of this infoservice.

Returns:
A Vector with all listener interfaces of this infoservice.

getListenerInterfacesArray

public ListenerInterface[] getListenerInterfacesArray()

isUserDefined

public boolean isUserDefined()
Returns whether this InfoServiceDBEntry was generated by a user within the JAP client (true) or was generated by the InfoService itself (false).

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

setUserDefined

public void setUserDefined(boolean b)

markAsBootstrap

public void markAsBootstrap()

isBootstrap

public boolean isBootstrap()
Specified by:
isBootstrap in interface IBoostrapable

toString

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

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

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 an InfoServiceDBEntry and has the same ID as this InfoServiceDBEntry.

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 an InfoServiceDBEntry which has the same ID as this instance. In any other case, false is returned.

hashCode

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

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

getPostFile

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

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

isNeighbour

public boolean isNeighbour()
Returns whether this infoservice is a neighbour of our one. This is only meaningful within the context of an infoservice. We send all messages only to neighbours, so we have less traffic. For now, every remote infoservice is a neighbour and it is only false for the local one.

Returns:
Whether this infoservice is a neighbour of our one or not.

setNeighbour

public void setNeighbour(boolean a_bNeighbour)
Forces this InfoService to be a neighbour or not.

Parameters:
a_bNeighbour - if this IS should be a neighbour

connectToInfoService

private HTTPConnectionDescriptor connectToInfoService(HTTPConnectionDescriptor lastConnectionDescriptor,
                                                      ImmutableProxyInterface a_proxy,
                                                      int a_supportedEncodings)
Creates a new HTTPConnection to a ListenerInterface from the list of all listener interfaces. The connection is created to the interface, which follows the interface described in lastConnectionDescriptor in the list (if it is the last in the list, we begin with the first again). If you supply null, the return value will be the interface referenced by preferedListenerInterface. The preferedListenerInterface will be set to the interface, the new connection points to. So if the connection is successful (--> the last call of this method has returned a connection to a valid interface), and you want connect again, the preferedListenerInterface references this last interface with a successful connection.

Parameters:
lastConnectionDescriptor - The HTTPConnectionDescriptor of the last connection try (the last output of this function) or null, if you want a new connection (connection to preferedListenerInterface is opened).
a_supportedEncodings - supported http encodings used to receive the data (e.g. HTTP_ENCODING_ZLIB)
Returns:
HTTPConnectionDescriptor with a connection to the next ListenerInterface in the list or to the preferedListenerInterface, if you supplied null.

addPropertyHeader

private static void addPropertyHeader(java.lang.String a_systemPropertyName,
                                      java.util.Vector a_headers)

addPropertyHeader

private static void addPropertyHeader(java.lang.String a_systemPropertyName,
                                      java.lang.String strVersion,
                                      java.util.Vector a_headers)

addPropertyHeader

private static void addPropertyHeader(java.util.Vector a_systemPropertyNames,
                                      java.util.Vector a_headers)

addPropertyHeader

private static void addPropertyHeader(java.util.Vector a_systemPropertyNames,
                                      java.lang.String strVersion,
                                      java.util.Vector a_headers)

getXmlDocument

private org.w3c.dom.Document getXmlDocument(HttpRequestStructure a_httpRequest)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

getXmlDocument

private org.w3c.dom.Document getXmlDocument(HttpRequestStructure a_httpRequest,
                                            int a_supportedEncodings)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

doHttpRequest

private byte[] doHttpRequest(HttpRequestStructure a_httpRequest,
                             int a_supportedEncodings)
                      throws java.lang.Exception
Throws:
java.lang.Exception

getMixCascadeInfo

public MixCascade getMixCascadeInfo(java.lang.String a_cascadeID)
                             throws java.lang.Exception
Gets information about a specific cascade from the InfoService.

Parameters:
a_cascadeID - String
Returns:
MixCascade
Throws:
java.lang.Exception

getMixCascades

public java.util.Hashtable getMixCascades()
                                   throws java.lang.Exception
Get a Vector of all mixcascades the infoservice knows. If we can't get a connection with the infoservice, an Exception is thrown.

Returns:
The Vector of all mixcascades.
Throws:
java.lang.Exception

getPaymentInstances

public java.util.Hashtable getPaymentInstances()
                                        throws java.lang.Exception
Get a Vector of all payment instances the infoservice knows. If we can't get a connection with the infoservice, an Exception is thrown.

Returns:
The Vector of all payment instances.
Throws:
java.lang.Exception

getPaymentInstance

public PaymentInstanceDBEntry getPaymentInstance(java.lang.String a_piID)
                                          throws java.lang.Exception
Throws:
java.lang.Exception

getEntries

private java.util.Hashtable getEntries(InfoServiceDBEntry.EntryGetter a_getter)
                                throws ExpiredSignatureException,
                                       java.security.SignatureException,
                                       java.lang.Exception
Throws:
ExpiredSignatureException
java.security.SignatureException
java.lang.Exception

getInfoServices

public java.util.Hashtable getInfoServices(boolean a_bJAPClientContext)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

getMixCascades

public java.util.Hashtable getMixCascades(boolean a_bJAPClientContext)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

getTCTemplate

public TermsAndConditionsTemplate getTCTemplate(java.lang.String a_id)
                                         throws java.lang.Exception
Get the MixInfo for the mix with the given ID. If we can't get a connection with the infoservice, an Exception is thrown.

Parameters:
mixId - The ID of the mix to get the MixInfo for.
Returns:
The MixInfo for the mix with the given ID.
Throws:
java.lang.Exception

getPaymentInstances

public java.util.Hashtable getPaymentInstances(boolean a_bJAPClientContext)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

getMixes

public java.util.Hashtable getMixes(boolean a_bJAPClientContext)
                             throws java.lang.Exception
Throws:
java.lang.Exception

getInfoServices

public java.util.Hashtable getInfoServices()
                                    throws java.lang.Exception
Get a Vector of all infoservices the infoservice knows. If we can't get a connection with the infoservice, an Exception is thrown.

Returns:
The Vector of all infoservices.
Throws:
java.lang.Exception

getMixCascadeSerials

public java.util.Hashtable getMixCascadeSerials()
                                         throws java.lang.Exception
Throws:
java.lang.Exception

getInfoServiceSerials

public java.util.Hashtable getInfoServiceSerials()
                                          throws java.lang.Exception
Throws:
java.lang.Exception

getMixInfo

public MixInfo getMixInfo(java.lang.String mixId)
                   throws java.lang.Exception
Get the MixInfo for the mix with the given ID. If we can't get a connection with the infoservice, an Exception is thrown.

Parameters:
mixId - The ID of the mix to get the MixInfo for.
Returns:
The MixInfo for the mix with the given ID.
Throws:
java.lang.Exception

getStatusInfo

public StatusInfo getStatusInfo(MixCascade a_cascade)
                         throws java.lang.Exception
Get the StatusInfo for the cascade with the given ID. If we can't get a connection with the infoservice, an Exception is thrown.

Parameters:
cascadeId - The ID of the mixcascade to get the StatusInfo for.
cascadeLength - The length of the mixcascade (number of mixes). We need this for calculating the AnonLevel in the StatusInfo.
Returns:
The current StatusInfo for the mixcascade with the given ID.
Throws:
java.lang.Exception

getExitAddresses

public java.lang.Object getExitAddresses()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

getStatusInfo

public StatusInfo getStatusInfo(MixCascade a_cascade,
                                long a_timeout)
                         throws java.lang.Exception
Get the StatusInfo for the cascade with the given ID. If we can't get a connection with the infoservice, an Exception is thrown.

Parameters:
cascadeId - The ID of the mixcascade to get the StatusInfo for.
cascadeLength - The length of the mixcascade (number of mixes). We need this for calculating the AnonLevel in the StatusInfo.
Returns:
The current StatusInfo for the mixcascade with the given ID.
Throws:
java.lang.Exception

getNewVersionNumber

public JAPMinVersion getNewVersionNumber()
                                  throws java.lang.Exception
Get the version String of the currently minimum required JAP version from the infoservice. This method is called to check, whether connection to the mixcascades are possible with the currently used JAP version. If we can't get a connection with the infoservice, an Exception is thrown.

Returns:
The version String (fromat: nn.nn.nnn) of the current JAP version.
Throws:
java.lang.Exception

getUpdateEntries

private java.util.Hashtable getUpdateEntries(java.lang.Class a_distributable,
                                             boolean a_bSerials)
                                      throws java.lang.Exception
Throws:
java.lang.Exception

getMessages

public java.util.Hashtable getMessages()
                                throws java.lang.Exception
Throws:
java.lang.Exception

getMessageSerials

public java.util.Hashtable getMessageSerials()
                                      throws java.lang.Exception
Throws:
java.lang.Exception

getPerformanceInfo

public PerformanceInfo getPerformanceInfo()
                                   throws java.lang.Exception
Sends a /performanceinfo request to the Info Service, retrieves the data and creates a new PerformanceInfo object.

Returns:
a PerformanceInfo object
Throws:
java.lang.Exception - if the Signature can't be verified, the Info Service doesn't have the information available or can't be reached.

getLatestJava

public java.util.Hashtable getLatestJava()
                                  throws java.lang.Exception
Get the latest java versions the infoservice knows ordered by vendors.

Returns:
the latest java versions
Throws:
java.lang.Exception - If we can't get a connection to the infoservice

getLatestJavaSerials

public java.util.Hashtable getLatestJavaSerials()
                                         throws java.lang.Exception
Throws:
java.lang.Exception

getJAPVersionInfo

public JAPVersionInfo getJAPVersionInfo(int a_japVersionType)
                                 throws java.lang.Exception
Returns the JAPVersionInfo for the specified type. The JAPVersionInfo is generated from the JNLP files received from the infoservice. If we can't get a connection with the infoservice, an Exception is thrown.

Parameters:
a_japVersionType - Selects the JAPVersionInfo (release / development). See the constants in JAPVersionInfo.
Returns:
The JAPVersionInfo of the specified type.
Throws:
java.lang.Exception

getTorNodesList

public byte[] getTorNodesList()
                       throws java.lang.Exception
Get the list with the tor nodes from the infoservice. If we can't get a connection with the infoservice or the infoservice doesn't support the tor nodes list download, an Exception is thrown.

Returns:
The raw tor nodes list as it is distributed by the tor directory servers.
Throws:
java.lang.Exception

getMixminionNodesList

public byte[] getMixminionNodesList()
                             throws java.lang.Exception
Get the list with the mixminion nodes from the infoservice. If we can't get a connection with the infoservice or the infoservice doesn't support the tor nodes list download, an Exception is thrown.

Returns:
The raw mixminion nodes list as it is distributed by the tor directory servers.
Throws:
java.lang.Exception

postNewForwarder

public org.w3c.dom.Element postNewForwarder(org.w3c.dom.Element a_japForwarderNode)
                                     throws java.lang.Exception
Posts a new forwarder to an infoservice with a JAP forwarder list. If we can't reach the infoservice or if it has not a forwarder list, an Exception is thrown.

Parameters:
a_japForwarderNode - The JapForwarder node of the "post forwarder to infoservice" XML structure.
Returns:
The JapForwarder node of the answer of the infoservice's addforwarder command.
Throws:
java.lang.Exception

postRenewForwarder

public org.w3c.dom.Element postRenewForwarder(org.w3c.dom.Element a_japForwarderNode)
                                       throws java.lang.Exception
Posts the renew message for a forwarder to an infoservice with a JAP forwarder list. If we can't reach the infoservice or if it has not a forwarder list, an Exception is thrown.

Parameters:
a_japForwarderNode - The JapForwarder node of the "renew forwarder" XML structure.
Returns:
The JapForwarder node of the answer of the infoservice's renewforwarder command.
Throws:
java.lang.Exception

getForwarder

public org.w3c.dom.Element getForwarder()
                                 throws java.lang.Exception
Downloads a forwarder entry from the infoservice. If this infoservice has no forwarder list, it will ask an infoservice with such a list and returns the answer to us. If we can't reach the infoservice or if this infoservice doesn't know a forwarder, an Exception is thrown.

Returns:
The JapForwarder node of the answer of the infoservice's getforwarder command.
Throws:
java.lang.Exception