Package com.sun.identity.saml.assertion
Class Conditions
java.lang.Object
com.sun.identity.saml.assertion.Conditions
This
Conditions is a set of Condition.
The validity of an Assertion MAY be subject to a set of
Conditions. Each Condition evaluates to a value
that is Valid, Invalid or Indeterminate.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault ConstructorConditions(Date notBefore, Date notOnOrAfter) Constructs an instance ofConditions.Conditions(Date notBefore, Date notOnOrAfter, Condition condition, AudienceRestrictionCondition arc) Constructs an instance ofConditions.Conditions(Date notBefore, Date notOnOrAfter, Condition condition, AudienceRestrictionCondition arc, DoNotCacheCondition doNotCacheCnd) Constructs an instance ofConditions.Conditions(Element conditionsElement) Constructs aConditionselement from an existing XML block. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds an audience restriction condition within thisConditionsElement.booleancheckDateValidity(long someTime) Returns true if a specific Date falls within the validity interval of this set of conditions.protected AudienceRestrictionConditioncreateAudienceRestrictionCondition(Element audienceRestrictionElement) protected DoNotCacheConditioncreateDoNotCacheCondition(Element doNotCacheConditionElement) Returns a set of theAudienceRestrictionConditionelements held within thisConditionselement.ReturnsDoNotCacheConditionelements held within thisConditionselementReturns the earliest time at which the assertion is valid held in thisConditionsobject.Returns the time instant held within thisConditionsobject at which theAssertionhas expired.booleanremoveAudienceRestrictionCondition(String audience) Removes an audience restriction conditionAudienceRestrictionConditionfrom thisConditionsobject wherein the specified audience has been defined.voidsetDoNotCacheCondition(DoNotCacheCondition doNotCacheCnd) SetsDoNotCacheConditionelements held within thisConditionselement.toString()Returns a String representation of the element.toString(boolean includeNS, boolean declareNS) Returns a String representation of the<Conditions>element.
-
Field Details
-
doNotCache
-
-
Constructor Details
-
Conditions
public Conditions()Default Constructor -
Conditions
Constructs an instance ofConditions.- Parameters:
notBefore- specifies the earliest time instant at which the assertion is valid.notOnOrAfter- specifies the time instant at which the assertion has expired.- Throws:
SAMLException- if thenotBeforeinstant is afternotOnOrAfterinstant.
-
Conditions
public Conditions(Date notBefore, Date notOnOrAfter, Condition condition, AudienceRestrictionCondition arc) throws SAMLException Constructs an instance ofConditions.- Parameters:
notBefore- specifies the earliest time instant at which the assertion is valid.notOnOrAfter- specifies the time instant at which the assertion has expired.condition-Conditionobjectarc- the<AudienceRestrictionCondition>to be added.Can be null, if no audience restriction.- Throws:
SAMLException- if there is a problem in input data and it cannot be processed correctly.
-
Conditions
public Conditions(Date notBefore, Date notOnOrAfter, Condition condition, AudienceRestrictionCondition arc, DoNotCacheCondition doNotCacheCnd) throws SAMLException Constructs an instance ofConditions.- Parameters:
notBefore- specifies the earliest time instant at which the assertion is valid.notOnOrAfter- specifies the time instant at which the assertion has expired.condition-Conditionobjectarc- the<AudienceRestrictionCondition>to be added. Can be null, if no audience restriction.doNotCacheCnd-DoNotCacheConditionobject- Throws:
SAMLException- if there is a problem in input data and it cannot be processed correctly.
-
Conditions
Constructs aConditionselement from an existing XML block.- Parameters:
conditionsElement- Aorg.w3c.dom.Elementrepresenting DOM tree forConditionsobject- Throws:
SAMLException- if it could not process the Element properly, implying that there is an error in the sender or in the element definition.
-
-
Method Details
-
getNotBefore
Returns the earliest time at which the assertion is valid held in thisConditionsobject.- Returns:
- A Date containing the
NotBeforetime held within thisConditionselement.
-
getNotOnorAfter
Returns the time instant held within thisConditionsobject at which theAssertionhas expired.- Returns:
- time instant (at which assertion has expired) held within this
Conditionselement.
-
addAudienceRestrictionCondition
Adds an audience restriction condition within thisConditionsElement.- Parameters:
arc- aAudienceRestrictionConditionto be added to thisConditions.- Returns:
- true if the operation succeeds.
-
checkDateValidity
public boolean checkDateValidity(long someTime) Returns true if a specific Date falls within the validity interval of this set of conditions.- Parameters:
someTime- Any time in milliseconds.- Returns:
- true if
someDateis within the valid interval of theConditions.
-
getAudienceRestrictionCondition
Returns a set of theAudienceRestrictionConditionelements held within thisConditionselement.- Returns:
- A set of the audience restriction conditions. Each element
contained within is an object of
AudienceRestrictionConditiontype.
-
removeAudienceRestrictionCondition
Removes an audience restriction conditionAudienceRestrictionConditionfrom thisConditionsobject wherein the specified audience has been defined.- Parameters:
audience- A string representing audience.- Returns:
- true if the operation succeeds.
-
setDoNotCacheCondition
SetsDoNotCacheConditionelements held within thisConditionselement.- Parameters:
doNotCacheCnd- anDoNotCacheConditionobject.
-
getDoNotCacheCondition
ReturnsDoNotCacheConditionelements held within thisConditionselement- Returns:
- an
DoNotCacheConditionobject if Conditions contains anyDoNotCacheCondition, otherwise return null.
-
toString
Returns a String representation of the element. -
toString
Returns a String representation of the<Conditions>element.- Parameters:
includeNS- Determines whether or not the namespace qualifier is prepended to the Element when converteddeclareNS- Determines whether or not the namespace is declared within the Element.- Returns:
- A string containing the valid XML for this element.
-
createAudienceRestrictionCondition
protected AudienceRestrictionCondition createAudienceRestrictionCondition(Element audienceRestrictionElement) throws SAMLException - Throws:
SAMLException
-
createDoNotCacheCondition
protected DoNotCacheCondition createDoNotCacheCondition(Element doNotCacheConditionElement) throws SAMLException - Throws:
SAMLException
-