Class ConditionsImpl
- java.lang.Object
-
- com.sun.identity.saml2.assertion.impl.ConditionsImpl
-
- All Implemented Interfaces:
Conditions
public class ConditionsImpl extends Object implements Conditions
TheConditionsdefines the SAML constructs that place constraints on the acceptable use if SAMLAssertions.
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUDIENCE_RESTRICTION_ELEMENTstatic StringCONDITION_ELEMENTstatic StringCONDITIONS_ELEMENTstatic StringNOT_BEFORE_ATTRstatic StringNOT_ON_OR_AFTER_ATTRstatic StringONETIMEUSE_ELEMENTstatic StringPROXY_RESTRICTION_ELEMENT
-
Constructor Summary
Constructors Constructor Description ConditionsImpl()Default constructorConditionsImpl(String xml)This constructor is used to buildConditionsobject from a XML string.ConditionsImpl(Element element)This constructor is used to buildConditionsobject from a block of existing XML that has already been built into a DOM.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckDateValidity(long someTime)Return true if a specific Date falls within the validity interval of this set of conditions.booleancheckDateValidity(long someTime, int skewSeconds)Return true if a specific Date falls within the validity interval of this set of conditions.ListgetAudienceRestrictions()Returns a list ofAudienceRestrictionListgetConditions()Returns a list ofConditionDategetNotBefore()Returns the time instant before which the subject cannot be confirmed.DategetNotOnOrAfter()Returns the time instant at which the subject can no longer be confirmed.ListgetOneTimeUses()Returns a list ofOneTimeUseListgetProxyRestrictions()Returns a list ofProxyRestrictionbooleanisMutable()Returns true if the object is mutablevoidmakeImmutable()Makes the object immutablevoidsetAudienceRestrictions(List ars)Sets a list ofAudienceRestrictionvoidsetConditions(List conditions)Sets a list ofConditionvoidsetNotBefore(Date value)Sets the time instant before which the subject cannot be confirmed.voidsetNotOnOrAfter(Date value)Sets the time instant at which the subject can no longer be confirmed.voidsetOneTimeUses(List oneTimeUses)Sets a list ofOneTimeUsevoidsetProxyRestrictions(List prs)Sets a list ofProxyRestrictionStringtoXMLString()Returns a String representationStringtoXMLString(boolean includeNSPrefix, boolean declareNS)Returns a String representation
-
-
-
Field Detail
-
CONDITIONS_ELEMENT
public static final String CONDITIONS_ELEMENT
- See Also:
- Constant Field Values
-
CONDITION_ELEMENT
public static final String CONDITION_ELEMENT
- See Also:
- Constant Field Values
-
ONETIMEUSE_ELEMENT
public static final String ONETIMEUSE_ELEMENT
- See Also:
- Constant Field Values
-
AUDIENCE_RESTRICTION_ELEMENT
public static final String AUDIENCE_RESTRICTION_ELEMENT
- See Also:
- Constant Field Values
-
PROXY_RESTRICTION_ELEMENT
public static final String PROXY_RESTRICTION_ELEMENT
- See Also:
- Constant Field Values
-
NOT_BEFORE_ATTR
public static final String NOT_BEFORE_ATTR
- See Also:
- Constant Field Values
-
NOT_ON_OR_AFTER_ATTR
public static final String NOT_ON_OR_AFTER_ATTR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConditionsImpl
public ConditionsImpl()
Default constructor
-
ConditionsImpl
public ConditionsImpl(String xml) throws SAML2Exception
This constructor is used to buildConditionsobject from a XML string.- Parameters:
xml- Ajava.lang.Stringrepresenting aConditionsobject- Throws:
SAML2Exception- if it could not process the XML string
-
ConditionsImpl
public ConditionsImpl(Element element) throws SAML2Exception
This constructor is used to buildConditionsobject from a block of existing XML that has already been built into a DOM.- Parameters:
element- Aorg.w3c.dom.Elementrepresenting DOM tree forConditionsobject- Throws:
SAML2Exception- if it could not process the Element
-
-
Method Detail
-
getNotOnOrAfter
public Date getNotOnOrAfter()
Returns the time instant at which the subject can no longer be confirmed.- Specified by:
getNotOnOrAfterin interfaceConditions- Returns:
- the time instant at which the subject can no longer be confirmed.
-
setNotOnOrAfter
public void setNotOnOrAfter(Date value) throws SAML2Exception
Sets the time instant at which the subject can no longer be confirmed.- Specified by:
setNotOnOrAfterin interfaceConditions- Parameters:
value- the time instant at which the subject can no longer be confirmed.- Throws:
SAML2Exception- if the object is immutable
-
getConditions
public List getConditions()
Returns a list ofCondition- Specified by:
getConditionsin interfaceConditions- Returns:
- a list of
Condition
-
getAudienceRestrictions
public List getAudienceRestrictions()
Returns a list ofAudienceRestriction- Specified by:
getAudienceRestrictionsin interfaceConditions- Returns:
- a list of
AudienceRestriction
-
getOneTimeUses
public List getOneTimeUses()
Returns a list ofOneTimeUse- Specified by:
getOneTimeUsesin interfaceConditions- Returns:
- a list of
OneTimeUse
-
getProxyRestrictions
public List getProxyRestrictions()
Returns a list ofProxyRestriction- Specified by:
getProxyRestrictionsin interfaceConditions- Returns:
- a list of
ProxyRestriction
-
setConditions
public void setConditions(List conditions) throws SAML2Exception
Sets a list ofCondition- Specified by:
setConditionsin interfaceConditions- Parameters:
conditions- a list ofCondition- Throws:
SAML2Exception- if the object is immutable
-
setAudienceRestrictions
public void setAudienceRestrictions(List ars) throws SAML2Exception
Sets a list ofAudienceRestriction- Specified by:
setAudienceRestrictionsin interfaceConditions- Parameters:
ars- a list ofAudienceRestriction- Throws:
SAML2Exception- if the object is immutable
-
setOneTimeUses
public void setOneTimeUses(List oneTimeUses) throws SAML2Exception
Sets a list ofOneTimeUse- Specified by:
setOneTimeUsesin interfaceConditions- Parameters:
oneTimeUses- a list ofOneTimeUse- Throws:
SAML2Exception- if the object is immutable
-
setProxyRestrictions
public void setProxyRestrictions(List prs) throws SAML2Exception
Sets a list ofProxyRestriction- Specified by:
setProxyRestrictionsin interfaceConditions- Parameters:
prs- a list ofProxyRestriction- Throws:
SAML2Exception- if the object is immutable
-
getNotBefore
public Date getNotBefore()
Returns the time instant before which the subject cannot be confirmed.- Specified by:
getNotBeforein interfaceConditions- Returns:
- the time instant before which the subject cannot be confirmed.
-
setNotBefore
public void setNotBefore(Date value) throws SAML2Exception
Sets the time instant before which the subject cannot be confirmed.- Specified by:
setNotBeforein interfaceConditions- Parameters:
value- the time instant before which the subject cannot be confirmed.- Throws:
SAML2Exception- if the object is immutable
-
checkDateValidity
public boolean checkDateValidity(long someTime, int skewSeconds)Return true if a specific Date falls within the validity interval of this set of conditions.- Specified by:
checkDateValidityin interfaceConditions- Parameters:
someTime- Any time in milliseconds.skewSeconds- Clock skew in seconds.- Returns:
- true if
someTimeis within the valid interval of theConditions.
-
checkDateValidity
public boolean checkDateValidity(long someTime)
Return true if a specific Date falls within the validity interval of this set of conditions.- Specified by:
checkDateValidityin interfaceConditions- Parameters:
someTime- Any time in milliseconds.- Returns:
- true if
someTimeis within the valid interval of theConditions.
-
toXMLString
public String toXMLString(boolean includeNSPrefix, boolean declareNS) throws SAML2Exception
Returns a String representation- Specified by:
toXMLStringin interfaceConditions- Parameters:
includeNSPrefix- 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 representation
- Throws:
SAML2Exception- if something is wrong during conversion
-
toXMLString
public String toXMLString() throws SAML2Exception
Returns a String representation- Specified by:
toXMLStringin interfaceConditions- Returns:
- A String representation
- Throws:
SAML2Exception- if something is wrong during conversion
-
makeImmutable
public void makeImmutable()
Makes the object immutable- Specified by:
makeImmutablein interfaceConditions
-
isMutable
public boolean isMutable()
Returns true if the object is mutable- Specified by:
isMutablein interfaceConditions- Returns:
- true if the object is mutable
-
-