|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nitido.nim.Entity
public abstract class Entity
The Entity class is the abstraction of an entity in a NiM application for which requests take place. Entities in an application are always authenticated and can only be instantiated through the getEntity() method on NiM.
NiM
,
Serialized FormField Summary | |
---|---|
protected DataControl |
_datacontrol
Reference to the entities data control object. |
protected Credential |
_identifyingCred
Reference to the identifying credential of the entity. |
protected java.util.HashMap |
_nuggets
Reference to the list of nuggets currently attached to this entity. |
protected boolean |
_released
|
protected int |
_requestCount
|
Constructor Summary | |
---|---|
protected |
Entity(NiMKernelServiceVisa visa,
Credential credential,
DataControl datacontrol)
This constructor is called by the EntityService of the NiMKernel to create a new instance of the class. |
Method Summary | |
---|---|
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. |
protected void |
changeDataControlCredential(Credential newDCCred,
boolean modBackend)
Redirector that invokes the DataControl.changeDataControlCredential(). |
void |
changeIdentifyingCredential(Credential newCred)
This method is used to replace the identifying credentials associated with the entity. |
Nugget |
createNugget(java.lang.String nuggetName,
java.lang.String nuggetType,
java.util.Hashtable nuggetSettings)
This method creates a new nugget instance for the given nugget type with the given settings and will attach the nugget to the entity. |
protected void |
finalize()
The finalizer that is responsible for cleaning up the entity. |
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. |
java.util.Vector |
getFromCredentialSpace(java.lang.String key)
This method returns all the credentials associated with the given key. |
java.util.Vector |
getFromUserSpace(java.lang.String key)
This method returns all the objects associated with the given key. |
java.lang.String |
getID()
This method returns the identifier associated to this entity. |
Credential |
getIdentifyingCredential()
This method returns a reference to the identifying credential of the entity. |
NiM |
getNiM()
This method returns a reference to the NiM object that instantiated the entity. |
Nugget |
getNugget(java.lang.String nuggetName)
This method returns a reference to the Nugget that is associated to the given nugget name. |
java.lang.String[] |
getNuggetNames()
This method returns the names of the nugget that has been created and attached to this entity object. |
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. |
Credential |
getValueFromCredentialSpace(java.lang.String key)
This method returns the first instance of the credential object associated to the given key. |
java.io.Serializable |
getValueFromUserSpace(java.lang.String key)
This method returns the first instance of the object associated with the given key. |
void |
modifyCredentialSpace(ModifierContainer container)
This method is used to make batch modifications to the credential space of the entity. |
void |
modifyUserSpace(ModifierContainer container)
This method makes batch modifications to user space of the entity. |
protected void |
releaseEntity()
|
void |
releaseNugget(java.lang.String nuggetName)
This method removes the nugget associated to the given name from this entity. |
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. |
void |
requestBegin()
This method is used to inform the entity that a request on the entity is about to start. |
void |
requestEnd()
This method is used to inform the entity that a request on the entity has finished. |
protected void |
setIdentifyingCredential(Credential authCred)
Change the identifying credential. |
java.lang.String |
toString()
This method returns the entity identifier component of the identifying credential for this entity. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Credential _identifyingCred
protected DataControl _datacontrol
protected final java.util.HashMap _nuggets
protected volatile boolean _released
protected transient int _requestCount
Constructor Detail |
---|
protected Entity(NiMKernelServiceVisa visa, Credential credential, DataControl datacontrol) throws NiMRuntimeException
visa
- The Visa object is used to ensure that only the Entity
service of the NiMKernel can instantiate this class.credential
- The identifying credential of the user object.datacontrol
- A reference to the DataControl object that is binded to
this user. This parameter can be null If this entity
happens to have no DataControl.
NiMRuntimeException
- If the reference to the visa object is null.Method Detail |
---|
public java.lang.String getID()
public Credential getIdentifyingCredential()
public NiM getNiM()
public java.lang.String toString()
toString
in class java.lang.Object
public Nugget getNugget(java.lang.String nuggetName) throws NuggetNotAvailableException, PermissionDeniedException, InitializationFailedException, InvalidSettingException
If a nugget has been created for the specified nuggetName, this method will return the existing nugget instance. Otherwise, it will ask the NuggetService to attempt creating a nugget instance based on the nuggetName. The configuration service must provide the NuggetService with enough information for the specified nuggetName so that it can create the nugget. If the NuggetService fails to create the specified nugget, this method will throw a NuggetNotAvailableException.
nuggetName
- The name of the nugget that was passed when the nugget was
created through the createNugget() method on Entity.
NuggetNotAvailableException
- If no nugget has been created under the nuggetName and the
NuggetService implementation cannot create an instance of
the nugget due to the lack of nugget setting information in
the ConfigurationService.
InitializationFailedException
- If unable to initialize the new nugget with the nugget
settings stored in the configuration service.
PermissionDeniedException
- If the identifying credential of the entity does not have
permission to create the requested nugget.
InvalidSettingException
- If the nugget settings on the configuration service
contains invalid configuration information.public java.lang.String[] getNuggetNames() throws EntityReleasedException
EntityReleasedException
public void releaseNugget(java.lang.String nuggetName)
nuggetName
- The name of the nugget to be release from this entitypublic Nugget createNugget(java.lang.String nuggetName, java.lang.String nuggetType, java.util.Hashtable nuggetSettings) throws PermissionDeniedException, InitializationFailedException, InvalidSettingException
The identifying credential of the current entity is used as the authority for creating the Nugget.
nuggetName
- The unique name for the nugget within the entity.nuggetType
- The type of the nugget to be instantiated.nuggetSettings
- The set of name/value pairs that specify the settings of
the Nugget being created.
InitializationFailedException
- If unable to initialize the new nugget with the given
settings. This Exception will contain more details
explaining the reasons that caused the exception.
PermissionDeniedException
- If the identifying credential of the entity does not have
permission to create the requested nugget.
InvalidSettingException
- If the given settings contains invalid information.public void modifyCredentialSpace(ModifierContainer container) throws DataControlException, PermissionDeniedException
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.
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the operations described by the given container.public void addToCredentialSpace(java.lang.String key, Credential value) throws DataControlException, PermissionDeniedException
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.
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the requested action.public void replaceInCredentialSpace(java.lang.String key, Credential value) throws DataControlException, PermissionDeniedException
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.
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the requested action.public void removeFromCredentialSpace(java.lang.String key, Credential value) throws DataControlException, PermissionDeniedException
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.
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the requested action.public void removeFromCredentialSpace(java.lang.String key) throws DataControlException, PermissionDeniedException
key
- The key used to identify the credentials to be removed.
DataControlException
- If unable to remove the credentials from the credential
space of the entity
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the requested action.public Credential getValueFromCredentialSpace(java.lang.String key) throws DataControlException, PermissionDeniedException
key
- The key that uniquely identifies a set of credentials.
DataControlException
- If unable to retrieve a credential from the credential store.
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the requested action.public java.util.Vector getFromCredentialSpace(java.lang.String key) throws DataControlException, PermissionDeniedException
key
- The key used to identify the requested credentials.
DataControlException
- If unable to retrieve the credentials from the credential
store.
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the requested action.public java.lang.String[] getCredentialSpaceKeys() throws DataControlException, PermissionDeniedException
DataControlException
- If unable to retrive the requested information.
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the requested action.public java.lang.String[] getCredentialSpaceKeys(java.lang.String startsWith) throws DataControlException, PermissionDeniedException
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 space
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the requested action.public void modifyUserSpace(ModifierContainer container) throws DataControlException, PermissionDeniedException
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.
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the operations described by the given container.public void addToUserSpace(java.lang.String key, java.io.Serializable value) throws DataControlException, PermissionDeniedException
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.
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the requested action.public void replaceInUserSpace(java.lang.String key, java.io.Serializable value) throws DataControlException, PermissionDeniedException
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.
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the requested action.public void removeFromUserSpace(java.lang.String key, java.io.Serializable value) throws DataControlException, PermissionDeniedException
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.
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the requested action.public void removeFromUserSpace(java.lang.String key) throws DataControlException, PermissionDeniedException
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.
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the requested action.public java.io.Serializable getValueFromUserSpace(java.lang.String key) throws DataControlException, PermissionDeniedException
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.
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the requested action.public java.util.Vector getFromUserSpace(java.lang.String key) throws DataControlException, PermissionDeniedException
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.
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the requested action.public java.lang.String[] getUserSpaceKeys() throws DataControlException, PermissionDeniedException
DataControlException
- If unable to retrieve the requested information from the
user space.
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the requested action.public java.lang.String[] getUserSpaceKeys(java.lang.String startsWith) throws DataControlException, PermissionDeniedException
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 space
PermissionDeniedException
- This exception is thrown if the Entity is not entitled to
perform the requested action.protected void releaseEntity() throws NiMException
NiMException
protected void finalize()
finalize
in class java.lang.Object
public void requestBegin()
public void requestEnd()
public void changeIdentifyingCredential(Credential newCred) throws AuthenticationFailedException, IllegalCredentialException, DataControlException, PermissionDeniedException, NiMException
newCred
- The new identifying credential of the entity.
AuthenticationFailedException
- If unable to authenticate the given entity credentials.
IllegalCredentialException
- If the given credential is null or invalid.
DataControlException
- If the Entity's DataControl is unable to establish a connection
to its back-end
PermissionDeniedException
- If the Entity does not have permission to perform this operation
NiMException
- If unable to establish a connection to the authentication
service on the back-end.protected final void setIdentifyingCredential(Credential authCred)
authCred
- The new identifying credential for the Entity.protected final void changeDataControlCredential(Credential newDCCred, boolean modBackend) throws IllegalCredentialException, DataControlException
newDCCred
- The new DataControl CredentialmodBackend
- Flag indicating the Entity's DataControl to modify the back-end
with the new credential.
IllegalCredentialException
- If the given credential is null or invalid.
DataControlException
- If the Entity's DataControl is unable to establish a connection
to its back-end
|
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.