|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable anon.client.BasicTrustModel anon.client.TrustModel
public class TrustModel
This is the general trust model for JAP.
Nested Class Summary | |
---|---|
static class |
TrustModel.AnonLevelAttribute
|
static class |
TrustModel.ContextAttribute
|
static class |
TrustModel.DataRetentionAttribute
|
static class |
TrustModel.DelayAttribute
|
static class |
TrustModel.InnerObservable
|
static class |
TrustModel.InternationalAttribute
|
static class |
TrustModel.NumberOfMixesAttribute
|
static class |
TrustModel.OperatorBlacklistAttribute
|
static class |
TrustModel.PremiumAttribute
|
static class |
TrustModel.SocksAttribute
|
static class |
TrustModel.SpeedAttribute
|
static class |
TrustModel.TrustAttribute
|
static class |
TrustModel.UserDefinedAttribute
|
Field Summary | |
---|---|
private static TrustModel |
CONTEXT_MODEL_ALL
|
private static TrustModel |
CONTEXT_MODEL_BUSINESS
|
private static TrustModel |
CONTEXT_MODEL_FREE
|
private static TrustModel |
CONTEXT_MODEL_PREMIUM
|
private static TrustModel |
CONTEXT_MODEL_PREMIUM_PRIVATE
|
static int |
FIRST_UNRESERVED_MODEL_ID
Unreserved IDs may be used by controller classes to define more models. |
private boolean |
m_bEditable
|
private long |
m_id
|
private java.lang.String |
m_strName
|
private java.util.Hashtable |
m_trustAttributes
|
private static TrustModel |
ms_currentTrustModel
|
private static java.lang.String |
ms_strContext
|
private static TrustModel.InnerObservable |
ms_trustModelObservable
|
private static java.util.Vector |
ms_trustModels
|
private static java.lang.String |
MSG_ALL_SERVICES
|
static java.lang.String |
MSG_BLACKLISTED
|
private static java.lang.String |
MSG_CASCADES_FILTER
|
private static java.lang.String |
MSG_EXCEPTION_BLACKLISTED
|
private static java.lang.String |
MSG_EXCEPTION_DATA_RETENTION
|
private static java.lang.String |
MSG_EXCEPTION_EXPIRED_CERT
|
static java.lang.String |
MSG_EXCEPTION_FREE_CASCADE
|
private static java.lang.String |
MSG_EXCEPTION_INTERNATIONAL
|
private static java.lang.String |
MSG_EXCEPTION_NO_SOCKS
|
private static java.lang.String |
MSG_EXCEPTION_NOT_ENOUGH_ANON
|
static java.lang.String |
MSG_EXCEPTION_NOT_ENOUGH_MIXES
|
private static java.lang.String |
MSG_EXCEPTION_NOT_ENOUGH_SPEED
|
private static java.lang.String |
MSG_EXCEPTION_NOT_INTERNATIONAL
|
private static java.lang.String |
MSG_EXCEPTION_NOT_USER_DEFINED
|
private static java.lang.String |
MSG_EXCEPTION_PAY_CASCADE
|
private static java.lang.String |
MSG_EXCEPTION_RESPONSE_TIME_TOO_HIGH
|
private static java.lang.String |
MSG_EXCEPTION_TOO_FEW_COUNTRIES
|
private static java.lang.String |
MSG_EXCEPTION_WRONG_SERVICE_CONTEXT
|
static java.lang.String |
MSG_PI_UNAVAILABLE
|
private static java.lang.String |
MSG_SERVICES_BUSINESS
|
private static java.lang.String |
MSG_SERVICES_PREMIUM_PRIVATE
|
private static java.lang.String |
MSG_SERVICES_USER_DEFINED
|
private static java.lang.String |
MSG_SERVICES_WITH_COSTS
|
static java.lang.String |
MSG_SERVICES_WITHOUT_COSTS
|
static java.lang.Integer |
NOTIFY_TRUST_MODEL_ADDED
|
static java.lang.Integer |
NOTIFY_TRUST_MODEL_CHANGED
|
static java.lang.Integer |
NOTIFY_TRUST_MODEL_REMOVED
|
static int |
TRUST_ALWAYS
Always trust the cascade, regardless of the attribute |
static int |
TRUST_IF_AT_LEAST
Only trust the cascade if the attribute is greater than a specified value |
static int |
TRUST_IF_AT_MOST
Only trust the cascade if the attribute is lesser than a specified value |
static int |
TRUST_IF_NOT_IN_LIST
Only trust the cascade if the attribute value is not within the specified list |
static int |
TRUST_IF_NOT_TRUE
Only trust the cascade if the attribute is NOT true |
static int |
TRUST_IF_TRUE
Only trust the cascade if the attribute is true |
static long |
TRUST_MODEL_ALL
|
private static TrustModel |
TRUST_MODEL_CUSTOM_FILTER
|
private static TrustModel |
TRUST_MODEL_DEFAULT
|
private static TrustModel |
TRUST_MODEL_PREMIUM
|
static TrustModel |
TRUST_MODEL_USER_DEFINED
|
static int |
TRUST_RESERVED
Reserved for future use |
private static java.lang.String |
XML_ATTR_CURRENT_TRUST_MODEL
|
private static java.lang.String |
XML_ATTR_NAME
|
static java.lang.String |
XML_ELEMENT_CONTAINER_NAME
|
static java.lang.String |
XML_ELEMENT_NAME
|
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 | |
---|---|
|
TrustModel(org.w3c.dom.Element a_trustModelElement)
Creates a TrustModel object from an XML element |
|
TrustModel(java.lang.String a_strName,
long a_id)
Creates a new TrustModel object with the specified name |
private |
TrustModel(java.lang.String a_strName,
long a_id,
boolean b_allowReservedID)
|
|
TrustModel(TrustModel a_trustModel)
Creates a TrustModel object from another TrustModel object |
Method Summary | |
---|---|
static void |
addModelObserver(java.util.Observer a_observer)
|
static boolean |
addTrustModel(TrustModel a_trustModel)
|
void |
checkTrust(MixCascade a_cascade)
|
void |
copyFrom(TrustModel a_trustModel)
|
static void |
deleteModelObserver(java.util.Observer a_observer)
|
boolean |
equals(java.lang.Object a_trustModel)
Compares two TrustModel objects |
static void |
forceFreeTrustModel()
|
static void |
fromXmlElement(org.w3c.dom.Element a_container)
|
TrustModel.TrustAttribute |
getAttribute(java.lang.Class a_attr)
|
static java.lang.String |
getContext()
|
static TrustModel |
getCurrentTrustModel()
|
static TrustModel |
getCustomFilter()
|
long |
getId()
|
java.lang.String |
getName()
Returns the localized name of the TrustModel |
static java.util.Observable |
getObservable()
|
static TrustModel |
getTrustModelDefault()
|
static TrustModel |
getTrustModelPremium()
|
static java.util.Vector |
getTrustModels()
|
static TrustModel |
getTrustModelUserDefined()
|
int |
hashCode()
|
boolean |
hasTrustedCascades()
Checks if the current trust model has any trusted cascades at all |
boolean |
isAdded()
|
static boolean |
isBlacklisted(MixCascade a_cascade)
|
boolean |
isEditable()
|
static boolean |
isNoPaymentInstanceFound(MixCascade a_cascade)
|
boolean |
isPaymentForced()
|
static TrustModel |
removeTrustModel(TrustModel a_trustModel)
|
static void |
restoreDefault()
|
TrustModel.TrustAttribute |
setAttribute(java.lang.Class a_attr,
int a_trustCondition)
|
private TrustModel.TrustAttribute |
setAttribute(java.lang.Class a_attr,
int a_trustCondition,
boolean a_bIgnoreNoDataAvailable)
|
TrustModel.TrustAttribute |
setAttribute(java.lang.Class a_attr,
int a_trustCondition,
int a_conditionValue)
|
private TrustModel.TrustAttribute |
setAttribute(java.lang.Class a_attr,
int a_trustCondition,
int a_conditionValue,
boolean a_bIgnoreNoDataAvailable)
|
private TrustModel.TrustAttribute |
setAttribute(java.lang.Class a_attr,
int a_trustCondition,
java.lang.Object a_conditionValue,
boolean a_bIgnoreNoDataAvailable)
|
TrustModel.TrustAttribute |
setAttribute(java.lang.Class a_attr,
int a_trustCondition,
java.util.Vector a_conditionValue)
|
private TrustModel.TrustAttribute |
setAttribute(TrustModel.TrustAttribute a_attr)
|
static void |
setCurrentTrustModel(long a_id)
|
static void |
setCurrentTrustModel(TrustModel a_trustModel)
|
void |
setEditable(boolean a_bEditable)
|
void |
setName(java.lang.String a_strName)
|
java.lang.String |
toString()
|
org.w3c.dom.Element |
toXmlElement(org.w3c.dom.Document a_doc)
Return an element that can be appended to the document. |
static org.w3c.dom.Element |
toXmlElement(org.w3c.dom.Document a_doc,
java.lang.String a_xmlContainerName)
|
static boolean |
updateContext(java.lang.String a_context)
|
Methods inherited from class anon.client.BasicTrustModel |
---|
isTrusted, isTrusted |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Integer NOTIFY_TRUST_MODEL_CHANGED
public static final java.lang.Integer NOTIFY_TRUST_MODEL_ADDED
public static final java.lang.Integer NOTIFY_TRUST_MODEL_REMOVED
public static final int FIRST_UNRESERVED_MODEL_ID
public static final java.lang.String XML_ELEMENT_NAME
public static final java.lang.String XML_ELEMENT_CONTAINER_NAME
private static final java.lang.String XML_ATTR_CURRENT_TRUST_MODEL
private static final java.lang.String XML_ATTR_NAME
public static final TrustModel TRUST_MODEL_USER_DEFINED
private static TrustModel TRUST_MODEL_DEFAULT
private static TrustModel TRUST_MODEL_PREMIUM
private static TrustModel TRUST_MODEL_CUSTOM_FILTER
public static final int TRUST_ALWAYS
public static final int TRUST_IF_NOT_TRUE
public static final int TRUST_IF_TRUE
public static final int TRUST_IF_AT_LEAST
public static final int TRUST_IF_AT_MOST
public static final int TRUST_IF_NOT_IN_LIST
public static final int TRUST_RESERVED
public static final long TRUST_MODEL_ALL
private static final java.lang.String MSG_SERVICES_WITH_COSTS
public static final java.lang.String MSG_SERVICES_WITHOUT_COSTS
private static final java.lang.String MSG_SERVICES_USER_DEFINED
private static final java.lang.String MSG_CASCADES_FILTER
private static final java.lang.String MSG_ALL_SERVICES
private static final java.lang.String MSG_SERVICES_BUSINESS
private static final java.lang.String MSG_SERVICES_PREMIUM_PRIVATE
public static final java.lang.String MSG_PI_UNAVAILABLE
public static final java.lang.String MSG_BLACKLISTED
private static final java.lang.String MSG_EXCEPTION_NO_SOCKS
private static final java.lang.String MSG_EXCEPTION_DATA_RETENTION
private static final java.lang.String MSG_EXCEPTION_PAY_CASCADE
public static final java.lang.String MSG_EXCEPTION_FREE_CASCADE
private static final java.lang.String MSG_EXCEPTION_WRONG_SERVICE_CONTEXT
public static final java.lang.String MSG_EXCEPTION_NOT_ENOUGH_MIXES
private static final java.lang.String MSG_EXCEPTION_EXPIRED_CERT
private static final java.lang.String MSG_EXCEPTION_NOT_USER_DEFINED
private static final java.lang.String MSG_EXCEPTION_TOO_FEW_COUNTRIES
private static final java.lang.String MSG_EXCEPTION_NOT_INTERNATIONAL
private static final java.lang.String MSG_EXCEPTION_INTERNATIONAL
private static final java.lang.String MSG_EXCEPTION_NOT_ENOUGH_ANON
private static final java.lang.String MSG_EXCEPTION_BLACKLISTED
private static final java.lang.String MSG_EXCEPTION_NOT_ENOUGH_SPEED
private static final java.lang.String MSG_EXCEPTION_RESPONSE_TIME_TOO_HIGH
private static java.util.Vector ms_trustModels
private static TrustModel ms_currentTrustModel
private static java.lang.String ms_strContext
private static TrustModel.InnerObservable ms_trustModelObservable
private static final TrustModel CONTEXT_MODEL_PREMIUM
private static final TrustModel CONTEXT_MODEL_PREMIUM_PRIVATE
private static final TrustModel CONTEXT_MODEL_BUSINESS
private static final TrustModel CONTEXT_MODEL_FREE
private static final TrustModel CONTEXT_MODEL_ALL
private java.util.Hashtable m_trustAttributes
private java.lang.String m_strName
private long m_id
private boolean m_bEditable
Constructor Detail |
---|
public TrustModel(java.lang.String a_strName, long a_id)
a_strName
- The name of the TrustModelprivate TrustModel(java.lang.String a_strName, long a_id, boolean b_allowReservedID)
public TrustModel(TrustModel a_trustModel)
a_trustModel
- The TrustModel object to copypublic TrustModel(org.w3c.dom.Element a_trustModelElement) throws XMLParseException
a_trustModelElement
- The XML element which holds the TrustModel data
XMLParseException
Method Detail |
---|
public static java.lang.String getContext()
public static boolean updateContext(java.lang.String a_context)
public void copyFrom(TrustModel a_trustModel)
public static java.util.Observable getObservable()
public static void addModelObserver(java.util.Observer a_observer)
public static void deleteModelObserver(java.util.Observer a_observer)
public boolean equals(java.lang.Object a_trustModel)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static boolean addTrustModel(TrustModel a_trustModel)
public static TrustModel removeTrustModel(TrustModel a_trustModel)
public TrustModel.TrustAttribute setAttribute(java.lang.Class a_attr, int a_trustCondition)
private TrustModel.TrustAttribute setAttribute(java.lang.Class a_attr, int a_trustCondition, boolean a_bIgnoreNoDataAvailable)
public TrustModel.TrustAttribute setAttribute(java.lang.Class a_attr, int a_trustCondition, int a_conditionValue)
private TrustModel.TrustAttribute setAttribute(java.lang.Class a_attr, int a_trustCondition, int a_conditionValue, boolean a_bIgnoreNoDataAvailable)
public TrustModel.TrustAttribute setAttribute(java.lang.Class a_attr, int a_trustCondition, java.util.Vector a_conditionValue)
public void setEditable(boolean a_bEditable)
public boolean isEditable()
private TrustModel.TrustAttribute setAttribute(java.lang.Class a_attr, int a_trustCondition, java.lang.Object a_conditionValue, boolean a_bIgnoreNoDataAvailable)
private TrustModel.TrustAttribute setAttribute(TrustModel.TrustAttribute a_attr)
public TrustModel.TrustAttribute getAttribute(java.lang.Class a_attr)
public static java.util.Vector getTrustModels()
public static void forceFreeTrustModel()
public static void setCurrentTrustModel(long a_id)
public static void setCurrentTrustModel(TrustModel a_trustModel)
public static TrustModel getTrustModelUserDefined()
public static TrustModel getTrustModelPremium()
public static TrustModel getTrustModelDefault()
public static TrustModel getCurrentTrustModel()
public static TrustModel getCustomFilter()
public static void fromXmlElement(org.w3c.dom.Element a_container)
public static void restoreDefault()
public static org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc, java.lang.String a_xmlContainerName)
public void setName(java.lang.String a_strName) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public java.lang.String getName()
public java.lang.String toString()
toString
in class java.lang.Object
public long getId()
public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
IXMLEncodable
toXmlElement
in interface IXMLEncodable
a_doc
- a document
public boolean isPaymentForced()
public boolean isAdded()
public boolean hasTrustedCascades()
public static boolean isBlacklisted(MixCascade a_cascade)
public static boolean isNoPaymentInstanceFound(MixCascade a_cascade)
public void checkTrust(MixCascade a_cascade) throws TrustException, java.security.SignatureException
checkTrust
in interface ITrustModel
checkTrust
in class BasicTrustModel
TrustException
java.security.SignatureException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |