public class TrustModel extends BasicTrustModel implements IXMLEncodable
Modifier and Type | Class and Description |
---|---|
static class |
TrustModel.AnonLevelAttribute |
static class |
TrustModel.ContextAttribute |
static class |
TrustModel.DataRetentionAttribute |
static class |
TrustModel.DelayAttribute |
static class |
TrustModel.ForcePremiumIfChargedAccountAttribute |
static class |
TrustModel.ForcePremiumIfExistingUserAttribute |
static class |
TrustModel.InnerObservable |
static class |
TrustModel.InternationalAttribute |
static class |
TrustModel.NumberOfMixesAttribute |
static class |
TrustModel.OperatorBlacklistAttribute |
static class |
TrustModel.PremiumChargedAccountAttribute |
static class |
TrustModel.SocksAttribute |
static class |
TrustModel.SpeedAttribute |
static class |
TrustModel.TrustAttribute |
static class |
TrustModel.UsePremiumAttribute |
static class |
TrustModel.UserDefinedAttribute |
Modifier and Type | Field and Description |
---|---|
static int |
FIRST_UNRESERVED_MODEL_ID
Unreserved IDs may be used by controller classes to define more models.
|
static java.lang.String |
MSG_BLACKLISTED |
static java.lang.String |
MSG_EXCEPTION_FREE_CASCADE |
static java.lang.String |
MSG_EXCEPTION_NOT_ENOUGH_MIXES |
static java.lang.String |
MSG_EXCEPTION_TOO_MANY_MIXES |
static java.lang.String |
MSG_PI_UNAVAILABLE |
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 TrustModel |
TRUST_MODEL_ALL_SERVICES |
static int |
TRUST_MODEL_DEFAULT_INDEX |
static int |
TRUST_RESERVED
Reserved for future use
|
static java.lang.String |
XML_ELEMENT_CONTAINER_NAME |
static java.lang.String |
XML_ELEMENT_NAME |
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION
Constructor and Description |
---|
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
|
TrustModel(TrustModel a_trustModel)
Creates a TrustModel object from another TrustModel object
|
Modifier and Type | Method and Description |
---|---|
static void |
addModelObserver(java.util.Observer a_observer) |
static void |
allowAttributeWhitelist(MixCascade a_cascade)
Allow the given service even if the current filter has attributes that would otherwise disallow its usage.
|
static boolean |
areListenerInterfacesBlocked(MixCascade a_cascade) |
void |
checkTrust(MixCascade a_cascade,
boolean a_bCheckUserDefined) |
static void |
cleanAttributeWhitelist(MixCascade a_currentCascade) |
void |
clone(TrustModel a_trustModel) |
void |
copyAttributes(TrustModel a_trustModel) |
int |
countTrustedCascades() |
static void |
deleteModelObserver(java.util.Observer a_observer) |
boolean |
equals(java.lang.Object a_trustModel)
Compares two TrustModel objects
|
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 java.util.Vector |
getTrustModels() |
boolean |
hasFreeCascades() |
int |
hashCode() |
boolean |
hasPremiumCascades() |
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 |
isFreeAllowed() |
boolean |
isFreeServicesForced() |
static boolean |
isNoPaymentInstanceFound(MixCascade a_cascade) |
boolean |
isPaymentForced() |
java.util.Vector |
readUntrustedAttributeText(MixCascade a_cascade) |
void |
removeAllAttributes() |
static TrustModel |
removeTrustModel(TrustModel a_trustModel) |
static void |
restoreDefault() |
TrustModel.TrustAttribute |
setAttribute(java.lang.Class a_attr,
int a_trustCondition) |
TrustModel.TrustAttribute |
setAttribute(java.lang.Class a_attr,
int a_trustCondition,
int a_conditionValue) |
TrustModel.TrustAttribute |
setAttribute(java.lang.Class a_attr,
int a_trustCondition,
java.lang.Object a_conditionValue) |
TrustModel.TrustAttribute |
setAttribute(java.lang.Class a_attr,
int a_trustCondition,
java.util.Vector a_conditionValue) |
static void |
setCurrentTrustModel(long a_id) |
static void |
setCurrentTrustModel(TrustModel a_trustModel) |
static void |
setFreeAllowed(boolean a_bFreeAllowed) |
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) |
void |
unblockInterfacesFromDatabase() |
static boolean |
updateContext(java.lang.String a_context) |
checkTrust, isTrusted, isTrusted
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
public static final int TRUST_MODEL_DEFAULT_INDEX
public static final TrustModel TRUST_MODEL_ALL_SERVICES
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 java.lang.String MSG_SERVICES_WITHOUT_COSTS
public static final java.lang.String MSG_PI_UNAVAILABLE
public static final java.lang.String MSG_BLACKLISTED
public static final java.lang.String MSG_EXCEPTION_FREE_CASCADE
public static final java.lang.String MSG_EXCEPTION_NOT_ENOUGH_MIXES
public static final java.lang.String MSG_EXCEPTION_TOO_MANY_MIXES
public TrustModel(java.lang.String a_strName, long a_id)
a_strName
- The name of the TrustModelpublic 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 dataXMLParseException
public static java.lang.String getContext()
public static boolean updateContext(java.lang.String a_context)
public void unblockInterfacesFromDatabase()
public void copyAttributes(TrustModel a_trustModel)
public void clone(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 void setFreeAllowed(boolean a_bFreeAllowed)
public static boolean isFreeAllowed()
public static void allowAttributeWhitelist(MixCascade a_cascade)
a_cascade
- public static void cleanAttributeWhitelist(MixCascade a_currentCascade)
public static TrustModel removeTrustModel(TrustModel a_trustModel)
public TrustModel.TrustAttribute setAttribute(java.lang.Class a_attr, int a_trustCondition)
public TrustModel.TrustAttribute setAttribute(java.lang.Class a_attr, int a_trustCondition, int a_conditionValue)
public TrustModel.TrustAttribute setAttribute(java.lang.Class a_attr, int a_trustCondition, java.lang.Object a_conditionValue)
public TrustModel.TrustAttribute setAttribute(java.lang.Class a_attr, int a_trustCondition, java.util.Vector a_conditionValue)
public boolean isEditable()
public void removeAllAttributes()
public TrustModel.TrustAttribute getAttribute(java.lang.Class a_attr)
public static java.util.Vector getTrustModels()
public static void setCurrentTrustModel(long a_id)
public static void setCurrentTrustModel(TrustModel a_trustModel)
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 documentpublic boolean isFreeServicesForced()
public boolean isPaymentForced()
public boolean isAdded()
public int countTrustedCascades()
public boolean hasTrustedCascades()
public boolean hasPremiumCascades()
public boolean hasFreeCascades()
public static boolean isBlacklisted(MixCascade a_cascade)
public static boolean areListenerInterfacesBlocked(MixCascade a_cascade)
public static boolean isNoPaymentInstanceFound(MixCascade a_cascade)
public java.util.Vector readUntrustedAttributeText(MixCascade a_cascade)
public void checkTrust(MixCascade a_cascade, boolean a_bCheckUserDefined) throws TrustException, ServiceSignatureException
checkTrust
in interface ITrustModel
checkTrust
in class BasicTrustModel
TrustException
ServiceSignatureException
Copyright © 2023. All rights reserved.