|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object anon.infoservice.AbstractDatabaseEntry anon.infoservice.StatusInfo
public final class StatusInfo
Holds the information of a mixcascade status.
Field Summary | |
---|---|
static int |
ANON_LEVEL_MAX
|
static int |
ANON_LEVEL_MIN
|
private int |
m_anonLevel
This is the calculated anonymity level (from number of active users, current traffic and cascade length). |
private MultiCertPath |
m_certPath
The certificate path |
private int |
m_currentRisk
Stores the current risk for using this mix cascade. |
private long |
m_lastUpdate
Time (see System.currentTimeMillis()) when the mixcascade (first mix) has sent this status message. |
private java.lang.String |
m_mixCascadeId
This is the ID of the mixcascade to which this status belongs. |
private long |
m_mixedPackets
This is the number of packets, which are mixed through the cascade since their startup. |
private int |
m_nrOfActiveUsers
Stores the number of active users in the corresponding mixcascade. |
private XMLSignature |
m_signature
The signature of the StatusInfo |
private java.lang.String |
m_statusXmlData
Stores the XML description which we forward to other infoservices (the same as we have received). |
private byte[] |
m_statusXmlDataBytes
Stores the XML description as byte-array for fast processing |
private int |
m_trafficSituation
Stores the current traffic situation for the mixcascade. |
static java.lang.String |
XML_ELEMENT_CONTAINER_NAME
|
static java.lang.String |
XML_ELEMENT_NAME
|
Fields inherited from class anon.infoservice.AbstractDatabaseEntry |
---|
XML_ATTR_LAST_UPDATE, XML_LAST_UPDATE |
Fields inherited from interface anon.infoservice.IDistributable |
---|
FIELD_HTTP_REQUEST_STRING, FIELD_HTTP_SERIALS_REQUEST_STRING |
Fields inherited from interface anon.util.IXMLEncodable |
---|
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION |
Constructor Summary | |
---|---|
|
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). |
private |
StatusInfo(java.lang.String a_mixCascadeId,
int a_nrOfActiveUsers,
int a_currentRisk,
int a_trafficSituation,
long a_mixedPackets,
int a_anonLevel)
Constructs a StatusInfo out of the single values. |
Method Summary | |
---|---|
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. |
private org.w3c.dom.Element |
generateXmlRepresentation()
Generates an XML representation for this StatusInfo entry. |
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()
|
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 |
Methods inherited from class anon.infoservice.AbstractDatabaseEntry |
---|
deletePersistence, getCreationTime, getExpireTime, isNewerThan, isPersistanceDeletionAllowed, isUserDefined, resetCreationTime |
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_ELEMENT_CONTAINER_NAME
public static final int ANON_LEVEL_MIN
public static final int ANON_LEVEL_MAX
private java.lang.String m_mixCascadeId
private long m_lastUpdate
private int m_nrOfActiveUsers
private int m_currentRisk
private int m_trafficSituation
private long m_mixedPackets
private int m_anonLevel
private java.lang.String m_statusXmlData
private byte[] m_statusXmlDataBytes
private XMLSignature m_signature
private MultiCertPath m_certPath
Constructor Detail |
---|
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
private StatusInfo(java.lang.String a_mixCascadeId, int a_nrOfActiveUsers, int a_currentRisk, int a_trafficSituation, long a_mixedPackets, int a_anonLevel)
a_mixCascadeId
- The ID of the mixcascade this StatusInfo belongs to.a_nrOfActiveUsers
- The number of active users in the cascade.a_currentRisk
- The risk calculated by the cascade (between 0 and 100).a_trafficSituation
- The amount of traffic in the cascade.a_mixedPackets
- The number of packets the cascade has mixed since startup.a_anonLevel
- The anonymity level calculated by the JAP client (between 0 and 5).Method Detail |
---|
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 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()
private org.w3c.dom.Element generateXmlRepresentation()
public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
toXmlElement
in interface IXMLEncodable
a_doc
- a document
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |