public class InfoServiceHolder extends java.util.Observable implements IXMLEncodable, HTTPClient.IHTTPClientDNSResolver
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_INFOSERVICE_CHANGES
This defines, whether there is an automatic change of infoservice after
failure as default.
|
static int |
DEFAULT_OF_ASKED_INFO_SERVICES |
static int |
MAXIMUM_OF_ASKED_INFO_SERVICES |
static int |
MAXIMUM_OF_ASKED_INFO_SERVICES_FOR_PERFORMANCE |
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.
|
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION
Modifier and Type | Method and Description |
---|---|
java.net.InetAddress[] |
doDNSQuery(java.lang.String a_strHostName)
Does a DNS query and returns all IP addresses for the given host.
|
java.net.InetAddress[] |
getAllByName(java.lang.String host)
Implement the method of IHTTPClientDNSResolver
|
ANONAddress |
getANONAddress(java.lang.String id)
Get the ANONAddress with the give id from the InfoService.
|
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 |
getMixCascades(java.lang.String context)
same as getMixCascades but a service context that the cascades must match
can be specfied.
|
java.util.Hashtable |
getMixCascadeSerials() |
java.util.Hashtable |
getMixCascadeSerials(java.lang.String context)
same as getMixCascadesSerials but a service context that the serials must
match can be specified.
|
MixInfo |
getMixInfo(java.lang.String mixId)
Get the MixInfo for the mix with the given ID.
|
java.util.Hashtable |
getMixInfos() |
byte[] |
getMixminionNodesList()
Get the list with the mixminion nodes from the infoservice.
|
java.net.InetAddress |
getMyIP(java.lang.Integer a_proxyPolicy) |
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.Hashtable |
getPaymentInstances()
Get a Vector of all payment instances the preferred infoservice knows.
|
java.util.Hashtable |
getPerformanceInfos() |
InfoServiceDBEntry |
getPreferredInfoService()
Returns the preferred InfoService.
|
StatusInfo |
getStatusInfo(MixCascade a_cascade)
Get the StatusInfo for the mixcascade with the given ID.
|
StatusInfo |
getStatusInfo(MixCascade a_cascade,
long a_timeout) |
TermsAndConditionsTemplate |
getTCTemplate(java.lang.String a_id)
from preferred info service
|
java.util.Hashtable |
getTCTemplates() |
java.util.Hashtable |
getTermsAndConditions() |
java.util.Hashtable |
getTermsAndConditionsSerials() |
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 |
postANONAddress(ANONAddress addr) |
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.
|
void |
setSocketFactory(HTTPClient.HTTPClientSocketFactory socketFactory) |
void |
shutdown() |
org.w3c.dom.Element |
toXmlElement(org.w3c.dom.Document a_doc)
Returns all settings (including the database of known infoservices) as an
XML node.
|
java.util.Hashtable |
updateExitAddresses() |
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 MAXIMUM_OF_ASKED_INFO_SERVICES_FOR_PERFORMANCE
public static final int DEFAULT_OF_ASKED_INFO_SERVICES
public static final boolean DEFAULT_INFOSERVICE_CHANGES
public static InfoServiceHolder getInstance()
public void shutdown()
public void setSocketFactory(HTTPClient.HTTPClientSocketFactory socketFactory)
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()
public java.util.Hashtable getMixCascades()
public java.util.Hashtable getMixCascades(java.lang.String context)
context
- service context that the returned cascades must matchpublic java.util.Hashtable getMixCascadeSerials()
public java.util.Hashtable getMixCascadeSerials(java.lang.String context)
context
- service context that the returned cascades must matchpublic TermsAndConditionsTemplate getTCTemplate(java.lang.String a_id)
public java.util.Hashtable getTCTemplates()
public java.util.Hashtable getTermsAndConditions()
public java.util.Hashtable getTermsAndConditionsSerials()
public java.util.Hashtable getPerformanceInfos()
public java.util.Hashtable updateExitAddresses()
public java.util.Hashtable 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 java.net.InetAddress getMyIP(java.lang.Integer a_proxyPolicy)
public MixInfo getMixInfo(java.lang.String mixId)
mixId
- The ID of the mix to get the MixInfo for.public java.util.Hashtable getMixInfos()
public StatusInfo getStatusInfo(MixCascade a_cascade)
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 StatusInfo getStatusInfo(MixCascade a_cascade, long a_timeout)
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 java.net.InetAddress[] doDNSQuery(java.lang.String a_strHostName)
a_strHostName,
- the host to lookuppublic java.net.InetAddress[] getAllByName(java.lang.String host) throws java.net.UnknownHostException
getAllByName
in interface HTTPClient.IHTTPClientDNSResolver
java.net.UnknownHostException
public ANONAddress getANONAddress(java.lang.String id)
id
- the ID of the ANONaddress to fetchpublic void postANONAddress(ANONAddress addr)
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 forcedjava.lang.Exception
Copyright © 2023. All rights reserved.