Nitido Inc.

com.nitido.nimx.services.datacontrol.profilemap
Class DataControlImpl

java.lang.Object
  extended by com.nitido.nim.DataControl
      extended by com.nitido.nimx.services.datacontrol.profilemap.DataControlImpl
All Implemented Interfaces:
CredentialConstants, java.io.Serializable

public class DataControlImpl
extends DataControl
implements CredentialConstants

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.

See Also:
Serialized Form

Field Summary
static java.lang.String CONF_KEY_ATTRIBUTEMAP_PASSWORD
          The user password attribute key.
static java.lang.String CONF_KEY_HOST
          Configuration key for the directory host name
static java.lang.String CONF_KEY_PORT
          Configuration key for the directory port number
static java.lang.String CONF_KEY_PREFIX_ATTRIBUTEMAP
          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 configuration key for the bind-as DN.
static java.lang.String CONF_KEY_PREFIX_BIND_AS_PWD
          The configuration key for the bind-as password.
static java.lang.String CONF_KEY_PREFIX_DN_POSTFIX
          The configuration key prefix for an Entity's DN postfix for the specific credential type.
static java.lang.String CONF_KEY_PREFIX_DN_PREFIX
          The configuration key prefix for an Entity's DN prefix.
static java.lang.String CONF_KEY_PREFIX_DN_TOKEN_KEY
          The configuration key postfix for an Entity's DN token key.
static int LEN_CONF_KEY_PREFIX_ATTRIBUTEMAP
          The string length of the configuration key prefix "com.nitido.nimx.services.datacontrol.profilemap.attributemap.".
static java.lang.String USER_SPACE_KEY_PASSWORD
          The constant for the user space key "password".
 
Fields inherited from interface com.nitido.nim.NiMConstants
ACTION_CREATE_NUGGET, ACTION_CREATE_NUGGET_BY_NAME, ACTION_CRED_SPACE_ADD, ACTION_CRED_SPACE_GET_KEYS, ACTION_CRED_SPACE_GET_KEYS_START_WITH, ACTION_CRED_SPACE_GET_VALUE, ACTION_CRED_SPACE_GET_VALUES, ACTION_CRED_SPACE_MODIFY, ACTION_CRED_SPACE_REMOVE_VALUE, ACTION_CRED_SPACE_REMOVE_VALUES, ACTION_CRED_SPACE_REPLACE, ACTION_DEPROVISION_ENTITY, ACTION_ENTITY_CHANGE_CRED, ACTION_LOG_EVENT, ACTION_PROVISION_ENTITY, ACTION_USER_SPACE_ADD, ACTION_USER_SPACE_GET_KEYS, ACTION_USER_SPACE_GET_KEYS_START_WITH, ACTION_USER_SPACE_GET_VALUE, ACTION_USER_SPACE_GET_VALUES, ACTION_USER_SPACE_MODIFY, ACTION_USER_SPACE_REMOVE_VALUE, ACTION_USER_SPACE_REMOVE_VALUES, ACTION_USER_SPACE_REPLACE, CONF_PREFIX_SECURITY_ACCESS, CONF_PREFIX_SECURITY_ALLOW, CONF_PREFIX_SECURITY_ASSIGN, CONF_PREFIX_SECURITY_RESOURCE, PARAM_CHANGE_CRED, PARAM_DEPROVISION_CREDENTIAL, PARAM_EVENT_NAME, PARAM_MODIFIER_CONTAINER, PARAM_NUGGET_CREATE_CRED, PARAM_NUGGET_NAME, PARAM_NUGGET_SETTINGS, PARAM_NUGGET_TYPE, PARAM_PROVISION_DESCRIPTOR, PARAM_SPACE_KEY, PARAM_SPACE_KEYS_START_WITH, PARAM_SPACE_VALUE, PREFIX_ACCESS_CLASS_IN_PACKAGE
 
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 settings)
          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 associated Entity has been signaled 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 getFromUserSpaceImpl(java.lang.String key)
          This method contains the actual implementation for the getFromUserSpace() method.
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 settings)
          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  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 com.nitido.nim.DataControl
addToCredentialSpace, addToUserSpace, getCredentialSpaceKeys, getCredentialSpaceKeys, getFromCredentialSpace, getFromUserSpace, getUserSpaceKeys, getUserSpaceKeys, getValueFromCredentialSpace, getValueFromUserSpace, modifyCredentialSpace, modifyUserSpace, removeFromCredentialSpace, removeFromCredentialSpace, removeFromUserSpace, removeFromUserSpace, replaceInCredentialSpace, replaceInUserSpace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONF_KEY_HOST

public static final java.lang.String CONF_KEY_HOST
Configuration key for the directory host name

See Also:
Constant Field Values

CONF_KEY_PORT

public static final java.lang.String CONF_KEY_PORT
Configuration key for the directory port number

See Also:
Constant Field Values

CONF_KEY_PREFIX_DN_TOKEN_KEY

public static final java.lang.String CONF_KEY_PREFIX_DN_TOKEN_KEY
The configuration key postfix for an Entity's DN token key.

See Also:
Constant Field Values

CONF_KEY_PREFIX_DN_PREFIX

public static final java.lang.String CONF_KEY_PREFIX_DN_PREFIX
The configuration key prefix for an Entity's DN prefix.

See Also:
Constant Field Values

CONF_KEY_PREFIX_DN_POSTFIX

public static final java.lang.String CONF_KEY_PREFIX_DN_POSTFIX
The configuration key prefix for an Entity's DN postfix for the specific credential type.

See Also:
Constant Field Values

CONF_KEY_PREFIX_BIND_AS_DN

public static final java.lang.String CONF_KEY_PREFIX_BIND_AS_DN
The configuration key for the bind-as DN.

See Also:
Constant Field Values

CONF_KEY_PREFIX_BIND_AS_PWD

public static final java.lang.String CONF_KEY_PREFIX_BIND_AS_PWD
The configuration key for the bind-as password.

See Also:
Constant Field Values

CONF_KEY_PREFIX_ATTRIBUTEMAP

public static final java.lang.String CONF_KEY_PREFIX_ATTRIBUTEMAP
The configuration key prefix for the mapping settings from a user space key to a LDAP attribute name.

See Also:
Constant Field Values

LEN_CONF_KEY_PREFIX_ATTRIBUTEMAP

public static final int LEN_CONF_KEY_PREFIX_ATTRIBUTEMAP
The string length of the configuration key prefix "com.nitido.nimx.services.datacontrol.profilemap.attributemap.".


USER_SPACE_KEY_PASSWORD

public static final java.lang.String USER_SPACE_KEY_PASSWORD
The constant for the user space key "password".

See Also:
Constant Field Values

CONF_KEY_ATTRIBUTEMAP_PASSWORD

public static final java.lang.String CONF_KEY_ATTRIBUTEMAP_PASSWORD
The user password attribute key.

See Also:
Constant Field Values
Constructor Detail

DataControlImpl

protected DataControlImpl(Credential credential,
                          java.util.HashMap settings)
                   throws IllegalCredentialException,
                          DataControlException
This constructor returns an instance of the DataControl that is binded to the given credential. This implementation of the constructor simply calls the constructor of the parent class.

This method is declared protected to ensure that only the corresponding DataControlService can be used to get an instance of a DataControl.

Parameters:
credential - A reference to the Credential object used to authenticate against the back-end data store.
settings - A reference to the HashMap object that contains parameters to initialize the DataControl. This DataControl implementation requires the following initialization parameters:
  • Directory host name.
  • Directory port number.
  • DN for the Directory Manager.
  • Password for the Directory Manager.
  • The prefix used for mapping the property name for the user space keys to the corresponding directory attribute name.
Throws:
IllegalCredentialException - If the given credentials are not supported by the concrete DataControl implementation.
DataControlException - If unable to instantiate the DataControl object
Method Detail

initialize

protected void initialize(java.util.HashMap settings)
                   throws DataControlException
This method is used to initialize the DataControl with the given settings. The contents of the settings container are specific to the concrete implementation of the class.

Specified by:
initialize in class DataControl
Parameters:
settings - Reference to the HashMap object that contains the parameters used to initialize the DataControl. This DataControl implementation requires the following initialization parameters:
  • Directory host name.
  • Directory port number.
  • DN for the Directory Manager.
  • Password for the Directory Manager.
  • The prefix used for mapping the property name for the user space keys to the corresponding directory attribute name.
Throws:
DataControlException - If unable to initialize the DataControl

bind

public void bind(Credential cred)
          throws IllegalCredentialException,
                 DataControlException
This method is used to bind the given credential to the DataControl if the credential can be authenticated against the directory server.

Specified by:
bind in class DataControl
Parameters:
cred - Reference to the credential object used to authenticate the entity to the back-end data store.
Throws:
IllegalCredentialException - If the given credentials is not supported by the DataControl.
DataControlException - If unable to bind the credential to the DataControl.

acquire

protected void acquire()
                throws DataControlException
Description copied from class: DataControl
This method is used to establish a connection to the back-end data store. The method is called by each of the methods that access the data store.

Specified by:
acquire in class DataControl
Throws:
DataControlException - If unable to establish connection to the back-end data store.

release

protected void release()
                throws DataControlException
Description copied from class: DataControl
This method is used to release a connection to the back-end data store. The method is called by each of the methods that access the data store.

Specified by:
release in class DataControl
Throws:
DataControlException - If unable to close the connection to the back-end data store.

activate

protected void activate()
                 throws ActivationException
Description copied from class: DataControl
This method is used to activates the DataControl after the Entity object containing this DataControl is deserialized.

Specified by:
activate in class DataControl
Throws:
ActivationException - If unable to activate the DataControl

deactivate

protected void deactivate()
                   throws ActivationException
Description copied from class: DataControl
This method is called to deactivate the DataControl. This method is called by the Entity object that contains this DataControl when the Entity is being serialized.

Specified by:
deactivate in class DataControl
Throws:
ActivationException - If unable to de-activate the DataControl.

modifyCredentialSpaceImpl

protected void modifyCredentialSpaceImpl(ModifierContainer container)
                                  throws DataControlException
Description copied from class: DataControl
This method provides the actual implementation to the modifyCredentialSpace() method.

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.

Specified by:
modifyCredentialSpaceImpl in class DataControl
Parameters:
container - Encapsulates the list of modifications to be executed on the Credential space.
Throws:
DataControlException - This exception is thrown if unable to perform the requested modifications.

getValueFromCredentialSpaceImpl

protected Credential getValueFromCredentialSpaceImpl(java.lang.String key)
                                              throws DataControlException
Description copied from class: DataControl
This method contains the actual implementation for the getValueFromCredentialSpace( key ) method. This method is used to separate the logic for opening/closing connections from the actual operation logic.

Specified by:
getValueFromCredentialSpaceImpl in class DataControl
Parameters:
key - The key that uniquely identifies a set of credentials.
Returns:
The reference to the first credential instance that was previously associated to the given key. If the given key is not found, the method returns null.
Throws:
DataControlException - If unable to retrieve a credential from the credential store.

getFromCredentialSpaceImpl

protected java.util.Vector getFromCredentialSpaceImpl(java.lang.String key)
                                               throws DataControlException
Description copied from class: DataControl
This method contains the actual implementation for the getFromCredentialSpace( key ) method. This method is used to separate the logic for opening/closing connections from the actual logic to perform the operation

Specified by:
getFromCredentialSpaceImpl in class DataControl
Parameters:
key - The key used to identify the requested credentials.
Returns:
A Vector with all the credentials associated with the given key. If no credential is found with the given key then this method returns an empty vector.
Throws:
DataControlException - If unable to retrieve the credentials from the credential store.

getCredentialSpaceKeysImpl

protected java.lang.String[] getCredentialSpaceKeysImpl(java.lang.String startsWith)
                                                 throws DataControlException
Description copied from class: DataControl
This method contains the actual implementation for the getCredentialSpaceKeys( startsWith ) method. This method is used to separate the logic for opening/closing connections from the actual logic to perform the operation

Specified by:
getCredentialSpaceKeysImpl in class DataControl
Parameters:
startsWith - The prefix of the requested credential keys.
Returns:
A String array with the keys that start with the given prefix. If the given prefix is null, this method returns all the available keys. Finally if no keys are found with the given key, this method returns an empty array.
Throws:
DataControlException - If unable to fetch the credential space.

modifyUserSpaceImpl

protected void modifyUserSpaceImpl(ModifierContainer container)
                            throws DataControlException
Description copied from class: DataControl
This method contains the actual implementation for the modifyUserSpace( container ) method. This method is used to separate the logic for opening/closing connections from the actual logic to perform the operation.

Specified by:
modifyUserSpaceImpl in class DataControl
Parameters:
container - Encapsulates the list of modifications to be executed on the user space of the entity.
Throws:
DataControlException - If unable to perform any of the requested modifications.

getValueFromUserSpaceImpl

protected java.io.Serializable getValueFromUserSpaceImpl(java.lang.String key)
                                                  throws DataControlException
Description copied from class: DataControl
This method contains the actual implementation for the getValueFromUserSpace() method. This method is used to separate the logic for opening/closing connections from the actual logic to perform the operation.

Specified by:
getValueFromUserSpaceImpl in class DataControl
Parameters:
key - The key that uniquely idenfifies a set of objects in the user space.
Returns:
The first object reference that matches the given key.
Throws:
DataControlException - If unable to retrieve the requested object from the user space.

getFromUserSpaceImpl

protected java.util.Vector getFromUserSpaceImpl(java.lang.String key)
                                         throws DataControlException
Description copied from class: DataControl
This method contains the actual implementation for the getFromUserSpace() method. This method is used to separate the logic for opening/closing connections from the actual logic to perform the operation.

Specified by:
getFromUserSpaceImpl in class DataControl
Parameters:
key - The key used to identify the set of objects in the user space.
Returns:
A Vector with all the objects associated with the given key. If the given key is not found, this method returns an empty vector.
Throws:
DataControlException - If Unable to retrieve requested information from the user space.

getUserSpaceKeysImpl

protected java.lang.String[] getUserSpaceKeysImpl(java.lang.String startsWith)
                                           throws DataControlException
Description copied from class: DataControl
This method contains the actual implementation for the getUserSpaceKeys() method. This method is used to separate the logic for opening/closing connections from the actual logic to perform the operation.

Specified by:
getUserSpaceKeysImpl in class DataControl
Parameters:
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
Returns:
A String array with the user space keys that matches the given prefix. If no match is found, the method returns an empty array.
Throws:
DataControlException - If unable to retrieve the requested information from the user space

changeDataControlCredential

protected void changeDataControlCredential(Credential newCred,
                                           boolean modBackend)
                                    throws IllegalCredentialException,
                                           DataControlException
This method change the DataControl credential for user. If you want to call this method, you must define the configuration key com.nitido.nimx.services.datacontrol.attributemap.password.

Specified by:
changeDataControlCredential in class DataControl
Parameters:
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.
Throws:
IllegalCredentialException - If the given credentials is not supported by the DataControl.
DataControlException - If unable to bind the credential to the DataControl.

destroy

protected void destroy()
Description copied from class: DataControl
This method is invoked when the associated Entity has been signaled as dying. This method should cleaned up all the resources associated to the DataControl that cannot be removed by the garbage collector.

Specified by:
destroy in class DataControl

Nitido NiM 2.5 Java API

These JavaDoc pages are generated for release/nim_2_5-2.5.44

Copyright © 1999-2009 Nitido Inc.    Proprietary and Confidential.    All Rights Reserved.