bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington/*
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of the Common Development and Distribution License
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * (the License). You may not use this file except in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the License at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * opensso/legal/CDDLv1.0.txt
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * permission and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Header Notice in each file and include the License file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * at opensso/legal/CDDLv1.0.txt.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below the CDDL Header,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with the fields enclosed by brackets [] replaced by
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * $Id: DSConfigMgr.java,v 1.18 2009/01/28 05:34:49 ww203982 Exp $
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington * Portions Copyrighted 2011-2015 ForgeRock AS.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterpackage com.iplanet.services.ldap;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.io.FileInputStream;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.io.IOException;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.io.InputStream;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.security.AccessController;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.util.Collection;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.util.HashSet;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.util.Hashtable;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.util.Iterator;
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport java.util.LinkedHashSet;
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport java.util.Set;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.util.StringTokenizer;
57a1b25dcdf865eacb2fe2e17c5ca83e942da047David Luna
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport com.iplanet.am.util.SystemProperties;
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport com.iplanet.services.util.I18n;
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport com.iplanet.services.util.XMLParser;
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport com.iplanet.ums.IUMSConstants;
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport com.sun.identity.security.ServerInstanceAction;
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport com.sun.identity.shared.debug.Debug;
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport org.forgerock.openam.ldap.LDAPURL;
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport org.forgerock.openam.ldap.LDAPUtils;
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport org.forgerock.opendj.ldap.ConnectionFactory;
ce4d3fddc8fe2eddd68a20af9570b3cc63ece5abNeil Maddenimport org.forgerock.util.Options;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This object is the manager of all connection information. The server
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * configuration file (serverconfig.xml) is loaded and cached in this object.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This class exists as a singleton instance.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterpublic class DSConfigMgr implements IDSConfigMgr {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static final String LDAP_CONNECTION_NUM_RETRIES =
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "com.iplanet.am.ldap.connection.num.retries";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static final String LDAP_CONNECTION_RETRY_INTERVAL =
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "com.iplanet.am.ldap.connection.delay.between.retries";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static final String LDAP_CONNECTION_ERROR_CODES =
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "com.iplanet.am.ldap.connection.ldap.error.codes.retries";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Run time property key to obtain serverconfig.xml path
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static final String RUN_TIME_CONFIG_PATH =
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "com.iplanet.coreservices.configpath";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private int connNumRetry = 3;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private int connRetryInterval = 1000;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private HashSet retryErrorCodes = new HashSet();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster static Debug debugger = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster static {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debugger = Debug.getInstance(IUMSConstants.UMS_DEBUG);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster DSConfigMgr() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster i18n = I18n.getInstance(IUMSConstants.UMS_PKG);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster groupHash = new Hashtable();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String numRetryStr = SystemProperties.get(LDAP_CONNECTION_NUM_RETRIES);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (numRetryStr != null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster try {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster connNumRetry = Integer.parseInt(numRetryStr);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } catch (NumberFormatException e) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (debugger.warningEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debugger.warning("Invalid value for "
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster + LDAP_CONNECTION_NUM_RETRIES);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String retryIntervalStr = SystemProperties.get(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster LDAP_CONNECTION_RETRY_INTERVAL);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (retryIntervalStr != null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster try {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster connRetryInterval = Integer.parseInt(retryIntervalStr);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } catch (NumberFormatException e) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (debugger.warningEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debugger.warning("Invalid value for "
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster + LDAP_CONNECTION_RETRY_INTERVAL);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String retryErrs = SystemProperties.get(LDAP_CONNECTION_ERROR_CODES);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (retryErrs != null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster StringTokenizer stz = new StringTokenizer(retryErrs, ",");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster while (stz.hasMoreTokens()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster retryErrorCodes.add(stz.nextToken().trim());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Get the reference to the DSConfigMgr.com.iplanet.am.util. The first one
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * calling it creates the object, which gets stored in a local static
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * variable.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return DSConfigMgr The singleton instance.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws LDAPServiceException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static synchronized DSConfigMgr getDSConfigMgr()
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throws LDAPServiceException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (thisInstance == null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster InputStream is = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster try {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String path = SystemProperties.get(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SystemProperties.CONFIG_PATH);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (path == null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // For Backward compatibility obtain from runtime flag
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster path = System.getProperty(RUN_TIME_CONFIG_PATH);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (path == null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new LDAPServiceException(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster LDAPServiceException.FILE_NOT_FOUND,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "server configuration XML file is not found. " +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "This instance is likely to be running in client mode");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String configFile = path
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster + System.getProperty("file.separator")
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster + SystemProperties.CONFIG_FILE_NAME;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster is = new FileInputStream(configFile);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } catch (IOException ex) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (debugger.warningEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debugger.warning("DSConfigMgr.getDSConfigMgr: "
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster + "serverconfig.xml probably missing. May be "
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster + "running in client mode ", ex);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new LDAPServiceException(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster LDAPServiceException.FILE_NOT_FOUND, ex.getMessage());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster thisInstance = new DSConfigMgr();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster thisInstance.loadServerConfiguration(is);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return thisInstance;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static synchronized void initInstance(InputStream is)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throws LDAPServiceException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster thisInstance = new DSConfigMgr();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster thisInstance.loadServerConfiguration(is);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Get the ServerGroup object reference for this serverGroupID.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param serverGroupID
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The serverGroup ID for the ServerGroup to be retrieved.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return ServerGroup The ServerGroup reference; null if no such Server
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * group exists
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public ServerGroup getServerGroup(String serverGroupID) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (ServerGroup) groupHash.get(serverGroupID);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Get a new proxy connection from this servergroup.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param serverGroupID
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The server group ID for which the connection is to be created.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return LDAPConnection a new ldap connection.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws LDAPServiceException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If there is no user in the server group with this
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * authentication type.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington private ConnectionFactory getNewProxyConnectionFactory(String serverGroupID)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throws LDAPServiceException {
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington return getNewConnectionFactory(serverGroupID, LDAPUser.Type.AUTH_PROXY);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Get a new proxy connection from this servergroup. This method attempts to
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * look for the "default" server configuration in the serverconfig.xml file.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return LDAPConnection a new ldap connection.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws LDAPServiceException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If there is no user in the server group with this
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * authentication type.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington public ConnectionFactory getNewProxyConnectionFactory() throws LDAPServiceException {
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington return getNewProxyConnectionFactory(DEFAULT);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Get a new connection from this servergroup. The rootdn might not have
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * proxy rights.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param serverGroupID
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The server group ID for which the connection is to be created.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return LDAPConnection a new ldap connection.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws LDAPServiceException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If there is no user in the server group with this
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * authentication type.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington private ConnectionFactory getNewBasicConnectionFactory(String serverGroupID)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throws LDAPServiceException {
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington return getNewConnectionFactory(serverGroupID, LDAPUser.Type.AUTH_BASIC);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington public ConnectionFactory getNewAdminConnectionFactory() throws LDAPServiceException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // This api getNewAdminConnection() is used by SMDataLayer.java and
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // EventService.java.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debugger.message("in DSConfigMgr.getNewAdminConnection()");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String serverGroupID = DEFAULT;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster LDAPUser.Type type = LDAPUser.Type.AUTH_ADMIN;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String hostName = getHostName(serverGroupID);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if(hostName.length() == 0) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new LDAPServiceException(getString(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster IUMSConstants.DSCFG_SERVER_NOT_FOUND));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if(debugger.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debugger.message("DSConfigMgr:getNewAdminConnection():Hostname ="+
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster hostName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ServerInstance sCfg = getServerInstance(serverGroupID, type);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington String authID = sCfg.getAuthID();
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington String passwd = (String) AccessController.doPrivileged(new ServerInstanceAction(sCfg));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // The 389 port number passed is overridden by the hostName:port
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // constructed by the getHostName method. So, this is not
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // a hardcoded port number.
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington return LDAPUtils.newFailoverConnectionFactory(
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington getLdapUrls(serverGroupID, Server.Type.CONN_SSL.equals(sCfg.getConnectionType())),
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington authID, passwd.toCharArray(), 0, null, null);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Get a new connection from this servergroup. The rootdn might not have
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * proxy rights. This method attempts to look for the "default" server
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * configuration in the serverconfig.xml file.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return LDAPConnection a new ldap connection.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws LDAPServiceException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If there is no user in the server group with this
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * authentication type.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington public ConnectionFactory getNewBasicConnectionFactory() throws LDAPServiceException {
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington return getNewBasicConnectionFactory(DEFAULT);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Get a new connection from this servergroup.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param serverGroupID
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The server group ID for which the connection is to be created.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param authType
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * What kind of authentication do you want?
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return LDAPConnection a new ldap connection.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @see com.iplanet.services.ldap.LDAPUser.Type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington public ConnectionFactory getNewConnectionFactory(String serverGroupID,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster LDAPUser.Type authType) throws LDAPServiceException {
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington return getNewFailoverConnectionFactory(serverGroupID, authType);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This method give a failover connection. The list of servers in a server
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * group are used to failover.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param serverGroupID
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The serverGroup for which the connection is required.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The type of the user authentication that is required.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @see com.iplanet.services.ldap.LDAPUser.Type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington private ConnectionFactory getNewFailoverConnectionFactory(String serverGroupID,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster LDAPUser.Type type) throws LDAPServiceException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debugger.message("in DSConfigMgr.getNewFailoverConnection()");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String hostName = getHostName(serverGroupID);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (hostName.length() == 0) {
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington throw new LDAPServiceException(getString(IUMSConstants.DSCFG_SERVER_NOT_FOUND));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (debugger.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster debugger.message("Hostname =" + hostName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ServerInstance sCfg = getServerInstance(serverGroupID, type);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String authID = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String passwd = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Let user name and password be null for anonymous auth type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (!type.equals(LDAPUser.Type.AUTH_ANONYMOUS)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authID = sCfg.getAuthID();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster passwd = (String) AccessController
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster .doPrivileged(new ServerInstanceAction(sCfg));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington return LDAPUtils.newFailoverConnectionFactory(
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington getLdapUrls(serverGroupID, Server.Type.CONN_SSL.equals(sCfg.getConnectionType())),
ce4d3fddc8fe2eddd68a20af9570b3cc63ece5abNeil Madden authID, passwd != null ? passwd.toCharArray() : null, 0, null, Options.defaultOptions());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington private Set<LDAPURL> getLdapUrls(String serverGroupID, boolean isSSL) {
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington Set<LDAPURL> ldapUrls = new LinkedHashSet<>();
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington ServerGroup serverGrp = getServerGroup(serverGroupID);
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington for (Server server : serverGrp.getServersList()) {
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington ldapUrls.add(LDAPURL.valueOf(server.getServerName(), server.getPort(), isSSL));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington return ldapUrls;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public String getHostName(String serverGroupID) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ServerGroup serverGrp = getServerGroup(serverGroupID);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Collection serverList = serverGrp.getServersList();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster StringBuilder hostName = new StringBuilder();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Iterator serverIterator = serverList.iterator();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster while (serverIterator.hasNext()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Server serverObj = (Server) serverIterator.next();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster hostName.append(serverObj.getServerName());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster hostName.append(':');
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster hostName.append(serverObj.getPort());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster hostName.append(' ');
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster hostName.deleteCharAt(hostName.length() - 1);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return hostName.toString();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Given the server group ID, this method returns the active and best
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * available server instance. The "best available" criteria is based on the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * priority. The priority is order in which the servers are listed in the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * configuration file. The first has the best priority and the last entry
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * has the least priority. This method returns null if no qualified server
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * instance is found or no such server group exists
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param serverGroupID
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The serverGroupID for which the server instance is fetched.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param authType
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The auth type is the privilege that the user in the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * configuration must have.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return ServerInstance The server instance object that holds the server
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * configuration information.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @see LDAPUser.Type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public ServerInstance getServerInstance(String serverGroupID,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster LDAPUser.Type authType) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (serverGroupID == null)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ServerGroup svc = getServerGroup(serverGroupID);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (svc != null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return svc.getServerInstance(authType);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Get the instance from server group, which is defined as default.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param authType
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The auth type is the privilege that the user in the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * configuration must have.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return ServerInstance The server instance object that holds the server
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * configuration information.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @see LDAPUser.Type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public ServerInstance getServerInstance(LDAPUser.Type authType) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return getServerInstance(DEFAULT, authType);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
64600f2cc3b3d138e64d25ccc73f93a6bad251b3Mark de Reeper private void loadServerConfiguration(InputStream is) throws LDAPServiceException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Instantiate the XML classes and pass the file names.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster XMLParser parser = new XMLParser(true, groupHash);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Get the data from the xml classes
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster parser.register(SERVERGROUP, "com.iplanet.services.ldap.ServerGroup");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster parser.register(SERVER, "com.iplanet.services.ldap.Server");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster parser.register(USER, "com.iplanet.services.ldap.LDAPUser");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster try {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster parser.parse(is);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } catch (Exception e) {
64600f2cc3b3d138e64d25ccc73f93a6bad251b3Mark de Reeper debugger.error("DSConfigMgr.loadServerConfiguration: Exception during XML parsing", e);
64600f2cc3b3d138e64d25ccc73f93a6bad251b3Mark de Reeper throw new LDAPServiceException(LDAPServiceException.FILE_NOT_FOUND, e);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public String toString() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return groupHash.toString();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Get the string associated with the resource string.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param keyword
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The resource keyword.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return The Resource string assocated with this keyword.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster static String getString(String keyword) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return i18n.getString(keyword);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Hashtable groupHash = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Constants used during parsing.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String ROOT = "iPlanetDataAccessLayer";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String SERVERGROUP = "ServerGroup";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String SERVER = "Server";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String USER = "User";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String SERVER_ID = "serverid";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String CERTIFICATE = "Certificate";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String AUTH_USER_ID = "authUser";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String AUTH_ID = "DirDN";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String AUTH_PASSWD = "DirPassword";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String AUTH_TYPE = "type";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String BASE_DN = "BaseDN";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String MISC_CONFIG = "MiscConfig";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String NAME = "name";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String HOST = "host";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String PORT = "port";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String MAX_CONN_POOL = "maxConnPool";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String MIN_CONN_POOL = "minConnPool";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String VALUE = "value";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String VAL_INACTIVE = "inactive";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String VAL_AUTH_BASIC = "auth";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String VAL_AUTH_PROXY = "proxy";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String VAL_AUTH_REBIND = "rebind";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String VAL_AUTH_ADMIN = "admin";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String VAL_AUTH_ANONYMOUS = "anonymous";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String VAL_STYPE_SSL = "SSL";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String VAL_STYPE_SIMPLE = "SIMPLE";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Defaults
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final int DEF_INIT_CP_LEN = 1;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final int DEF_MAX_CP_LEN = 1;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Single instance of this object.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster static DSConfigMgr thisInstance = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static I18n i18n = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String SCHEMA_BUG_PROPERTY =
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "com.sun.identity.shared.ldap.schema.quoting";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String VAL_STANDARD = "standard";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Error Tokens
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String INVALID_SERVER_ID = "InvalidServerID";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String SERVER_ID_DOES_NOT_EXIST =
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "ServerIDDoesNotExist";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String INVALID_USER_ID = "InvalidUserID";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String DEFAULT = "default";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster}