Package com.sun.identity.saml.assertion
Class Conditions
- java.lang.Object
-
- com.sun.identity.saml.assertion.Conditions
-
@SupportedAll public class Conditions extends Object
ThisConditions
is a set ofCondition
. The validity of anAssertion
MAY be subject to a set ofConditions
. EachCondition
evaluates to a value that is Valid, Invalid or Indeterminate.
-
-
Field Summary
Fields Modifier and Type Field Description protected DoNotCacheCondition
doNotCache
-
Constructor Summary
Constructors Constructor Description Conditions()
Default 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAudienceRestrictionCondition(AudienceRestrictionCondition arc)
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)
Set
getAudienceRestrictionCondition()
Returns a set of theAudienceRestrictionCondition
elements held within thisConditions
element.DoNotCacheCondition
getDoNotCacheCondition()
ReturnsDoNotCacheCondition
elements held within thisConditions
elementDate
getNotBefore()
Returns the earliest time at which the assertion is valid held in thisConditions
object.Date
getNotOnorAfter()
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.String
toString()
Returns a String representation of the element.String
toString(boolean includeNS, boolean declareNS)
Returns a String representation of the<Conditions>
element.
-
-
-
Field Detail
-
doNotCache
protected DoNotCacheCondition doNotCache
-
-
Constructor Detail
-
Conditions
public Conditions()
Default Constructor
-
Conditions
public Conditions(Date notBefore, Date notOnOrAfter) 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.- 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
public Conditions(Element conditionsElement) throws SAMLException
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 Detail
-
getNotBefore
public Date 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
public Date 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
public boolean addAudienceRestrictionCondition(AudienceRestrictionCondition arc)
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
public Set 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
public boolean removeAudienceRestrictionCondition(String audience)
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
public void setDoNotCacheCondition(DoNotCacheCondition doNotCacheCnd)
SetsDoNotCacheCondition
elements held within thisConditions
element.- Parameters:
doNotCacheCnd
- anDoNotCacheCondition
object.
-
getDoNotCacheCondition
public DoNotCacheCondition getDoNotCacheCondition()
ReturnsDoNotCacheCondition
elements held within thisConditions
element- Returns:
- an
DoNotCacheCondition
object if Conditions contains anyDoNotCacheCondition
, otherwise return null.
-
toString
public String toString()
Returns a String representation of the element.
-
toString
public String toString(boolean includeNS, boolean declareNS)
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
-
-