public final class StatusInfo extends AbstractDatabaseEntry implements IDistributable, IVerifyable, IXMLEncodable
Modifier and Type | Field and Description |
---|---|
static int |
ANON_LEVEL_MAX |
static int |
ANON_LEVEL_MIN |
static java.lang.String |
XML_ELEMENT_CONTAINER_NAME |
static java.lang.String |
XML_ELEMENT_NAME |
XML_ATTR_LAST_UPDATE, XML_LAST_UPDATE
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 |
---|
StatusInfo(org.w3c.dom.Element a_statusNode)
Creates a new StatusInfo from XML description (MixCascadeStatus node).
|
StatusInfo(org.w3c.dom.Element a_statusNode,
long a_timeout)
Creates a new StatusInfo from XML description (MixCascadeStatus node).
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkId() |
static StatusInfo |
createDummyStatusInfo(java.lang.String a_mixCascadeId)
Returns a new StatusInfo with dummy values (everything is set to -1).
|
org.w3c.dom.Node |
generateMixCascadeCurrentStatus()
This is a compatibility method for the creation of the CurrentStatus in the MixCascade
XML structure for old JAP clients.
|
int |
getAnonLevel()
Returns the calculated anonymity level (from number of active users, current traffic
and cascade length).
|
MultiCertPath |
getCertPath() |
int |
getCurrentRisk()
Returns the current risk for using this mix cascade.
|
java.lang.String |
getHtmlTableLine(boolean a_bPassiveMode)
Returns a HTML table line with the data of this StatusDBEntry.
|
java.lang.String |
getId()
Returns the mixcascade ID of this status.
|
long |
getLastUpdate()
Returns the time (see System.currentTimeMillis()), when the mixcascade has sent this
StatusInfo to an InfoService.
|
long |
getMixedPackets()
Returns the number of packets, which are mixed through the cascade since their startup.
|
int |
getNrOfActiveUsers()
Returns the number of active users in the corresponding mixcascade.
|
byte[] |
getPostData()
This returns the data, which are posted 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 status entry is posted at other
infoservices.
|
XMLSignature |
getSignature() |
static StatusInfo |
getStatusInfo(MixCascade a_service) |
java.lang.String |
getStatusXmlData()
Returns the XML structure of this status entry as we received it.
|
int |
getTrafficSituation()
Returns the current traffic situation for the mixcascade.
|
long |
getVersionNumber()
Returns the time when this StatusInfo was created by the origin mixcascade (or by the JAP
client if it is a dummy entry).
|
static java.lang.String |
getXmlElementName()
Returns the name of the XML element corresponding to this class ("MixCascadeStatus").
|
boolean |
isValid()
Returns if the object is valid at this time
|
boolean |
isVerified()
Returns if the object has been verified by checking its signature(s).
|
org.w3c.dom.Element |
toXmlElement(org.w3c.dom.Document a_doc)
Returns an XML Node of the current StatusInfo using the stored XML String
|
deletePersistence, getCreationTime, getExpireTime, isNewerThan, isPersistanceDeletionAllowed, isUserDefined, resetCreationTime, setExpireTime
public static final java.lang.String XML_ELEMENT_NAME
public static final java.lang.String XML_ELEMENT_CONTAINER_NAME
public static final int ANON_LEVEL_MIN
public static final int ANON_LEVEL_MAX
public StatusInfo(org.w3c.dom.Element a_statusNode) throws java.lang.Exception
a_statusNode
- The MixCascadeStatus node from an XML document.java.lang.Exception
public StatusInfo(org.w3c.dom.Element a_statusNode, long a_timeout) throws java.lang.Exception
a_statusNode
- The MixCascadeStatus node from an XML document.a_mixCascadeLength
- The number of mixes in the mixcascade. We need this for
calculating the anonymity level. If this value is smaller than 0,
no anonymity level is calculated and getAnonLevel() will return
-1.a_timeout
- A timeout.java.lang.Exception
public static StatusInfo createDummyStatusInfo(java.lang.String a_mixCascadeId)
a_mixCascadeId
- The ID of the MixCascade the StatusInfo belongs to.public static java.lang.String getXmlElementName()
public java.lang.String getId()
getId
in interface IDistributable
getId
in class AbstractDatabaseEntry
public long getLastUpdate()
getLastUpdate
in class AbstractDatabaseEntry
public long getVersionNumber()
getVersionNumber
in class AbstractDatabaseEntry
public int getNrOfActiveUsers()
public int getCurrentRisk()
public int getTrafficSituation()
public long getMixedPackets()
public int getAnonLevel()
public boolean isVerified()
IVerifyable
isVerified
in interface IVerifyable
public boolean isValid()
IVerifyable
isValid
in interface IVerifyable
public XMLSignature getSignature()
public MultiCertPath getCertPath()
getCertPath
in interface IVerifyable
public boolean checkId()
public java.lang.String getPostFile()
getPostFile
in interface IDistributable
public static StatusInfo getStatusInfo(MixCascade a_service)
public byte[] getPostData()
getPostData
in interface IDistributable
public int getPostEncoding()
IDistributable
getPostEncoding
in interface IDistributable
public java.lang.String getStatusXmlData()
public java.lang.String getHtmlTableLine(boolean a_bPassiveMode)
public org.w3c.dom.Node generateMixCascadeCurrentStatus()
public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
toXmlElement
in interface IXMLEncodable
a_doc
- a documentCopyright © 2023. All rights reserved.