Class ConditionsImpl
- java.lang.Object
-
- com.sun.identity.saml2.assertion.impl.ConditionsImpl
-
- All Implemented Interfaces:
Conditions
public class ConditionsImpl extends Object implements Conditions
TheConditions
defines the SAML constructs that place constraints on the acceptable use if SAMLAssertion
s.
-
-
Field Summary
Fields Modifier and Type Field Description static String
AUDIENCE_RESTRICTION_ELEMENT
static String
CONDITION_ELEMENT
static String
CONDITIONS_ELEMENT
static String
NOT_BEFORE_ATTR
static String
NOT_ON_OR_AFTER_ATTR
static String
ONETIMEUSE_ELEMENT
static String
PROXY_RESTRICTION_ELEMENT
-
Constructor Summary
Constructors Constructor Description ConditionsImpl()
Default constructorConditionsImpl(String xml)
This constructor is used to buildConditions
object from a XML string.ConditionsImpl(Element element)
This constructor is used to buildConditions
object 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 boolean
checkDateValidity(long someTime)
Return true if a specific Date falls within the validity interval of this set of conditions.boolean
checkDateValidity(long someTime, int skewSeconds)
Return true if a specific Date falls within the validity interval of this set of conditions.List
getAudienceRestrictions()
Returns a list ofAudienceRestriction
List
getConditions()
Returns a list ofCondition
Date
getNotBefore()
Returns the time instant before which the subject cannot be confirmed.Date
getNotOnOrAfter()
Returns the time instant at which the subject can no longer be confirmed.List
getOneTimeUses()
Returns a list ofOneTimeUse
List
getProxyRestrictions()
Returns a list ofProxyRestriction
boolean
isMutable()
Returns true if the object is mutablevoid
makeImmutable()
Makes the object immutablevoid
setAudienceRestrictions(List ars)
Sets a list ofAudienceRestriction
void
setConditions(List conditions)
Sets a list ofCondition
void
setNotBefore(Date value)
Sets the time instant before which the subject cannot be confirmed.void
setNotOnOrAfter(Date value)
Sets the time instant at which the subject can no longer be confirmed.void
setOneTimeUses(List oneTimeUses)
Sets a list ofOneTimeUse
void
setProxyRestrictions(List prs)
Sets a list ofProxyRestriction
String
toXMLString()
Returns a String representationString
toXMLString(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 buildConditions
object from a XML string.- Parameters:
xml
- Ajava.lang.String
representing aConditions
object- Throws:
SAML2Exception
- if it could not process the XML string
-
ConditionsImpl
public ConditionsImpl(Element element) throws SAML2Exception
This constructor is used to buildConditions
object from a block of existing XML that has already been built into a DOM.- Parameters:
element
- Aorg.w3c.dom.Element
representing DOM tree forConditions
object- 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:
getNotOnOrAfter
in 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:
setNotOnOrAfter
in 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:
getConditions
in interfaceConditions
- Returns:
- a list of
Condition
-
getAudienceRestrictions
public List getAudienceRestrictions()
Returns a list ofAudienceRestriction
- Specified by:
getAudienceRestrictions
in interfaceConditions
- Returns:
- a list of
AudienceRestriction
-
getOneTimeUses
public List getOneTimeUses()
Returns a list ofOneTimeUse
- Specified by:
getOneTimeUses
in interfaceConditions
- Returns:
- a list of
OneTimeUse
-
getProxyRestrictions
public List getProxyRestrictions()
Returns a list ofProxyRestriction
- Specified by:
getProxyRestrictions
in interfaceConditions
- Returns:
- a list of
ProxyRestriction
-
setConditions
public void setConditions(List conditions) throws SAML2Exception
Sets a list ofCondition
- Specified by:
setConditions
in 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:
setAudienceRestrictions
in 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:
setOneTimeUses
in 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:
setProxyRestrictions
in 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:
getNotBefore
in 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:
setNotBefore
in 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:
checkDateValidity
in interfaceConditions
- Parameters:
someTime
- Any time in milliseconds.skewSeconds
- Clock skew in seconds.- Returns:
- true if
someTime
is 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:
checkDateValidity
in interfaceConditions
- Parameters:
someTime
- Any time in milliseconds.- Returns:
- true if
someTime
is within the valid interval of theConditions
.
-
toXMLString
public String toXMLString(boolean includeNSPrefix, boolean declareNS) throws SAML2Exception
Returns a String representation- Specified by:
toXMLString
in 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:
toXMLString
in interfaceConditions
- Returns:
- A String representation
- Throws:
SAML2Exception
- if something is wrong during conversion
-
makeImmutable
public void makeImmutable()
Makes the object immutable- Specified by:
makeImmutable
in interfaceConditions
-
isMutable
public boolean isMutable()
Returns true if the object is mutable- Specified by:
isMutable
in interfaceConditions
- Returns:
- true if the object is mutable
-
-