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
-
Constructor Summary
ConstructorDescriptionDefault 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 aConditions
element from an existing XML block. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds an audience restriction condition within thisConditions
Element.boolean
checkDateValidity
(long someTime) Returns true if a specific Date falls within the validity interval of this set of conditions.protected AudienceRestrictionCondition
createAudienceRestrictionCondition
(Element audienceRestrictionElement) protected DoNotCacheCondition
createDoNotCacheCondition
(Element doNotCacheConditionElement) Returns a set of theAudienceRestrictionCondition
elements held within thisConditions
element.ReturnsDoNotCacheCondition
elements held within thisConditions
elementReturns the earliest time at which the assertion is valid held in thisConditions
object.Returns the time instant held within thisConditions
object at which theAssertion
has expired.boolean
removeAudienceRestrictionCondition
(String audience) Removes an audience restriction conditionAudienceRestrictionCondition
from thisConditions
object wherein the specified audience has been defined.void
setDoNotCacheCondition
(DoNotCacheCondition doNotCacheCnd) SetsDoNotCacheCondition
elements held within thisConditions
element.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 thenotBefore
instant is afternotOnOrAfter
instant.
-
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
-Condition
objectarc
- 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
-Condition
objectarc
- the<AudienceRestrictionCondition>
to be added. Can be null, if no audience restriction.doNotCacheCnd
-DoNotCacheCondition
object- Throws:
SAMLException
- if there is a problem in input data and it cannot be processed correctly.
-
Conditions
Constructs aConditions
element from an existing XML block.- Parameters:
conditionsElement
- Aorg.w3c.dom.Element
representing DOM tree forConditions
object- 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 thisConditions
object.- Returns:
- A Date containing the
NotBefore
time held within thisConditions
element.
-
getNotOnorAfter
Returns the time instant held within thisConditions
object at which theAssertion
has expired.- Returns:
- time instant (at which assertion has expired) held within this
Conditions
element.
-
addAudienceRestrictionCondition
Adds an audience restriction condition within thisConditions
Element.- Parameters:
arc
- aAudienceRestrictionCondition
to 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
someDate
is within the valid interval of theConditions
.
-
getAudienceRestrictionCondition
Returns a set of theAudienceRestrictionCondition
elements held within thisConditions
element.- Returns:
- A set of the audience restriction conditions. Each element
contained within is an object of
AudienceRestrictionCondition
type.
-
removeAudienceRestrictionCondition
Removes an audience restriction conditionAudienceRestrictionCondition
from thisConditions
object wherein the specified audience has been defined.- Parameters:
audience
- A string representing audience.- Returns:
- true if the operation succeeds.
-
setDoNotCacheCondition
SetsDoNotCacheCondition
elements held within thisConditions
element.- Parameters:
doNotCacheCnd
- anDoNotCacheCondition
object.
-
getDoNotCacheCondition
ReturnsDoNotCacheCondition
elements held within thisConditions
element- Returns:
- an
DoNotCacheCondition
object 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
-