|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nitido.nim.NiMKernelService
com.nitido.nim.DataControlService
com.nitido.nimx.services.datacontrol.cachedmap.DataControlServiceImpl
public class DataControlServiceImpl
This implementation of DataControlService is a factory for cached-mapping DataControls that connected to a backend LDAP server through connection pool.
Main Features
When the application attempts to get a NiM Entity object for a specific object, NiM Kernel will invoke the DataControlService to generate an instance of the DataControl object to provide the data access logic for the specified Entity.
Depending on the configuration, this implementation generates the LDAP login DN in the following steps:
This DataControl also supports prefetching and batch fetching if the configuration "com.nitido.nimx.services.datacontrol.cachedmap.prefetch" is set to "true". Configuration Settings
This service requires the following configurations:
Field Summary | |
---|---|
static java.lang.String |
CONF_KEY_CHECK_CRED_WHEN_BIND
Configuration key for the write connection pool name. |
static java.lang.String |
CONF_KEY_CRED_NO_BACKEND
The configurtion key for the list of credential types that have no backend access at all. |
static java.lang.String |
CONF_KEY_PASSWORD_MAP
The user password attribute key. |
static java.lang.String |
CONF_KEY_PREFETCH
The configurtion key for determining whether to prefetch the cache-mapped attributes of a user when the corresponding DataControl is initiated. |
static java.lang.String |
CONF_KEY_PREFIX_ATTRIBUTE_MAP
The configuration key prefix for the mapping settings from a user space key to a LDAP attribute name. |
static java.lang.String |
CONF_KEY_PREFIX_BIND_AS_DN
The configurtion key prefix of the settings for the credential token key associated to the specified credential type. |
static java.lang.String |
CONF_KEY_PREFIX_BIND_AS_PWD
The configurtion key prefix of the settings for the credential token key associated to the specified credential type. |
static java.lang.String |
CONF_KEY_PREFIX_DN_POSTFIX
The configurtion key prefix of the settings for the LDAP DN postfix associated to the specified credential type. |
static java.lang.String |
CONF_KEY_PREFIX_DN_PREFIX
The configurtion key prefix of the settings for the LDAP DN prefix associated to the specified credential type. |
static java.lang.String |
CONF_KEY_PREFIX_DN_TOKEN_KEY
The configurtion key prefix of the settings for the credential token key associated to the specified credential type. |
static java.lang.String |
CONF_KEY_READ_POOL
Configuration key for the read connection pool name. |
static java.lang.String |
CONF_KEY_RESET_ON_ENTITY
The configurtion key for determining whether to reset the cache of a user when all of the Entity objects that uses the specific cache has been released by the application. |
static java.lang.String |
CONF_KEY_WRITE_POOL
Configuration key for the write connection pool name. |
static java.lang.String |
CONF_VALUE_END_OF_MODIFIERS
|
static java.lang.String |
CONF_VALUE_PREFETCH
The configuration value for indicated a cache-mapped attribute will be prefetched. |
static java.lang.String |
CONF_VALUE_READ_ONLY_BACKEND
|
static java.lang.String |
CONF_VALUE_START_OF_MODIFIERS
|
static java.lang.String |
ERR_MSG_MAP_INVALID_1
|
static java.lang.String |
ERR_MSG_MAP_INVALID_2
|
static java.lang.String |
INTERNAL_KEY_CHECK_CRED_WHEN_BIND
Internal key for passing the configuration for CONF_KEY_CHECK_WHEN_BIND between the DataControlServiceImpl and the DataControlImpl object. |
static java.lang.String |
INTERNAL_KEY_PREFETCH
Internal key for passing the configuration for CONF_KEY_PREFETCH between the DataControlServiceImpl and the DataControlImpl object. |
static java.lang.String |
INTERNAL_KEY_READ_POOL
Internal key for passing the configuration for CONF_KEY_READ_POOL between the DataControlServiceImpl and the DataControlImpl object. |
static java.lang.String |
INTERNAL_KEY_WRITE_POOL
Internal key for passing the configuration for CONF_KEY_WRITE_POOL between the DataControlServiceImpl and the DataControlImpl object. |
static int |
LEN_CONF_KEY_PREFIX_ATTRIBUTE_MAP
The length of the actual string represented by the constant CONF_KEY_PREFIX_ATTRIBUTEMAP. |
static char |
MAP_FIELD_SEPARATOR
The separator for each field. |
Fields inherited from interface com.nitido.nim.CredentialConstants |
---|
CRED_ADMIN, CRED_CONTAINER, CRED_HELPDESK, CRED_SYSTEM, CRED_USER, KEY_PASSWORD |
Constructor Summary | |
---|---|
DataControlServiceImpl(NiMKernelServiceVisa visa)
This class constructor is used by NiMKernel to instantiate a new DataControlService. |
Method Summary | |
---|---|
protected Directory |
connectRead(java.lang.String dn,
java.lang.String pwd)
|
protected Directory |
connectWrite(java.lang.String dn,
java.lang.String pwd)
|
protected com.nitido.nimx.services.datacontrol.cachedmap.BindData |
credentialToBindData(Credential cred)
This method is invoked by the DataControl object to obtain the DN for the specified credential. |
protected java.lang.String |
credentialToUserDN(Credential cred)
This method is invoked by the DataControl object to obtain the DN for the specified credential. |
protected void |
disconnectRead(Directory dir)
|
protected void |
disconnectWrite(Directory dir)
|
protected java.util.Vector |
getCacheDataValues(java.lang.String bindDN,
java.lang.String bindPwd,
java.lang.String userDN,
java.lang.String key)
|
protected com.nitido.nimx.services.datacontrol.cachedmap.CacheSetting |
getCacheSetting(java.lang.String key)
|
protected java.util.List |
getCacheSettingsForPrefetch()
|
DataControl |
getDataControl(Credential credential)
This method is a factory method for DataControl objects. |
protected static DataControlServiceImpl |
getInstance()
|
protected java.util.Vector |
getMappedUserSpaceKeys()
|
protected void |
init(NiMKernel kernel,
ConfigurationService confService)
This method is used by the kernel to initialize the DataControlService. |
protected void |
modifyBackend(java.lang.String bindDN,
java.lang.String bindPwd,
java.lang.String userDN,
java.util.HashMap backendModifiers,
java.util.HashMap cacheOnlyModifiers)
|
protected void |
prefetchAttributes(java.lang.String bindDN,
java.lang.String bindPwd,
java.lang.String userDN)
|
protected void |
releaseMasterRecord(java.lang.String dn)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CONF_KEY_READ_POOL
public static final java.lang.String CONF_KEY_WRITE_POOL
public static final java.lang.String CONF_KEY_CHECK_CRED_WHEN_BIND
public static final java.lang.String CONF_KEY_PREFIX_DN_PREFIX
public static final java.lang.String CONF_KEY_PREFIX_DN_POSTFIX
public static final java.lang.String CONF_KEY_PREFIX_DN_TOKEN_KEY
public static final java.lang.String CONF_KEY_PREFIX_BIND_AS_DN
public static final java.lang.String CONF_KEY_PREFIX_BIND_AS_PWD
public static final java.lang.String CONF_KEY_RESET_ON_ENTITY
public static final java.lang.String CONF_KEY_PREFETCH
public static final java.lang.String CONF_KEY_CRED_NO_BACKEND
public static final java.lang.String CONF_KEY_PREFIX_ATTRIBUTE_MAP
public static final int LEN_CONF_KEY_PREFIX_ATTRIBUTE_MAP
public static final java.lang.String CONF_KEY_PASSWORD_MAP
public static final java.lang.String CONF_VALUE_PREFETCH
public static final java.lang.String CONF_VALUE_READ_ONLY_BACKEND
public static final java.lang.String CONF_VALUE_START_OF_MODIFIERS
public static final java.lang.String CONF_VALUE_END_OF_MODIFIERS
public static final java.lang.String INTERNAL_KEY_READ_POOL
public static final java.lang.String INTERNAL_KEY_WRITE_POOL
public static final java.lang.String INTERNAL_KEY_CHECK_CRED_WHEN_BIND
public static final java.lang.String INTERNAL_KEY_PREFETCH
public static final char MAP_FIELD_SEPARATOR
public static final java.lang.String ERR_MSG_MAP_INVALID_1
public static final java.lang.String ERR_MSG_MAP_INVALID_2
Constructor Detail |
---|
public DataControlServiceImpl(NiMKernelServiceVisa visa)
visa
- Reference to the NiMKernelServiceVisa object required to
instantiate the service. This parameter is required to
ensure that only the NiMkernel can instantiate a reference
to this service.Method Detail |
---|
protected static DataControlServiceImpl getInstance()
protected void init(NiMKernel kernel, ConfigurationService confService) throws InitializationFailedException, NiMException
init
in class DataControlService
kernel
- Reference to the kernel that instantiated this service.confService
- A reference to the ConfigurationService.
InitializationFailedException
- If unable to initialize the DataControlService. This
exception is thrown by this service implementation if any of
the expected settings are not available.
NiMException
- This exception is never thrown by this service implementationpublic DataControl getDataControl(Credential credential) throws IllegalCredentialException, DataControlException
DataControlService
getDataControl
in class DataControlService
credential
- The credential used by the DataControl to access the
back-end data.
IllegalCredentialException
- If the given credential is not valid.
DataControlException
- If the DataControl service is unable to establish a
connection with the back-end data services.protected java.lang.String credentialToUserDN(Credential cred) throws IllegalCredentialException
IllegalCredentialException
protected com.nitido.nimx.services.datacontrol.cachedmap.BindData credentialToBindData(Credential cred) throws IllegalCredentialException
IllegalCredentialException
protected java.util.Vector getCacheDataValues(java.lang.String bindDN, java.lang.String bindPwd, java.lang.String userDN, java.lang.String key) throws DataControlException
DataControlException
protected void prefetchAttributes(java.lang.String bindDN, java.lang.String bindPwd, java.lang.String userDN) throws DataControlException
DataControlException
protected void modifyBackend(java.lang.String bindDN, java.lang.String bindPwd, java.lang.String userDN, java.util.HashMap backendModifiers, java.util.HashMap cacheOnlyModifiers) throws DataControlException
DataControlException
protected java.util.Vector getMappedUserSpaceKeys()
protected java.util.List getCacheSettingsForPrefetch()
protected com.nitido.nimx.services.datacontrol.cachedmap.CacheSetting getCacheSetting(java.lang.String key)
protected void releaseMasterRecord(java.lang.String dn)
protected Directory connectRead(java.lang.String dn, java.lang.String pwd) throws DataControlException
DataControlException
protected Directory connectWrite(java.lang.String dn, java.lang.String pwd) throws DataControlException
DataControlException
protected void disconnectRead(Directory dir) throws DataControlException
DataControlException
protected void disconnectWrite(Directory dir) throws DataControlException
DataControlException
|
Nitido NiM 2.5 Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2009 Nitido Inc. Proprietary and Confidential. All Rights Reserved.