public class MixCascade extends AbstractDistributableCertifiedDatabaseEntry implements AnonServerDescription, IVerifyable, IServiceContextContainer, Database.IWebInfo, ListenerInterface.IListenerInterfaceGetter
AbstractDistributableDatabaseEntry.SerialDBEntry, AbstractDistributableDatabaseEntry.Serials
XML_ATTR_LAST_UPDATE, XML_ATTR_SERIAL, XML_ATTR_VALID, XML_ATTR_VERIFIED
XML_LAST_UPDATE
CONTEXT_JONDONYM, CONTEXT_JONDONYM_COMPATIBILITY, CONTEXT_JONDONYM_PREMIUM, XML_ATTR_CONTEXT
FIELD_XML_ELEMENT_WEBINFO_CONTAINER
FIELD_HTTP_REQUEST_STRING, FIELD_HTTP_SERIALS_REQUEST_STRING
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION
Constructor and Description |
---|
MixCascade(byte[] a_bCompressedMixCascadeNode)
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.lang.String a_hostName,
int a_port,
long a_timeout) |
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) |
Modifier and Type | Method and Description |
---|---|
boolean |
areListenerInterfacesBlocked() |
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.
|
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.
|
java.lang.String |
getAccessControlPreSharedSecret()
Returns the pre-shared secret used as credential for access control.
|
MultiCertPath |
getCertPath() |
byte[] |
getCompressedData() |
java.lang.String |
getConcatenatedPriceCertHashes() |
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).
|
ListenerInterface |
getListenerInterface(java.lang.String a_id) |
java.util.Vector |
getListenerInterfaces() |
int |
getMaxOpenChannels() |
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() if all operator and mix
certificates are valid.
|
PaymentInstanceDBEntry |
getPaymentInstance() |
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 |
isAccessControlled() |
boolean |
isActiveStudy() |
boolean |
isDefaultVerified() |
boolean |
isFromCascade()
Returns if this MixCascade has been received 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.
|
boolean |
isVPNSupported() |
void |
setAccessControlPreSharedSecret(java.lang.String a_strPreShardSecret)
Set the pre-shared secret used as credential for access control.
|
void |
setListenerInterfaces(org.w3c.dom.Element listenerInterfacesNode) |
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.
|
getHttpRequestString, getHttpSerialsRequestString, toXmlElement
getCreationTime, getExpireTime, isNewerThan, resetCreationTime, setExpireTime
public static final java.lang.String SUPPORTED_PAYMENT_PROTOCOL_VERSION
public static final java.lang.String TC_REQUIRED_VERSION_SUFFIX
public static final int DISTRIBUTION_MIN
public static final int DISTRIBUTION_MAX
public static final java.lang.String XML_ELEMENT_NAME
public static final java.lang.String XML_ELEMENT_CONTAINER_NAME
public static final java.lang.String XML_ELEMENT_WEBINFO_CONTAINER
public static final java.lang.String XML_ELEMENT_WEBINFO
public static final java.lang.String XML_ELEMENT_WEBINFO_CASCADE_NAME
public static final java.lang.String XML_ELEMENT_WEBINFO_NAME
public static final java.lang.String XML_ELEMENT_WEBINFO_COMPOSED_NAME
public static final java.lang.String XML_ELEMENT_WEBINFO_CURR_USERS
public static final java.lang.String XML_ATTR_WEBINFO_OPERATOR_COUNT
public static final java.lang.String XML_ATTR_WEBINFO_DISTRIBUTION
public static final java.lang.String XML_ATTR_WEBINFO_MIX_COUNTRY
public static final java.lang.String XML_ATTR_WEBINFO_MIX_POSITION
public static final java.lang.String XML_ATTR_WEBINFO_OP_COUNTRY
public static final java.lang.String INFOSERVICE_COMMAND_WEBINFOS
public static final java.lang.String INFOSERVICE_COMMAND_WEBINFO
public static final int MAX_CASCADE_NAME_LENGTH
public MixCascade(byte[] a_bCompressedMixCascadeNode) throws XMLParseException
a_bCompressedMixCascadeNode
- The MixCascade node from a compressed XML document.XMLParseException
public MixCascade(org.w3c.dom.Element a_mixCascadeNode) throws XMLParseException
a_mixCascadeNode
- The MixCascade node from an XML document.XMLParseException
public MixCascade(org.w3c.dom.Element a_mixCascadeNode, long a_expireTime) throws XMLParseException
a_mixCascadeNode
- The MixCascade node from an XML document.a_expireTime
- forces a specific expire time; takes default expire time if <= 0XMLParseException
public MixCascade(org.w3c.dom.Element a_mixCascadeNode, long a_expireTime, java.lang.String a_mixIDFromCascade) throws XMLParseException
a_mixCascadeNode
- The MixCascade node from an XML document.a_expireTime
- forces a specific expire time; takes default expire time if <= 0a_mixIDFromCascade
- if this is a MixCascade node directly received from a cascade
(it is stripped) it gets this mix id; otherwise it must be nullXMLParseException
public MixCascade(java.lang.String a_hostName, int a_port) throws java.lang.Exception
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.java.lang.Exception
public MixCascade(java.lang.String a_name, java.lang.String a_id, java.lang.String a_hostName, int a_port) throws java.lang.Exception
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.java.lang.Exception
public MixCascade(java.lang.String a_name, java.lang.String a_id, java.util.Vector a_listenerInterfaces) throws java.lang.Exception
java.lang.Exception
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
java.lang.Exception
public MixCascade(java.lang.String a_name, java.lang.String a_id, java.lang.String a_hostName, int a_port, long a_timeout) throws java.lang.Exception
java.lang.Exception
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
java.lang.Exception
public boolean isPersistanceDeletionAllowed()
isPersistanceDeletionAllowed
in class AbstractDatabaseEntry
public void deletePersistence()
deletePersistence
in class AbstractDatabaseEntry
public boolean compareMixIDs(MixCascade a_cascade)
a_cascade
- MixCascadepublic java.lang.String getId()
getId
in interface IDistributable
getId
in interface ListenerInterface.IListenerInterfaceGetter
getId
in class AbstractDatabaseEntry
public java.lang.String getMixProtocolVersion()
public java.lang.String getPaymentProtocolVersion()
public PaymentInstanceDBEntry getPaymentInstance()
public java.lang.String getPIID()
public long getPrepaidInterval()
public boolean isFromCascade()
public long getVersionNumber()
getVersionNumber
in class AbstractDatabaseEntry
public long getLastUpdate()
AbstractDatabaseEntry
getLastUpdate
in class AbstractDatabaseEntry
public java.lang.String getMixNames()
public java.lang.String getName()
public int getMaxUsers()
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Vector getDecomposedCascadeName()
public boolean equals(java.lang.Object a_object)
equals
in class java.lang.Object
a_object
- The object with which to compare.public boolean checkId()
AbstractDistributableCertifiedDatabaseEntry
checkId
in interface ICertifiedDatabaseEntry
checkId
in class AbstractDistributableCertifiedDatabaseEntry
public int hashCode()
hashCode
in class java.lang.Object
public int getNumberOfListenerInterfaces()
public ListenerInterface getListenerInterface(int i)
i
- The number of the ListenerInterface.public ListenerInterface getListenerInterface(java.lang.String a_id)
getListenerInterface
in interface ListenerInterface.IListenerInterfaceGetter
public java.util.Vector getListenerInterfaces()
getListenerInterfaces
in interface ListenerInterface.IListenerInterfaceGetter
public java.lang.String getHostsAsString()
public java.lang.String getPortsAsString()
public java.util.Vector getHosts()
public int getNumberOfMixes()
public java.lang.String getMixIDsAsString()
public MixInfo getMixInfo(int a_mixNumber)
a_mixNumber
- a mix position from 0 to getNumberOfMixes() - 1public MixInfo getMixInfo(java.lang.String a_mixId)
a_mixId
- a Mix idpublic java.lang.String getMixId(int a_mixNumber)
a_mixNumber
- a mix position from 0 to getNumberOfMixes() - 1public java.util.Vector getMixIds()
public boolean isUserDefined()
isUserDefined
in class AbstractDatabaseEntry
public boolean isSocks5Supported()
public boolean isVPNSupported()
public void showAsTrusted(boolean a_bImplicitTrust)
a_bImplicitTrust
- if this service is shown as trusted in this applicationpublic boolean isShownAsTrusted()
public void setUserDefined(boolean a_bUserDefined, MixCascade a_oldMixCascade) throws XMLParseException
XMLParseException
public StatusInfo fetchCurrentStatus()
public StatusInfo fetchCurrentStatus(long a_timeout)
public StatusInfo getCurrentStatus()
public java.lang.String getPostFile()
getPostFile
in interface IDistributable
public int getPostEncoding()
AbstractDistributableDatabaseEntry
getPostEncoding
in interface IDistributable
getPostEncoding
in class AbstractDistributableDatabaseEntry
public byte[] getPostData()
getPostData
in interface IDistributable
getPostData
in class AbstractDistributableDatabaseEntry
public byte[] getCompressedData()
public org.w3c.dom.Element getXmlStructure()
getXmlStructure
in class AbstractDistributableDatabaseEntry
public java.lang.String getConcatenatedPriceCertHashes()
public java.util.Hashtable getPriceCertificateHashes()
public java.util.Vector getPriceCertificates()
public int getNrOfPriceCerts()
public XMLSignature getSignature()
getSignature
in interface ICertifiedDatabaseEntry
getSignature
in class AbstractDistributableCertifiedDatabaseEntry
public MultiCertPath getCertPath()
getCertPath
in interface IVerifyable
getCertPath
in interface ICertifiedDatabaseEntry
public boolean isVerified()
AbstractDistributableCertifiedDatabaseEntry
isVerified
in interface IVerifyable
isVerified
in interface ICertifiedDatabaseEntry
isVerified
in class AbstractDistributableCertifiedDatabaseEntry
public boolean isDefaultVerified()
public boolean isValid()
IVerifyable
isValid
in interface IVerifyable
isValid
in interface ICertifiedDatabaseEntry
public DataRetentionInformation getDataRetentionInformation()
public boolean isActiveStudy()
public int getNumberOfOperators()
public boolean areListenerInterfacesBlocked()
public int getNumberOfOperatorsShown()
public int getNumberOfCountries()
public int getDistribution()
public boolean isPaymentProtocolSupported()
public boolean isPayment()
public boolean isAccessControlled()
public boolean isTermsAndConditionsConfirmationRequired()
public java.lang.String getContext()
getContext
in interface IServiceContextContainer
public org.w3c.dom.Element getWebInfo(org.w3c.dom.Document webInfoDoc)
getWebInfo
in interface Database.IWebInfo
public java.lang.String getAccessControlPreSharedSecret()
public void setAccessControlPreSharedSecret(java.lang.String a_strPreShardSecret)
a_strPreShardSecret
- pre-shared secret used as credential for access controlpublic int getMaxOpenChannels()
public void setListenerInterfaces(org.w3c.dom.Element listenerInterfacesNode) throws XMLParseException
XMLParseException
Copyright © 2023. All rights reserved.