Package org.opensaml.saml.saml2.common
Class SAML2Support
- java.lang.Object
-
- org.opensaml.saml.saml2.common.SAML2Support
-
public final class SAML2Support extends Object
Utility class for common SAML 2 operations.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
SAML2Support()
Private constructor to disallow instantiation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Instant
getEarliestExpiration(org.opensaml.core.xml.XMLObject xmlObject)
Gets the earliest expiration instant for a XMLObject.static Instant
getEarliestExpiration(org.opensaml.core.xml.XMLObject xmlObject, Instant candidateTime, Instant now)
Gets the earliest expiration instant within a metadata tree.static Instant
getEarliestExpirationFromCacheable(CacheableSAMLObject cacheableObject, Instant candidateTime, Instant now)
Gets the earliest effective expiration instant of the specified cacheable SAML object and the specified candidate time.static Instant
getEarliestExpirationFromTimeBound(TimeBoundSAMLObject timeBoundObject, Instant candidateTime)
Gets the earliest effective expiration instant of the specified time-bound SAML object and the specified candidate time.static boolean
isValid(org.opensaml.core.xml.XMLObject xmlObject)
Checks to see if the given XMLObject is still valid.
-
-
-
Method Detail
-
isValid
public static boolean isValid(org.opensaml.core.xml.XMLObject xmlObject)
Checks to see if the given XMLObject is still valid. An XMLObject is valid if, and only if, itself and every ancestralTimeBoundSAMLObject
is valid.- Parameters:
xmlObject
- the XML object tree to check- Returns:
- true of the tree is valid, false if not
-
getEarliestExpiration
@Nullable public static Instant getEarliestExpiration(@Nullable org.opensaml.core.xml.XMLObject xmlObject)
Gets the earliest expiration instant for a XMLObject. This method traverses the tree of SAMLObject rooted at the given object and calculates the earliest expiration as the earliest of the following two items:- the earliest validUntil time on a
TimeBoundSAMLObject
- the shortest duration on a
CacheableSAMLObject
added to the current time
- Parameters:
xmlObject
- the XML object tree from which to get the earliest expiration time- Returns:
- the earliest expiration time
- the earliest validUntil time on a
-
getEarliestExpiration
@Nullable public static Instant getEarliestExpiration(@Nullable org.opensaml.core.xml.XMLObject xmlObject, @Nullable Instant candidateTime, @Nonnull Instant now)
Gets the earliest expiration instant within a metadata tree.- Parameters:
xmlObject
- the target XMLObject to evaluatecandidateTime
- the candidate earliest expiration instantnow
- when this method was called- Returns:
- the earliest expiration instant within a metadata tree. May be null if the input candiateTime was null, otherwise will always be non-null.
-
getEarliestExpirationFromCacheable
@Nullable public static Instant getEarliestExpirationFromCacheable(@Nonnull CacheableSAMLObject cacheableObject, @Nullable Instant candidateTime, @Nonnull Instant now)
Gets the earliest effective expiration instant of the specified cacheable SAML object and the specified candidate time.- Parameters:
cacheableObject
- the target XMLObject to evaluatecandidateTime
- the candidate earliest expiration instantnow
- when this method was called- Returns:
- the earliest effective expiration instant of the 2 targets. May be null if the input candiateTime was null, otherwise will always be non-null.
-
getEarliestExpirationFromTimeBound
@Nullable public static Instant getEarliestExpirationFromTimeBound(@Nonnull TimeBoundSAMLObject timeBoundObject, @Nullable Instant candidateTime)
Gets the earliest effective expiration instant of the specified time-bound SAML object and the specified candidate time.- Parameters:
timeBoundObject
- the target XMLObject to evaluatecandidateTime
- the earliest expiration instant- Returns:
- the earliest effective expiration instant of the 2 targets. May be null if the input candiateTime was null, otherwise will always be non-null.
-
-