SAML2RepositoryFactory.java revision 049dd4948334dbda32bbeeed47c2bdf401ba7d09
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: JMQSAML2Repository.java,v 1.3 2008/08/01 22:15:00 hengming Exp $
*
* "Portions Copyrighted [2012] [ForgeRock Inc]".
*
*/
/**
* <code>SAML2RepositoryFactory</code> represents the saml2 repository,
* default repository is <code>SAML2CTSPersistentStore</code>.
*/
public class SAML2RepositoryFactory {
private static final String DEFAULT_REPOSITORY_CLASS =
"com.sun.identity.saml2.common.SAML2CTSPersistentStore";
private static final String REPOSITORY_CLASS_PROPERTY =
"com.sun.identity.saml2.plugins.SAML2RepositoryImpl";
private static final String CTS_SAML2_REPOSITORY_CLASS_NAME =
// TODO -- Pull in 10.1.0.
private static final String DEPRECATED_JMQ_REPOSITORY_CLASS =
"com.sun.identity.saml2.plugins.DefaultJMQSAML2Repository";
/**
* Cached Instance Reference to our SAML2 Token Repository
*/
/**
* Prevent Instantiation and only use as a functional static class.
*/
private SAML2RepositoryFactory() {
}
/**
* @return the instance of AMTokenSAML2Repository
* @throws SAML2Exception when failed to instantiate AMTokenSAML2Repository
*/
public static AMTokenSAML2Repository getInstance()
throws SAML2Exception {
if (saml2Repository == null) {
} else {
// Here we have an the default or customer / client implementation, for SAML2 Persistence.
// So simply Instantiate the specified Implementation.
try {
} catch (Exception e) {
"AMTokenSAML2Repository Implementation!", e);
}
}
// Determine if we were able to obtain the Instance for our AMTokenSAML2Repository.
if (saml2Repository == null)
{
throw new SAML2Exception(
}
} // End of Check for null saml2Repository.
// Return Instance.
return saml2Repository;
}
}