Package com.sun.identity.saml2.common
Class SAML2FailoverUtils
- java.lang.Object
-
- com.sun.identity.saml2.common.SAML2FailoverUtils
-
public class SAML2FailoverUtils extends Object
Provides helper methods specifically around using SAML2 Failover and the SAML2 Token Repository. Users of these methods much ensure that SAML2 Failover is enabled by checking the result of theisSAML2FailoverEnabled()call before accessing the token repository.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddeleteSAML2Token(String primaryKey)Helper method for accessing the SAML2 Token Repository, should only be used when SAML2 failover is enabled.static booleanisSAML2FailoverEnabled()Checks whether SAML2 failover is enabled.static ObjectretrieveSAML2Token(String primaryKey)Helper method for accessing the SAML2 Token Repository, should only be used when SAML2 failover is enabled.static ListretrieveSAML2TokensWithSecondaryKey(String secondaryKey)Helper method for accessing the SAML2 Token Repository, should only be used when SAML2 failover is enabled.static voidsaveSAML2Token(String primaryKey, String secondaryKey, Object samlObj, long expirationTime)Helper method for accessing the SAML2 Token Repository, should only be used when SAML2 failover is enabled.static voidsaveSAML2TokenWithoutSecondaryKey(String primaryKey, Object samlObj, long expirationTime)Helper method for accessing the SAML2 Token Repository, should only be used when SAML2 failover is enabled.
-
-
-
Method Detail
-
isSAML2FailoverEnabled
public static boolean isSAML2FailoverEnabled()
Checks whether SAML2 failover is enabled.- Returns:
- true if SAML2 failover is enabled otherwise false.
-
saveSAML2TokenWithoutSecondaryKey
public static void saveSAML2TokenWithoutSecondaryKey(String primaryKey, Object samlObj, long expirationTime) throws SAML2TokenRepositoryException
Helper method for accessing the SAML2 Token Repository, should only be used when SAML2 failover is enabled.- Parameters:
primaryKey- The primary key of SAML2 object to savesamlObj- The SAML2 object to saveexpirationTime- Expiration time in seconds from epoch.- Throws:
SAML2TokenRepositoryException- if there was a problem accessing the SAML2 Token Repository
-
saveSAML2Token
public static void saveSAML2Token(String primaryKey, String secondaryKey, Object samlObj, long expirationTime) throws SAML2TokenRepositoryException
Helper method for accessing the SAML2 Token Repository, should only be used when SAML2 failover is enabled.- Parameters:
primaryKey- The primary key of the SAML2 object to savesecondaryKey- Secondary key, can be nullsamlObj- The SAML2 object to saveexpirationTime- Expiration time in seconds from epoch.- Throws:
SAML2TokenRepositoryException- if there was a problem accessing the SAML2 Token Repository
-
retrieveSAML2Token
public static Object retrieveSAML2Token(String primaryKey) throws SAML2TokenRepositoryException
Helper method for accessing the SAML2 Token Repository, should only be used when SAML2 failover is enabled.- Parameters:
primaryKey- The primary key of SAML2 object to retrieve- Returns:
- An object representing the SAML2 object put into the repository using the key or null if not found.
- Throws:
SAML2TokenRepositoryException- if there was a problem accessing the SAML2 Token Repository
-
retrieveSAML2TokensWithSecondaryKey
public static List retrieveSAML2TokensWithSecondaryKey(String secondaryKey) throws SAML2TokenRepositoryException
Helper method for accessing the SAML2 Token Repository, should only be used when SAML2 failover is enabled.- Parameters:
secondaryKey- Secondary key to use when searching for matching tokens- Returns:
- A non null, but possibly empty collection of SAML2 objects.
- Throws:
SAML2TokenRepositoryException- if there was a problem accessing the SAML2 Token Repository
-
deleteSAML2Token
public static void deleteSAML2Token(String primaryKey) throws SAML2TokenRepositoryException
Helper method for accessing the SAML2 Token Repository, should only be used when SAML2 failover is enabled.- Parameters:
primaryKey- The primary key of SAML2 object to delete- Throws:
SAML2TokenRepositoryException- if there was a problem accessing the SAML2 Token Repository
-
-