Package com.iplanet.services.ldap
Class DSConfigMgr
- java.lang.Object
-
- com.iplanet.services.ldap.DSConfigMgr
-
- All Implemented Interfaces:
IDSConfigMgr
public class DSConfigMgr extends Object implements IDSConfigMgr
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.
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUTH_IDstatic StringAUTH_PASSWDstatic StringAUTH_TYPEstatic StringAUTH_USER_IDstatic StringBASE_DNstatic StringCERTIFICATEstatic intDEF_INIT_CP_LENstatic intDEF_MAX_CP_LENstatic StringDEFAULTstatic StringHOSTstatic StringINVALID_SERVER_IDstatic StringINVALID_USER_IDstatic StringMAX_CONN_POOLstatic StringMIN_CONN_POOLstatic StringMISC_CONFIGstatic StringNAMEstatic StringPORTstatic StringROOTConstants used during parsing.static StringSCHEMA_BUG_PROPERTYstatic StringSERVERstatic StringSERVER_IDstatic StringSERVER_ID_DOES_NOT_EXISTstatic StringSERVERGROUPstatic StringUSERstatic StringVAL_AUTH_ADMINstatic StringVAL_AUTH_ANONYMOUSstatic StringVAL_AUTH_BASICstatic StringVAL_AUTH_PROXYstatic StringVAL_AUTH_REBINDstatic StringVAL_INACTIVEstatic StringVAL_STANDARDstatic StringVAL_STYPE_SIMPLEstatic StringVAL_STYPE_SSLstatic StringVALUE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DSConfigMgrgetDSConfigMgr()Get the reference to the DSConfigMgr.com.iplanet.am.util.StringgetHostName(String serverGroupID)Returns the host names for this id.org.forgerock.opendj.ldap.ConnectionFactorygetNewAdminConnectionFactory()org.forgerock.opendj.ldap.ConnectionFactorygetNewBasicConnectionFactory()Get a new connection from this servergroup.org.forgerock.opendj.ldap.ConnectionFactorygetNewConnectionFactory(String serverGroupID, LDAPUser.Type authType)Get a new connection from this servergroup.org.forgerock.opendj.ldap.ConnectionFactorygetNewProxyConnectionFactory()Get a new proxy connection from this servergroup.ServerGroupgetServerGroup(String serverGroupID)Get the ServerGroup object reference for this serverGroupID.ServerInstancegetServerInstance(LDAPUser.Type authType)Get the instance from server group, which is defined as default.ServerInstancegetServerInstance(String serverGroupID, LDAPUser.Type authType)Given the server group ID, this method returns the active and best available server instance.static DSConfigMgrgetStableDSConfigMgr()Gets the stable DSConfigMgr instance after the system has been fully initialized.static voidinitInstance(InputStream is, boolean isBootstrapComplete)StringtoString()
-
-
-
Field Detail
-
ROOT
public static final String ROOT
Constants used during parsing.- See Also:
- Constant Field Values
-
SERVERGROUP
public static final String SERVERGROUP
- See Also:
- Constant Field Values
-
SERVER
public static final String SERVER
- See Also:
- Constant Field Values
-
USER
public static final String USER
- See Also:
- Constant Field Values
-
SERVER_ID
public static final String SERVER_ID
- See Also:
- Constant Field Values
-
CERTIFICATE
public static final String CERTIFICATE
- See Also:
- Constant Field Values
-
AUTH_USER_ID
public static final String AUTH_USER_ID
- See Also:
- Constant Field Values
-
AUTH_ID
public static final String AUTH_ID
- See Also:
- Constant Field Values
-
AUTH_PASSWD
public static final String AUTH_PASSWD
- See Also:
- Constant Field Values
-
AUTH_TYPE
public static final String AUTH_TYPE
- See Also:
- Constant Field Values
-
BASE_DN
public static final String BASE_DN
- See Also:
- Constant Field Values
-
MISC_CONFIG
public static final String MISC_CONFIG
- See Also:
- Constant Field Values
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
HOST
public static final String HOST
- See Also:
- Constant Field Values
-
PORT
public static final String PORT
- See Also:
- Constant Field Values
-
MAX_CONN_POOL
public static final String MAX_CONN_POOL
- See Also:
- Constant Field Values
-
MIN_CONN_POOL
public static final String MIN_CONN_POOL
- See Also:
- Constant Field Values
-
VALUE
public static final String VALUE
- See Also:
- Constant Field Values
-
VAL_INACTIVE
public static final String VAL_INACTIVE
- See Also:
- Constant Field Values
-
VAL_AUTH_BASIC
public static final String VAL_AUTH_BASIC
- See Also:
- Constant Field Values
-
VAL_AUTH_PROXY
public static final String VAL_AUTH_PROXY
- See Also:
- Constant Field Values
-
VAL_AUTH_REBIND
public static final String VAL_AUTH_REBIND
- See Also:
- Constant Field Values
-
VAL_AUTH_ADMIN
public static final String VAL_AUTH_ADMIN
- See Also:
- Constant Field Values
-
VAL_AUTH_ANONYMOUS
public static final String VAL_AUTH_ANONYMOUS
- See Also:
- Constant Field Values
-
VAL_STYPE_SSL
public static final String VAL_STYPE_SSL
- See Also:
- Constant Field Values
-
VAL_STYPE_SIMPLE
public static final String VAL_STYPE_SIMPLE
- See Also:
- Constant Field Values
-
DEF_INIT_CP_LEN
public static final int DEF_INIT_CP_LEN
- See Also:
- Constant Field Values
-
DEF_MAX_CP_LEN
public static final int DEF_MAX_CP_LEN
- See Also:
- Constant Field Values
-
SCHEMA_BUG_PROPERTY
public static final String SCHEMA_BUG_PROPERTY
- See Also:
- Constant Field Values
-
VAL_STANDARD
public static final String VAL_STANDARD
- See Also:
- Constant Field Values
-
INVALID_SERVER_ID
public static final String INVALID_SERVER_ID
- See Also:
- Constant Field Values
-
SERVER_ID_DOES_NOT_EXIST
public static final String SERVER_ID_DOES_NOT_EXIST
- See Also:
- Constant Field Values
-
INVALID_USER_ID
public static final String INVALID_USER_ID
- See Also:
- Constant Field Values
-
DEFAULT
public static final String DEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDSConfigMgr
public static DSConfigMgr getDSConfigMgr() throws LDAPServiceException
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.- Returns:
- DSConfigMgr The singleton instance.
- Throws:
LDAPServiceException
-
initInstance
public static void initInstance(InputStream is, boolean isBootstrapComplete) throws LDAPServiceException
- Throws:
LDAPServiceException
-
getStableDSConfigMgr
public static DSConfigMgr getStableDSConfigMgr() throws LDAPServiceException
Gets the stable DSConfigMgr instance after the system has been fully initialized. If bootstrap is still in progress then this method waits until the stable configuration is available. The method will time out after 30 seconds if no stable configuration is available. In this case, a warning will be logged and the current configuration returned.- Returns:
- the stable configuration.
- Throws:
LDAPServiceException
-
getServerGroup
public ServerGroup getServerGroup(String serverGroupID)
Get the ServerGroup object reference for this serverGroupID.- Specified by:
getServerGroupin interfaceIDSConfigMgr- Parameters:
serverGroupID- The serverGroup ID for the ServerGroup to be retrieved.- Returns:
- ServerGroup The ServerGroup reference; null if no such Server group exists
-
getNewProxyConnectionFactory
public org.forgerock.opendj.ldap.ConnectionFactory getNewProxyConnectionFactory() throws LDAPServiceExceptionGet a new proxy connection from this servergroup. This method attempts to look for the "default" server configuration in the serverconfig.xml file.- Returns:
- LDAPConnection a new ldap connection.
- Throws:
LDAPServiceException- If there is no user in the server group with this authentication type.
-
getNewAdminConnectionFactory
public org.forgerock.opendj.ldap.ConnectionFactory getNewAdminConnectionFactory() throws LDAPServiceException- Throws:
LDAPServiceException
-
getNewBasicConnectionFactory
public org.forgerock.opendj.ldap.ConnectionFactory getNewBasicConnectionFactory() throws LDAPServiceExceptionGet 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.- Returns:
- LDAPConnection a new ldap connection.
- Throws:
LDAPServiceException- If there is no user in the server group with this authentication type.
-
getNewConnectionFactory
public org.forgerock.opendj.ldap.ConnectionFactory getNewConnectionFactory(String serverGroupID, LDAPUser.Type authType) throws LDAPServiceException
Get a new connection from this servergroup.- Parameters:
serverGroupID- The server group ID for which the connection is to be created.authType- What kind of authentication do you want?- Returns:
- LDAPConnection a new ldap connection.
- Throws:
LDAPServiceException- See Also:
LDAPUser.Type
-
getHostName
public String getHostName(String serverGroupID)
Description copied from interface:IDSConfigMgrReturns the host names for this id.- Specified by:
getHostNamein interfaceIDSConfigMgr- Parameters:
serverGroupID- Server Group ID.- Returns:
- host names.
-
getServerInstance
public ServerInstance getServerInstance(String serverGroupID, LDAPUser.Type authType)
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- Parameters:
serverGroupID- The serverGroupID for which the server instance is fetched.authType- The auth type is the privilege that the user in the configuration must have.- Returns:
- ServerInstance The server instance object that holds the server configuration information.
- See Also:
LDAPUser.Type
-
getServerInstance
public ServerInstance getServerInstance(LDAPUser.Type authType)
Get the instance from server group, which is defined as default.- Specified by:
getServerInstancein interfaceIDSConfigMgr- Parameters:
authType- The auth type is the privilege that the user in the configuration must have.- Returns:
- ServerInstance The server instance object that holds the server configuration information.
- See Also:
LDAPUser.Type
-
-