Package com.netscape.cmscore.dbs
Class DBSubsystem
- java.lang.Object
-
- com.netscape.cmscore.dbs.DBSubsystem
-
public class DBSubsystem extends java.lang.Object
A class represents the database subsystem that manages the backend data storage. This subsystem maintains multiple sessions that allows operations to be performed, and provide a registry where all the schema information is stored.- Version:
- $Revision$, $Date$
- Author:
- thomask
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ID
static org.slf4j.Logger
logger
static java.lang.String
PROP_ENABLE_SERIAL_MGMT
static java.lang.String
PROP_ENABLE_SERIAL_NUMBER_RECOVERY
static java.lang.String
PROP_INFINITE_REPLICA_NUMBER
static java.lang.String
PROP_INFINITE_REQUEST_NUMBER
static java.lang.String
PROP_INFINITE_SERIAL_NUMBER
static java.lang.String
PROP_MAX_REPLICA_NUMBER
static java.lang.String
PROP_MAX_REQUEST_NUMBER
static java.lang.String
PROP_MAX_SERIAL_NUMBER
static java.lang.String
PROP_MIN_REPLICA_NUMBER
static java.lang.String
PROP_MIN_REQUEST_NUMBER
static java.lang.String
PROP_MIN_SERIAL_NUMBER
static java.lang.String
PROP_NEXT_MAX_REPLICA_NUMBER
static java.lang.String
PROP_NEXT_MAX_REQUEST_NUMBER
static java.lang.String
PROP_NEXT_MAX_SERIAL_NUMBER
static java.lang.String
PROP_NEXT_MIN_REPLICA_NUMBER
static java.lang.String
PROP_NEXT_MIN_REQUEST_NUMBER
static java.lang.String
PROP_NEXT_MIN_SERIAL_NUMBER
static java.lang.String
PROP_NEXT_RANGE
static java.lang.String
PROP_NEXT_SERIAL_NUMBER
static java.lang.String
PROP_REPLICA_BASEDN
static java.lang.String
PROP_REPLICA_INCREMENT
static java.lang.String
PROP_REPLICA_LOW_WATER_MARK
static java.lang.String
PROP_REPLICA_RANGE_DN
static java.lang.String
PROP_REQUEST_BASEDN
static java.lang.String
PROP_REQUEST_INCREMENT
static java.lang.String
PROP_REQUEST_LOW_WATER_MARK
static java.lang.String
PROP_REQUEST_RANGE_DN
static java.lang.String
PROP_SERIAL_BASEDN
static java.lang.String
PROP_SERIAL_INCREMENT
static java.lang.String
PROP_SERIAL_LOW_WATER_MARK
static java.lang.String
PROP_SERIAL_RANGE_DN
-
Constructor Summary
Constructors Constructor Description DBSubsystem()
Constructs database subsystem.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DBSSession
createSession()
Creates a database session.boolean
enableSerialNumberRecovery()
java.lang.String
getBaseDN()
Retrieves base DN of backend database.LDAPConfig
getConfigStore()
Retrieves internal DB configuration store.DatabaseConfig
getDBConfigStore()
Retrieves DB subsystem configuration store.boolean
getEnableSerialMgmt()
java.lang.String
getEntryAttribute(java.lang.String dn, java.lang.String attrName, java.lang.String defaultValue, java.lang.String errorValue)
java.lang.String
getId()
Retrieves subsystem identifier.LdapAuthInfo
getLdapAuthInfo()
LdapConnInfo
getLdapConnInfo()
Retrieves LDAP connection info (host, port, secure)DBRegistry
getRegistry()
Retrieves the registry.void
init(DatabaseConfig config, PKISocketConfig socketConfig, IPasswordStore passwordStore)
Initializes the internal registry.void
returnConn(netscape.ldap.LDAPConnection conn)
void
setEnableSerialMgmt(boolean v)
void
setId(java.lang.String id)
Sets subsystem identifier.void
setNextSerialConfig(java.math.BigInteger serial)
void
shutdown()
Shutdowns this subsystem gracefully.
-
-
-
Field Detail
-
logger
public static org.slf4j.Logger logger
-
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
-
PROP_ENABLE_SERIAL_NUMBER_RECOVERY
public static final java.lang.String PROP_ENABLE_SERIAL_NUMBER_RECOVERY
- See Also:
- Constant Field Values
-
PROP_NEXT_SERIAL_NUMBER
public static final java.lang.String PROP_NEXT_SERIAL_NUMBER
- See Also:
- Constant Field Values
-
PROP_MIN_SERIAL_NUMBER
public static final java.lang.String PROP_MIN_SERIAL_NUMBER
- See Also:
- Constant Field Values
-
PROP_MAX_SERIAL_NUMBER
public static final java.lang.String PROP_MAX_SERIAL_NUMBER
- See Also:
- Constant Field Values
-
PROP_NEXT_MIN_SERIAL_NUMBER
public static final java.lang.String PROP_NEXT_MIN_SERIAL_NUMBER
- See Also:
- Constant Field Values
-
PROP_NEXT_MAX_SERIAL_NUMBER
public static final java.lang.String PROP_NEXT_MAX_SERIAL_NUMBER
- See Also:
- Constant Field Values
-
PROP_SERIAL_LOW_WATER_MARK
public static final java.lang.String PROP_SERIAL_LOW_WATER_MARK
- See Also:
- Constant Field Values
-
PROP_SERIAL_INCREMENT
public static final java.lang.String PROP_SERIAL_INCREMENT
- See Also:
- Constant Field Values
-
PROP_SERIAL_BASEDN
public static final java.lang.String PROP_SERIAL_BASEDN
- See Also:
- Constant Field Values
-
PROP_SERIAL_RANGE_DN
public static final java.lang.String PROP_SERIAL_RANGE_DN
- See Also:
- Constant Field Values
-
PROP_MIN_REQUEST_NUMBER
public static final java.lang.String PROP_MIN_REQUEST_NUMBER
- See Also:
- Constant Field Values
-
PROP_MAX_REQUEST_NUMBER
public static final java.lang.String PROP_MAX_REQUEST_NUMBER
- See Also:
- Constant Field Values
-
PROP_NEXT_MIN_REQUEST_NUMBER
public static final java.lang.String PROP_NEXT_MIN_REQUEST_NUMBER
- See Also:
- Constant Field Values
-
PROP_NEXT_MAX_REQUEST_NUMBER
public static final java.lang.String PROP_NEXT_MAX_REQUEST_NUMBER
- See Also:
- Constant Field Values
-
PROP_REQUEST_LOW_WATER_MARK
public static final java.lang.String PROP_REQUEST_LOW_WATER_MARK
- See Also:
- Constant Field Values
-
PROP_REQUEST_INCREMENT
public static final java.lang.String PROP_REQUEST_INCREMENT
- See Also:
- Constant Field Values
-
PROP_REQUEST_BASEDN
public static final java.lang.String PROP_REQUEST_BASEDN
- See Also:
- Constant Field Values
-
PROP_REQUEST_RANGE_DN
public static final java.lang.String PROP_REQUEST_RANGE_DN
- See Also:
- Constant Field Values
-
PROP_MIN_REPLICA_NUMBER
public static final java.lang.String PROP_MIN_REPLICA_NUMBER
- See Also:
- Constant Field Values
-
PROP_MAX_REPLICA_NUMBER
public static final java.lang.String PROP_MAX_REPLICA_NUMBER
- See Also:
- Constant Field Values
-
PROP_NEXT_MIN_REPLICA_NUMBER
public static final java.lang.String PROP_NEXT_MIN_REPLICA_NUMBER
- See Also:
- Constant Field Values
-
PROP_NEXT_MAX_REPLICA_NUMBER
public static final java.lang.String PROP_NEXT_MAX_REPLICA_NUMBER
- See Also:
- Constant Field Values
-
PROP_REPLICA_LOW_WATER_MARK
public static final java.lang.String PROP_REPLICA_LOW_WATER_MARK
- See Also:
- Constant Field Values
-
PROP_REPLICA_INCREMENT
public static final java.lang.String PROP_REPLICA_INCREMENT
- See Also:
- Constant Field Values
-
PROP_REPLICA_BASEDN
public static final java.lang.String PROP_REPLICA_BASEDN
- See Also:
- Constant Field Values
-
PROP_REPLICA_RANGE_DN
public static final java.lang.String PROP_REPLICA_RANGE_DN
- See Also:
- Constant Field Values
-
PROP_INFINITE_SERIAL_NUMBER
public static final java.lang.String PROP_INFINITE_SERIAL_NUMBER
- See Also:
- Constant Field Values
-
PROP_INFINITE_REQUEST_NUMBER
public static final java.lang.String PROP_INFINITE_REQUEST_NUMBER
- See Also:
- Constant Field Values
-
PROP_INFINITE_REPLICA_NUMBER
public static final java.lang.String PROP_INFINITE_REPLICA_NUMBER
- See Also:
- Constant Field Values
-
PROP_NEXT_RANGE
public static final java.lang.String PROP_NEXT_RANGE
- See Also:
- Constant Field Values
-
PROP_ENABLE_SERIAL_MGMT
public static final java.lang.String PROP_ENABLE_SERIAL_MGMT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public java.lang.String getId()
Retrieves subsystem identifier.
-
setId
public void setId(java.lang.String id) throws EBaseException
Sets subsystem identifier.- Throws:
EBaseException
-
enableSerialNumberRecovery
public boolean enableSerialNumberRecovery()
-
getEnableSerialMgmt
public boolean getEnableSerialMgmt()
-
setEnableSerialMgmt
public void setEnableSerialMgmt(boolean v) throws EBaseException
- Throws:
EBaseException
-
setNextSerialConfig
public void setNextSerialConfig(java.math.BigInteger serial) throws EBaseException
- Throws:
EBaseException
-
init
public void init(DatabaseConfig config, PKISocketConfig socketConfig, IPasswordStore passwordStore) throws EBaseException
Initializes the internal registry. Connects to the data source, and create a pool of connection of which applications can use. Optionally, check the integrity of the database.- Throws:
EBaseException
-
getEntryAttribute
public java.lang.String getEntryAttribute(java.lang.String dn, java.lang.String attrName, java.lang.String defaultValue, java.lang.String errorValue)
-
getConfigStore
public LDAPConfig getConfigStore()
Retrieves internal DB configuration store.
-
getDBConfigStore
public DatabaseConfig getDBConfigStore()
Retrieves DB subsystem configuration store.
-
getBaseDN
public java.lang.String getBaseDN()
Retrieves base DN of backend database.
-
getLdapConnInfo
public LdapConnInfo getLdapConnInfo()
Retrieves LDAP connection info (host, port, secure)
-
getLdapAuthInfo
public LdapAuthInfo getLdapAuthInfo()
-
shutdown
public void shutdown()
Shutdowns this subsystem gracefully.
-
getRegistry
public DBRegistry getRegistry()
Retrieves the registry.
-
createSession
public DBSSession createSession() throws EDBException
Creates a database session.- Throws:
EDBException
-
returnConn
public void returnConn(netscape.ldap.LDAPConnection conn)
-
-