|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nitido.nim.DataControl
public abstract class DataControl
A DataControl provides Entities with an abstraction for storing and retrieving profile data. The data control interface defines two types of data spaces for storing data:
Constructor Summary | |
---|---|
protected |
DataControl(Credential credential,
java.util.HashMap settings)
This constructor returns an instance of the DataControl that is binded to the given credential. |
Method Summary | |
---|---|
protected abstract void |
acquire()
This method is used to establish a connection to the back-end data store. |
protected abstract void |
activate()
This method is used to activates the DataControl after the Entity object containing this DataControl is deserialized. |
void |
addToCredentialSpace(java.lang.String key,
Credential value)
This method adds a new credential to the user space under the given key. |
void |
addToUserSpace(java.lang.String key,
java.io.Serializable value)
This method adds a new object to the user space of the entity. |
abstract void |
bind(Credential credential)
This method is used to bind the given credential to the DataControl. |
protected abstract void |
changeDataControlCredential(Credential newCred,
boolean modBackend)
This method changes and rebinds the "login" credential of the DataControl. |
protected abstract void |
deactivate()
This method is called to deactivate the DataControl. |
protected abstract void |
destroy()
This method is invoked when the associated Entity has been signaled as dying. |
java.lang.String[] |
getCredentialSpaceKeys()
This method returns all the keys currently available in the credential space. |
java.lang.String[] |
getCredentialSpaceKeys(java.lang.String startsWith)
This method returns all the credential keys currenlty available in the credential space whose value starts with the given prefix. |
protected abstract java.lang.String[] |
getCredentialSpaceKeysImpl(java.lang.String startsWith)
This method contains the actual implementation for the getCredentialSpaceKeys( startsWith ) method. |
java.util.Vector |
getFromCredentialSpace(java.lang.String key)
This method returns all the credentials associated with the given key. |
protected abstract java.util.Vector |
getFromCredentialSpaceImpl(java.lang.String key)
This method contains the actual implementation for the getFromCredentialSpace( key ) method. |
java.util.Vector |
getFromUserSpace(java.lang.String key)
This method returns all the objects associated with the given key. |
protected abstract java.util.Vector |
getFromUserSpaceImpl(java.lang.String key)
This method contains the actual implementation for the getFromUserSpace() method. |
java.lang.String[] |
getUserSpaceKeys()
This method returns all the keys currently available in the user space. |
java.lang.String[] |
getUserSpaceKeys(java.lang.String startsWith)
This method returns all the object keys currenlty available in the user space whose value starts with the given prefix. |
protected abstract java.lang.String[] |
getUserSpaceKeysImpl(java.lang.String startsWith)
This method contains the actual implementation for the getUserSpaceKeys() method. |
Credential |
getValueFromCredentialSpace(java.lang.String key)
This method returns the first instance of the credential object associated to the given key. |
protected abstract Credential |
getValueFromCredentialSpaceImpl(java.lang.String key)
This method contains the actual implementation for the getValueFromCredentialSpace( key ) method. |
java.io.Serializable |
getValueFromUserSpace(java.lang.String key)
This method returns the first instance of the object associated with the given key. |
protected abstract java.io.Serializable |
getValueFromUserSpaceImpl(java.lang.String key)
This method contains the actual implementation for the getValueFromUserSpace() method. |
protected abstract void |
initialize(java.util.HashMap settings)
This method is used to initialize the DataControl with the given settings. |
void |
modifyCredentialSpace(ModifierContainer container)
This method is used to make batch modifications to the credential space of the entity. |
protected abstract void |
modifyCredentialSpaceImpl(ModifierContainer container)
This method provides the actual implementation to the modifyCredentialSpace() method. |
void |
modifyUserSpace(ModifierContainer container)
This method makes batch modifications to user space of the entity. |
protected abstract void |
modifyUserSpaceImpl(ModifierContainer container)
This method contains the actual implementation for the modifyUserSpace( container ) method. |
protected abstract void |
release()
This method is used to release a connection to the back-end data store. |
void |
removeFromCredentialSpace(java.lang.String key)
This method removes all the credentials that are associated to the given key from the credential space. |
void |
removeFromCredentialSpace(java.lang.String key,
Credential value)
This method removes the given key/credential pair from the credential space of the entity. |
void |
removeFromUserSpace(java.lang.String key)
This method removes all the objects that are associated to the given key from the user space. |
void |
removeFromUserSpace(java.lang.String key,
java.io.Serializable value)
This method removes the given key/value pair from the user space of the entity. |
void |
replaceInCredentialSpace(java.lang.String key,
Credential value)
This method is used to store the given credential into the credential space under the given key. |
void |
replaceInUserSpace(java.lang.String key,
java.io.Serializable value)
This method is used to store the given object into the user space under the given key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DataControl(Credential credential, java.util.HashMap settings) throws IllegalCredentialException, DataControlException
credential
- Reference to the Credential object used to authenticate
against the back-end data store.settings
- A reference to the HashMap object that contains the
parameters used to initialize the DataControl. The contents
of this container are specific to each DataControl
implementation.
IllegalCredentialException
- If the given credentials are not supported by the concrete
DataControl implementation.
DataControlException
- If unable to instantiate the DataControl objectMethod Detail |
---|
protected abstract void initialize(java.util.HashMap settings) throws DataControlException
settings
- Reference to the HashMap object that contains the
parameters used to initialize the DataControl. The
contents of this container are specific to the
implementation of the class.
DataControlException
- If unable to initialize the DataControlprotected abstract void destroy()
public abstract void bind(Credential credential) throws IllegalCredentialException, DataControlException
credential
- Reference to the credential object used to authenticate the
entity to the DataControl back-end data store.
IllegalCredentialException
- If the given credentials is not supported by the
concrete DataControl implementation.
DataControlException
- If unable to bind the credential to the back-end data storeprotected abstract void acquire() throws DataControlException
DataControlException
- If unable to establish connection to the back-end data
store.protected abstract void release() throws DataControlException
DataControlException
- If unable to close the connection to the back-end data
store.protected abstract void activate() throws ActivationException
ActivationException
- If unable to activate the DataControlprotected abstract void deactivate() throws ActivationException
ActivationException
- If unable to de-activate the DataControl.public final void modifyCredentialSpace(ModifierContainer container) throws DataControlException
A ModifierContainer object encapsulate a series of actions to be performed such as: ADD, REPLACE, or REMOVE. Each action is performed on a key/value pair.
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 abstract void modifyCredentialSpaceImpl(ModifierContainer container) throws DataControlException
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.
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.public final void addToCredentialSpace(java.lang.String key, Credential value) throws DataControlException
key
- The key used to identify the given credentialvalue
- The credential to be added to the credential space of the entity.
DataControlException
- If unable to add the credential to the credential space.public final void replaceInCredentialSpace(java.lang.String key, Credential value) throws DataControlException
key
- The key used to identify the given credentialvalue
- The credential to be added to the credential space of the
entity.
DataControlException
- If unable to add the credential to the credential space.public final void removeFromCredentialSpace(java.lang.String key, Credential value) throws DataControlException
key
- The key used to identify the credential to be removed.value
- The credential object to be removed from the credential space.
DataControlException
- If unable to remove the credential from the credential
space of the entity.public final void removeFromCredentialSpace(java.lang.String key) throws DataControlException
key
- The key used to identify the credentials to be removed.
DataControlException
- If unable to remove the credentials from the credential
space of the entitypublic final Credential getValueFromCredentialSpace(java.lang.String key) throws DataControlException
key
- The key that uniquely identifies a set of credentials.
DataControlException
- If unable to retrieve a credential from the credential store.protected abstract Credential getValueFromCredentialSpaceImpl(java.lang.String key) throws DataControlException
key
- The key that uniquely identifies a set of credentials.
DataControlException
- If unable to retrieve a credential from the credential store.public final java.util.Vector getFromCredentialSpace(java.lang.String key) throws DataControlException
key
- The key used to identify the requested credentials.
DataControlException
- If unable to retrieve the credentials from the credential
store.protected abstract java.util.Vector getFromCredentialSpaceImpl(java.lang.String key) throws DataControlException
key
- The key used to identify the requested credentials.
DataControlException
- If unable to retrieve the credentials from the credential
store.public final java.lang.String[] getCredentialSpaceKeys() throws DataControlException
DataControlException
- If unable to retrive the requested information.public final java.lang.String[] getCredentialSpaceKeys(java.lang.String startsWith) throws DataControlException
startsWith
- The prefix string used to search for the currently
available credential keys. If no key matches the given
prefix, this method returns an empty array
DataControlException
- If unable to retrieve the requested information from the
credential spaceprotected abstract java.lang.String[] getCredentialSpaceKeysImpl(java.lang.String startsWith) throws DataControlException
startsWith
- The prefix of the requested credential keys.
DataControlException
- If unable to fetch the credential space.public final void modifyUserSpace(ModifierContainer container) throws DataControlException
A ModifierContainer object encapsulate a series of actions to be performed, such as: ADD, REPLACE, or REMOVE. Each action is performed on a key/value pair.
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 abstract void modifyUserSpaceImpl(ModifierContainer container) throws DataControlException
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.public final void addToUserSpace(java.lang.String key, java.io.Serializable value) throws DataControlException
key
- The key used to identify object being added to the user space.value
- The object being added to the user space.
DataControlException
- If unable to add the given object to the user space of the
entity.public final void replaceInUserSpace(java.lang.String key, java.io.Serializable value) throws DataControlException
key
- The key used to identify the object being stored.value
- The object to be stored in the user space.
DataControlException
- If unable to add the object to the user space.public final void removeFromUserSpace(java.lang.String key, java.io.Serializable value) throws DataControlException
key
- The key used to identify the credential to be removed.value
- The object to be removed.
DataControlException
- If unable to remove the object from the user space.public final void removeFromUserSpace(java.lang.String key) throws DataControlException
key
- The key used to identify the objects being removed.
DataControlException
- If unable to remove the objects associated with the given
key from the user space.public final java.io.Serializable getValueFromUserSpace(java.lang.String key) throws DataControlException
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 abstract java.io.Serializable getValueFromUserSpaceImpl(java.lang.String key) throws DataControlException
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.public final java.util.Vector getFromUserSpace(java.lang.String key) throws DataControlException
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 abstract java.util.Vector getFromUserSpaceImpl(java.lang.String key) throws DataControlException
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.public final java.lang.String[] getUserSpaceKeys() throws DataControlException
DataControlException
- If unable to retrieve the requested information from the
user space.public final java.lang.String[] getUserSpaceKeys(java.lang.String startsWith) throws DataControlException
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 abstract java.lang.String[] getUserSpaceKeysImpl(java.lang.String startsWith) throws DataControlException
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 abstract void changeDataControlCredential(Credential newCred, boolean modBackend) throws IllegalCredentialException, DataControlException
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.
|
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.