public class InfoServiceHolder extends java.util.Observable implements IXMLEncodable, HTTPClient.IHTTPClientDNSResolver
Modifier and Type | Class and Description |
---|---|
private class |
InfoServiceHolder.InformationFetcher |
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 |
private static int |
GET_ANON_ADDRESS |
private static int |
GET_CASCADEINFO |
private static int |
GET_DNS_QUERY |
private static int |
GET_EXIT_ADDRESSES |
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_MIXINFOS
Function number for fetchInformation() - getMixInfo().
|
private static int |
GET_MIXMINIONNODESLIST
Function number for fetchInformation() - getMixminionNodesList().
|
private static int |
GET_MY_IP |
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_PERFORMANCE_INFO |
private static int |
GET_STATUSINFO
Function number for fetchInformation() - getStatusInfo().
|
private static int |
GET_STATUSINFO_TIMEOUT |
private static int |
GET_TC_SERIALS |
private static int |
GET_TC_TEMPLATE |
private static int |
GET_TC_TEMPLATES |
private static int |
GET_TCS |
private static int |
GET_TORNODESLIST
Function number for fetchInformation() - getTorNodesList().
|
private static java.lang.String[] |
GETS |
private boolean |
m_changeInfoServices
Stores, whether there is an automatic change of infoservice after
failure.
|
private int |
m_nrAskedInfoServices |
private ThreadPool |
m_poolFetchInformation
Allows only 3 concurrent update operations.
|
private InfoServiceDBEntry |
m_preferredInfoService
Stores the preferred InfoService.
|
private HTTPClient.HTTPClientSocketFactory |
m_socketFactory |
static int |
MAXIMUM_OF_ASKED_INFO_SERVICES |
static int |
MAXIMUM_OF_ASKED_INFO_SERVICES_FOR_PERFORMANCE |
private static InfoServiceHolder |
ms_infoServiceHolderInstance
Stores the instance of InfoServiceHolder (Singleton).
|
private static int |
POST_ANON_ADDRESS |
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.
|
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION
Modifier | Constructor and Description |
---|---|
private |
InfoServiceHolder()
This creates a new instance of InfoServiceHolder.
|
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.
|
private java.lang.Object |
fetchInformation(int functionNumber,
java.util.Vector arguments)
Fetches every information from the infoservices.
|
private static void |
filterServiceContext(java.util.Hashtable serviceObjects,
java.lang.String context)
helper function that filters service objects matching the specified
service context.
|
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
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 int GET_STATUSINFO_TIMEOUT
private static final int GET_PERFORMANCE_INFO
private static final int GET_TC_TEMPLATE
private static final int GET_TCS
private static final int GET_TC_SERIALS
private static final int GET_EXIT_ADDRESSES
private static final int GET_TC_TEMPLATES
private static final int GET_MY_IP
private static final int GET_DNS_QUERY
private static final int GET_ANON_ADDRESS
private static final int POST_ANON_ADDRESS
private static final int GET_MIXINFOS
private static final java.lang.String[] GETS
public static final boolean DEFAULT_INFOSERVICE_CHANGES
private static final java.lang.String XML_ATTR_ASKED_INFO_SERVICES
private static InfoServiceHolder ms_infoServiceHolderInstance
private ThreadPool m_poolFetchInformation
private InfoServiceDBEntry m_preferredInfoService
private boolean m_changeInfoServices
private int m_nrAskedInfoServices
private HTTPClient.HTTPClientSocketFactory m_socketFactory
private InfoServiceHolder()
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()
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 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
private static void filterServiceContext(java.util.Hashtable serviceObjects, java.lang.String context)
serviceObjects
- table of service objects to be filteredcontext
- the service context that the service objects must matchCopyright © 2023. All rights reserved.