|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable anon.infoservice.InfoServiceHolder
public class InfoServiceHolder
This class holds the instances of the InfoService class for the JAP client and is a singleton. The instance of this class is observable and will send a notification with an InfoServiceHolderMessage, if the preferred InfoService or the InfoService management policy were changed.
Field Summary | |
---|---|
static int |
DEFAULT_OF_ASKED_INFO_SERVICES
|
private static int |
GET_CASCADEINFO
|
private static int |
GET_FORWARDER
Function number for fetchInformation() - getForwarder(). |
private static int |
GET_INFOSERVICE_SERIALS
|
private static int |
GET_INFOSERVICES
Function number for fetchInformation() - getInfoServices(). |
private static int |
GET_JAPVERSIONINFO
Function number for fetchInformation() - getJAPVersionInfo(). |
private static int |
GET_LATEST_JAVA
|
private static int |
GET_LATEST_JAVA_SERIALS
|
private static int |
GET_MESSAGE_SERIALS
|
private static int |
GET_MESSAGES
|
private static int |
GET_MIXCASCADE_SERIALS
|
private static int |
GET_MIXCASCADES
Function number for fetchInformation() - getMixCascades(). |
private static int |
GET_MIXINFO
Function number for fetchInformation() - getMixInfo(). |
private static int |
GET_MIXMINIONNODESLIST
Function number for fetchInformation() - getMixminionNodesList(). |
private static int |
GET_NEWVERSIONNUMBER
Function number for fetchInformation() - getNewVersionNumber(). |
private static int |
GET_PAYMENT_INSTANCE
Function number for fetchInformation() - getPaymentInstance(). |
private static int |
GET_PAYMENT_INSTANCES
Function number for fetchInformation() - getPaymentInstances(). |
private static int |
GET_STATUSINFO
Function number for fetchInformation() - getStatusInfo(). |
private static int |
GET_TORNODESLIST
Function number for fetchInformation() - getTorNodesList(). |
private boolean |
m_changeInfoServices
Stores, whether there is an automatic change of infoservice after failure. |
private int |
m_nrAskedInfoServices
|
private InfoServiceDBEntry |
m_preferredInfoService
Stores the preferred InfoService. |
static int |
MAXIMUM_OF_ASKED_INFO_SERVICES
|
private static InfoServiceHolder |
ms_infoServiceHolderInstance
Stores the instance of InfoServiceHolder (Singleton). |
private static java.lang.String |
XML_ATTR_ASKED_INFO_SERVICES
|
static java.lang.String |
XML_ELEM_CHANGE_INFO_SERVICES
|
static java.lang.String |
XML_ELEMENT_NAME
Stores the name of the root node of the XML settings for this class. |
Fields inherited from interface anon.util.IXMLEncodable |
---|
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_VERSION |
Constructor Summary | |
---|---|
private |
InfoServiceHolder()
This creates a new instance of InfoServiceHolder. |
Method Summary | |
---|---|
private java.lang.Object |
fetchInformation(int functionNumber,
java.util.Vector arguments)
Fetches every information from the infoservices. |
org.w3c.dom.Element |
getForwarder()
Downloads a forwarder entry from a infoservice. |
java.util.Hashtable |
getInfoServices()
Get a Vector of all infoservices the preferred infoservice knows. |
java.util.Hashtable |
getInfoServiceSerials()
|
java.util.Vector |
getInfoservicesWithForwarderList()
Returns a Vector of InfoServices with all known infoservices (including the preferred infoservice), which have a forwarder list. |
static InfoServiceHolder |
getInstance()
Returns the instance of InfoServiceHolder (Singleton). |
JAPVersionInfo |
getJAPVersionInfo(int japVersionType)
Returns the JAPVersionInfo for the specified type. |
java.util.Hashtable |
getLatestJavaVersions()
Returns all known latests Java versions as JavaVersionDBEntry. |
java.util.Hashtable |
getLatestJavaVersionSerials()
|
java.util.Hashtable |
getMessages()
|
java.util.Hashtable |
getMessageSerials()
|
MixCascade |
getMixCascadeInfo(java.lang.String a_cascadeID)
|
java.util.Hashtable |
getMixCascades()
Get a Vector of all mixcascades the preferred infoservice knows. |
java.util.Hashtable |
getMixCascadeSerials()
|
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. |
JAPMinVersion |
getNewVersionNumber()
Get the version String of the current JAP version from the infoservice. |
int |
getNumberOfAskedInfoServices()
|
PaymentInstanceDBEntry |
getPaymentInstance(java.lang.String a_piID)
Get information for a particular payment instance identified by a_piID |
java.util.Vector |
getPaymentInstances()
Get a Vector of all payment instances the preferred infoservice knows. |
InfoServiceDBEntry |
getPreferredInfoService()
Returns the preferred InfoService. |
StatusInfo |
getStatusInfo(java.lang.String cascadeId,
int cascadeLength)
Get the StatusInfo for the mixcascade with the given ID. |
byte[] |
getTorNodesList()
Get the list with the tor nodes from the infoservice. |
static java.lang.String |
getXmlSettingsRootNodeName()
Returns the name of the XML node used to store all settings of the InfoServiceHolder instance. |
boolean |
isChangeInfoServices()
Returns, whether there is an automatic change of infoservice after failure. |
void |
loadSettingsFromXml(org.w3c.dom.Element a_infoServiceManagementNode,
boolean a_bForceISChange)
Restores the settings of this instance of InfoServiceHolder with the settings stored in the specified XML node. |
void |
setChangeInfoServices(boolean a_changeInfoServices)
Sets, whether there is an automatic change of infoservice after failure. |
void |
setNumberOfAskedInfoServices(int a_nrAskedInfoServices)
|
void |
setPreferredInfoService(InfoServiceDBEntry a_preferredInfoService)
Sets the preferred InfoService. |
org.w3c.dom.Element |
toXmlElement(org.w3c.dom.Document a_doc)
Returns all settings (including the database of known infoservices) as an XML node. |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String XML_ELEMENT_NAME
public static final java.lang.String XML_ELEM_CHANGE_INFO_SERVICES
public static final int MAXIMUM_OF_ASKED_INFO_SERVICES
public static final int DEFAULT_OF_ASKED_INFO_SERVICES
private static final int GET_MIXCASCADES
private static final int GET_INFOSERVICES
private static final int GET_MIXINFO
private static final int GET_STATUSINFO
private static final int GET_NEWVERSIONNUMBER
private static final int GET_JAPVERSIONINFO
private static final int GET_TORNODESLIST
private static final int GET_FORWARDER
private static final int GET_PAYMENT_INSTANCES
private static final int GET_PAYMENT_INSTANCE
private static final int GET_MIXMINIONNODESLIST
private static final int GET_CASCADEINFO
private static final int GET_LATEST_JAVA
private static final int GET_INFOSERVICE_SERIALS
private static final int GET_MIXCASCADE_SERIALS
private static final int GET_MESSAGES
private static final int GET_LATEST_JAVA_SERIALS
private static final int GET_MESSAGE_SERIALS
private static final java.lang.String XML_ATTR_ASKED_INFO_SERVICES
private static InfoServiceHolder ms_infoServiceHolderInstance
private InfoServiceDBEntry m_preferredInfoService
private boolean m_changeInfoServices
private int m_nrAskedInfoServices
Constructor Detail |
---|
private InfoServiceHolder()
Method Detail |
---|
public static InfoServiceHolder getInstance()
public static java.lang.String getXmlSettingsRootNodeName()
public void setPreferredInfoService(InfoServiceDBEntry a_preferredInfoService)
a_preferredInfoService
- The preferred InfoService.public InfoServiceDBEntry getPreferredInfoService()
public int getNumberOfAskedInfoServices()
public void setNumberOfAskedInfoServices(int a_nrAskedInfoServices)
public void setChangeInfoServices(boolean a_changeInfoServices)
a_changeInfoServices
- Whether there are automatic changes of the infoservice.public boolean isChangeInfoServices()
public java.util.Vector getInfoservicesWithForwarderList()
private java.lang.Object fetchInformation(int functionNumber, java.util.Vector arguments)
functionNumber
- Specifies the InfoService function to call. Look at the constants
defined in this class.arguments
- If an InfoService function needs arguments, these are in here.
public java.util.Hashtable getMixCascades()
public java.util.Hashtable getMixCascadeSerials()
public java.util.Vector getPaymentInstances()
public PaymentInstanceDBEntry getPaymentInstance(java.lang.String a_piID) throws java.lang.Exception
java.lang.Exception
public java.util.Hashtable getInfoServices()
public java.util.Hashtable getInfoServiceSerials()
public MixInfo getMixInfo(java.lang.String mixId)
mixId
- The ID of the mix to get the MixInfo for.
public StatusInfo getStatusInfo(java.lang.String cascadeId, int cascadeLength)
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.
public JAPMinVersion getNewVersionNumber()
public java.util.Hashtable getLatestJavaVersions()
public java.util.Hashtable getLatestJavaVersionSerials()
public java.util.Hashtable getMessages()
public java.util.Hashtable getMessageSerials()
public JAPVersionInfo getJAPVersionInfo(int japVersionType)
japVersionType
- Selects the JAPVersionInfo (release / development). Look at the
Constants in JAPVersionInfo.
public byte[] getTorNodesList()
public MixCascade getMixCascadeInfo(java.lang.String a_cascadeID)
public byte[] getMixminionNodesList()
public org.w3c.dom.Element getForwarder()
public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
toXmlElement
in interface IXMLEncodable
a_doc
- The parent document for the created XML node.
public void loadSettingsFromXml(org.w3c.dom.Element a_infoServiceManagementNode, boolean a_bForceISChange) throws java.lang.Exception
a_infoServiceManagementNode
- The XML node for loading the settings from. The name of
the needed XML node can be obtained by calling
getXmlSettingsRootNodeName().a_bForceISChange
- if automatic change if IS is forced
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |