/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 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: DSConfigMgr.java,v 1.18 2009/01/28 05:34:49 ww203982 Exp $
*
* Portions Copyrighted 2011-2015 ForgeRock AS.
*/
/**
* This object is the manager of all connection information. The server
* configuration file (serverconfig.xml) is loaded and cached in this object.
* This class exists as a singleton instance.
*/
"com.iplanet.am.ldap.connection.num.retries";
"com.iplanet.am.ldap.connection.delay.between.retries";
"com.iplanet.am.ldap.connection.ldap.error.codes.retries";
// Run time property key to obtain serverconfig.xml path
"com.iplanet.coreservices.configpath";
static {
}
DSConfigMgr() {
if (numRetryStr != null) {
try {
} catch (NumberFormatException e) {
if (debugger.warningEnabled()) {
}
}
}
if (retryIntervalStr != null) {
try {
} catch (NumberFormatException e) {
if (debugger.warningEnabled()) {
}
}
}
while (stz.hasMoreTokens()) {
}
}
}
/**
* Get the reference to the DSConfigMgr.com.iplanet.am.util. The first one
* calling it creates the object, which gets stored in a local static
* variable.
*
* @return DSConfigMgr The singleton instance.
* @throws LDAPServiceException
*/
throws LDAPServiceException {
if (thisInstance == null) {
try {
// For Backward compatibility obtain from runtime flag
}
throw new LDAPServiceException(
"server configuration XML file is not found. " +
"This instance is likely to be running in client mode");
}
} catch (IOException ex) {
if (debugger.warningEnabled()) {
+ "serverconfig.xml probably missing. May be "
+ "running in client mode ", ex);
}
throw new LDAPServiceException(
}
thisInstance = new DSConfigMgr();
}
return thisInstance;
}
throws LDAPServiceException {
thisInstance = new DSConfigMgr();
}
/**
* Get the ServerGroup object reference for this serverGroupID.
*
* @param serverGroupID
* The serverGroup ID for the ServerGroup to be retrieved.
* @return ServerGroup The ServerGroup reference; null if no such Server
* group exists
*/
}
/**
* Get a new proxy connection from this servergroup.
*
* @param serverGroupID
* The server group ID for which the connection is to be created.
* @return LDAPConnection a new ldap connection.
* @throws LDAPServiceException
* If there is no user in the server group with this
* authentication type.
*/
throws LDAPServiceException {
}
/**
* Get a new proxy connection from this servergroup. This method attempts to
* look for the "default" server configuration in the serverconfig.xml file.
*
* @return LDAPConnection a new ldap connection.
* @throws LDAPServiceException
* If there is no user in the server group with this
* authentication type.
*/
return getNewProxyConnectionFactory(DEFAULT);
}
/**
* Get a new connection from this servergroup. The rootdn might not have
* proxy rights.
*
* @param serverGroupID
* The server group ID for which the connection is to be created.
* @return LDAPConnection a new ldap connection.
* @throws LDAPServiceException
* If there is no user in the server group with this
* authentication type.
*/
throws LDAPServiceException {
}
// This api getNewAdminConnection() is used by SMDataLayer.java and
throw new LDAPServiceException(getString(
}
if(debugger.messageEnabled()) {
hostName);
}
// The 389 port number passed is overridden by the hostName:port
// constructed by the getHostName method. So, this is not
// a hardcoded port number.
}
/**
* Get a new connection from this servergroup. The rootdn might not have
* proxy rights. This method attempts to look for the "default" server
* configuration in the serverconfig.xml file.
*
* @return LDAPConnection a new ldap connection.
* @throws LDAPServiceException
* If there is no user in the server group with this
* authentication type.
*/
return getNewBasicConnectionFactory(DEFAULT);
}
/**
* Get a new connection from this servergroup.
*
* @param serverGroupID
* The server group ID for which the connection is to be created.
* @param authType
* What kind of authentication do you want?
* @return LDAPConnection a new ldap connection.
* @see com.iplanet.services.ldap.LDAPUser.Type
*/
}
/**
* This method give a failover connection. The list of servers in a server
* group are used to failover.
*
* @param serverGroupID
* The serverGroup for which the connection is required.
* @param type
* The type of the user authentication that is required.
* @see com.iplanet.services.ldap.LDAPUser.Type
*/
}
if (debugger.messageEnabled()) {
}
// Let user name and password be null for anonymous auth type
}
}
}
return ldapUrls;
}
while (serverIterator.hasNext()) {
}
}
/**
* Given the server group ID, this method returns the active and best
* available server instance. The "best available" criteria is based on the
* priority. The priority is order in which the servers are listed in the
* configuration file. The first has the best priority and the last entry
* has the least priority. This method returns null if no qualified server
* instance is found or no such server group exists
*
* @param serverGroupID
* The serverGroupID for which the server instance is fetched.
* @param authType
* The auth type is the privilege that the user in the
* configuration must have.
* @return ServerInstance The server instance object that holds the server
* configuration information.
* @see LDAPUser.Type
*/
if (serverGroupID == null)
return null;
}
return null;
}
/**
* Get the instance from server group, which is defined as default.
*
* @param authType
* The auth type is the privilege that the user in the
* configuration must have.
* @return ServerInstance The server instance object that holds the server
* configuration information.
* @see LDAPUser.Type
*/
}
// Instantiate the XML classes and pass the file names.
// Get the data from the xml classes
try {
} catch (Exception e) {
}
}
}
/**
* Get the string associated with the resource string.
*
* @param keyword
* The resource keyword.
* @return The Resource string assocated with this keyword.
*/
}
/**
* Constants used during parsing.
*/
// Defaults
// Single instance of this object.
"com.sun.identity.shared.ldap.schema.quoting";
// Error Tokens
"ServerIDDoesNotExist";
}