|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nitido.nim.DataControl
com.nitido.nimx.services.datacontrol.cachedmap.DataControlImpl
public class DataControlImpl
This DataControl implementation stores user space entries to the directory server if the class configuration contains a "mapping entry" for the given key. Otherwise, this DataControl stores the user space entries in memory. On the other hand, Credential space entries are always kept in memory.
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 | |
---|---|
protected |
DataControlImpl(Credential credential,
java.util.HashMap settingMap)
This constructor returns an instance of the DataControl that is binded to the given credential. |
Method Summary | |
---|---|
protected void |
acquire()
This method is used to establish a connection to the back-end data store. |
protected void |
activate()
This method is used to activates the DataControl after the Entity object containing this DataControl is deserialized. |
void |
bind(Credential cred)
This method is used to bind the given credential to the DataControl if the credential can be authenticated against the directory server. |
protected void |
changeDataControlCredential(Credential newCred,
boolean modBackend)
This method change the DataControl credential for user. |
protected void |
deactivate()
This method is called to deactivate the DataControl. |
protected void |
destroy()
This method is invoked when the Entity has been signalled as "dying". |
protected java.lang.String[] |
getCredentialSpaceKeysImpl(java.lang.String startsWith)
This method contains the actual implementation for the getCredentialSpaceKeys( startsWith ) method. |
protected java.util.Vector |
getFromCredentialSpaceImpl(java.lang.String key)
This method contains the actual implementation for the getFromCredentialSpace( key ) method. |
protected java.util.Vector |
getFromInMemoryData(java.lang.String key)
|
protected java.util.Vector |
getFromUserSpaceImpl(java.lang.String key)
This method contains the actual implementation for the getFromUserSpace() method. |
protected static java.util.Vector |
getKeysFromHash(OpenSerializableHash hash,
java.lang.String startsWith)
Utility method to get the keys from the given hash whose name start with the given prefix. |
protected java.util.Vector |
getKeysFromInMemoryData(java.lang.String startsWith)
|
protected java.lang.String |
getUserDN()
This method returns the user DN associated to this instance of DataControl. |
protected java.lang.String[] |
getUserSpaceKeysImpl(java.lang.String startsWith)
This method contains the actual implementation for the getUserSpaceKeys() method. |
protected Credential |
getValueFromCredentialSpaceImpl(java.lang.String key)
This method contains the actual implementation for the getValueFromCredentialSpace( key ) method. |
protected java.io.Serializable |
getValueFromUserSpaceImpl(java.lang.String key)
This method contains the actual implementation for the getValueFromUserSpace() method. |
protected void |
initialize(java.util.HashMap settingMap)
This method is used to initialize the DataControl with the given settings. |
protected void |
modifyCredentialSpaceImpl(ModifierContainer container)
This method provides the actual implementation to the modifyCredentialSpace() method. |
protected static void |
modifyHash(OpenSerializableHash hash,
Modifier modifier)
This method is used to modify given hash according to the operation described in the given Modifier object.. |
protected void |
modifyInMemoryData(java.util.ArrayList inMemoryModifiers)
|
protected void |
modifyUserSpaceImpl(ModifierContainer container)
This method contains the actual implementation for the modifyUserSpace( container ) method. |
protected void |
release()
This method is used to release a connection to the back-end data store. |
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 |
---|
protected DataControlImpl(Credential credential, java.util.HashMap settingMap) throws IllegalCredentialException, DataControlException
This method is declared protected to ensure that only the corresponding DataControlService can be used to get an instance of a DataControl.
credential
- A reference to the Credential object used to authenticate
against the back-end data store.settingMap
- A reference to the HashMap object that contains
parameters to initialize the DataControl. This
DataControl implementation requires the following
initialization parameters:
IllegalCredentialException
- If the given credentials are not supported by the concrete
DataControl implementation.
DataControlException
- If unable to instantiate the DataControl objectMethod Detail |
---|
protected void initialize(java.util.HashMap settingMap) throws DataControlException
initialize
in class DataControl
settingMap
- Reference to the HashMap object that contains the
parameters used to initialize the DataControl. This
DataControl implementation requires the following
initialization parameters:
DataControlException
- If unable to initialize the DataControlprotected void destroy()
destroy
in class DataControl
public void bind(Credential cred) throws IllegalCredentialException, DataControlException
bind
in class DataControl
cred
- Reference to the credential object used to authenticate the
entity to the back-end data store.
IllegalCredentialException
- If the given credentials is not supported by the
DataControl.
DataControlException
- If unable to bind the credential to the DataControl.protected void acquire() throws DataControlException
DataControl
acquire
in class DataControl
DataControlException
- If unable to establish connection to the back-end data
store.protected void release() throws DataControlException
DataControl
release
in class DataControl
DataControlException
- If unable to close the connection to the back-end data
store.protected void activate() throws ActivationException
DataControl
activate
in class DataControl
ActivationException
- If unable to activate the DataControlprotected void deactivate() throws ActivationException
DataControl
deactivate
in class DataControl
ActivationException
- If unable to de-activate the DataControl.protected void modifyCredentialSpaceImpl(ModifierContainer container) throws DataControlException
DataControl
Since the modifyCredentialSpace() method has already called the acquire() and release() methods, implementations of this method only need to handle the core modification logic. It does not need to worry about connection and other low level system resource management.
modifyCredentialSpaceImpl
in class DataControl
container
- Encapsulates the list of modifications to be executed on the
Credential space.
DataControlException
- This exception is thrown if unable to perform the requested
modifications.protected Credential getValueFromCredentialSpaceImpl(java.lang.String key) throws DataControlException
DataControl
getValueFromCredentialSpaceImpl
in class DataControl
key
- The key that uniquely identifies a set of credentials.
DataControlException
- If unable to retrieve a credential from the credential store.protected java.util.Vector getFromCredentialSpaceImpl(java.lang.String key) throws DataControlException
DataControl
getFromCredentialSpaceImpl
in class DataControl
key
- The key used to identify the requested credentials.
DataControlException
- If unable to retrieve the credentials from the credential
store.protected java.lang.String[] getCredentialSpaceKeysImpl(java.lang.String startsWith) throws DataControlException
DataControl
getCredentialSpaceKeysImpl
in class DataControl
startsWith
- The prefix of the requested credential keys.
DataControlException
- If unable to fetch the credential space.protected void modifyUserSpaceImpl(ModifierContainer container) throws DataControlException
DataControl
modifyUserSpaceImpl
in class DataControl
container
- Encapsulates the list of modifications to be executed on
the user space of the entity.
DataControlException
- If unable to perform any of the requested modifications.protected java.io.Serializable getValueFromUserSpaceImpl(java.lang.String key) throws DataControlException
DataControl
getValueFromUserSpaceImpl
in class DataControl
key
- The key that uniquely idenfifies a set of objects in the
user space.
DataControlException
- If unable to retrieve the requested object from the user
space.protected java.util.Vector getFromUserSpaceImpl(java.lang.String key) throws DataControlException
DataControl
getFromUserSpaceImpl
in class DataControl
key
- The key used to identify the set of objects in the user
space.
DataControlException
- If Unable to retrieve requested information from the user space.protected java.lang.String[] getUserSpaceKeysImpl(java.lang.String startsWith) throws DataControlException
DataControl
getUserSpaceKeysImpl
in class DataControl
startsWith
- The prefix string used to search for the currently
available user space keys. If no key matches the given
prefix, this method returns an empty array
DataControlException
- If unable to retrieve the requested information from the
user spaceprotected void changeDataControlCredential(Credential newCred, boolean modBackend) throws IllegalCredentialException, DataControlException
changeDataControlCredential
in class DataControl
newCred
- The new credential to be changed for the currently binded user.modBackend
- If this flag is set to true, this method should change the login
credential in the backend server as specified. Otherwise, this
method only need to change how this DataControl establish the
connection to the backend.
IllegalCredentialException
- If the given credentials is not supported by the
DataControl.
DataControlException
- If unable to bind the credential to the DataControl.protected static void modifyHash(OpenSerializableHash hash, Modifier modifier)
hash
- The open hash being modifiedmodifier
- The operation being performed to the open hashprotected static java.util.Vector getKeysFromHash(OpenSerializableHash hash, java.lang.String startsWith)
hash
- Reference to the memory hashstartsWith
- The prefix of the requested keys from the hash.protected java.lang.String getUserDN()
protected void modifyInMemoryData(java.util.ArrayList inMemoryModifiers)
protected java.util.Vector getFromInMemoryData(java.lang.String key)
protected java.util.Vector getKeysFromInMemoryData(java.lang.String startsWith)
|
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.