Nitido Inc.

com.nitido.nim
Class EntityService

java.lang.Object
  extended by com.nitido.nim.NiMKernelService
      extended by com.nitido.nim.EntityService
All Implemented Interfaces:
NiMConstants
Direct Known Subclasses:
EntityServiceImpl

public abstract class EntityService
extends NiMKernelService

The EntityService is the NiMKernel module resopnsible for managing entity instantiation.


Field Summary
 
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
 
Constructor Summary
EntityService(NiMKernelServiceVisa visa)
          This class constructor is used by NiMKernel to instantiate a new EntityService
 
Method Summary
protected  void changeDataControlCredential(Entity entity, Credential newDCCred, boolean modBackend)
          This is a redirector method to entity's changeDataControlCredential method.
abstract  void changeIdentifyingCredential(Entity entity, Credential newCred)
          This method is used to change the identifying credential of an entity (this is usually called for changing the user's password).
abstract  Entity getEntity(Credential credential)
          This method returns an instance of an Entity associated to the given credential.
protected abstract  void init(NiMKernel kernel, ConfigurationService confService)
          This method is used to initialize the kernel service.
protected abstract  void releaseEntity(Entity entity)
          This method signals the EntityService implementation that the specified Entity is "dying".
protected  void setEntityIdentifyingCredential(Entity entity, Credential authCred)
          This is a redirector method to allow the EntityService to change the IdentifyingCredential of the entity object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityService

public EntityService(NiMKernelServiceVisa visa)
This class constructor is used by NiMKernel to instantiate a new EntityService

Parameters:
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

init

protected abstract void init(NiMKernel kernel,
                             ConfigurationService confService)
                      throws InitializationFailedException,
                             NiMException
Description copied from class: NiMKernelService
This method is used to initialize the kernel service. Extenders of this class must implement this method.

Specified by:
init in class NiMKernelService
Parameters:
kernel - Reference to the NiMKernel object that instantiated the service.
confService - A reference to the configuration service. All the service implementations (except ConfigurationService) should retrieve the setting information from it.
Throws:
InitializationFailedException - If unable to initialize the kernel service.
NiMException - If service initialization can not be done due to failure in establish a connection to the back-end service. Not all service implementation will throw this exception.

getEntity

public abstract Entity getEntity(Credential credential)
                          throws AuthenticationFailedException,
                                 IllegalCredentialException,
                                 NiMException
This method returns an instance of an Entity associated to the given credential.

Parameters:
credential - The credential that uniquely identifies the requested Entity
Returns:
Reference to the newly instantiated entity. This method should never return null.
Throws:
AuthenticationFailedException - If unable to authenticate the given credential.
IllegalCredentialException - If the given credential is null or determined to be invalid by the underlying implementations of the Authentication Service or the DataControl Service.
NiMException - If a generic error occurred.

changeIdentifyingCredential

public abstract void changeIdentifyingCredential(Entity entity,
                                                 Credential newCred)
                                          throws AuthenticationFailedException,
                                                 IllegalCredentialException,
                                                 DataControlException,
                                                 NiMException
This method is used to change the identifying credential of an entity (this is usually called for changing the user's password).
Semantic Requirements: Implementation of this method must authenticate the new credential through the AuthenticationService.authenticate() method before changing the credential for other services.

Parameters:
entity - The entity for which the credential is replaced. All implementation can expect this parameter to be valid. It is because the application cannot access this method directly. This method is redirected by Entity.changeIdentifyingCredential( Credential newCred ) only.
newCred - The new identifying credential for the entity.
Throws:
AuthenticationFailedException - If unable to authenticate the identifying credential of the entity.
IllegalCredentialException - If the given credential is not valid
DataControlException - If unable to bind the DataControl to the entity.
NiMException - If unable to establish a connection to the back-end services.

releaseEntity

protected abstract void releaseEntity(Entity entity)
This method signals the EntityService implementation that the specified Entity is "dying". The EntityService implementation will perform the required clean up and monitoring operations. This method is invoked only by NiM.releaseEntity(). It is not supposed to be invoked by any other NiM core objects or NiMKernelService implementations.

Parameters:
entity - The entity object that is marked as "dying".

changeDataControlCredential

protected final void changeDataControlCredential(Entity entity,
                                                 Credential newDCCred,
                                                 boolean modBackend)
                                          throws IllegalCredentialException,
                                                 DataControlException
This is a redirector method to entity's changeDataControlCredential method.

Parameters:
entity - Reference to the entity for which the credential is being replaced.
newDCCred - Reference to the new credential for the data control.
modBackend - Flag used to inform the DataControl implementation to modify it back-end when the data control credentials are replaced.
Throws:
IllegalCredentialException - If the given credential is invalid.
DataControlException - If unable to establish a connection to the data control's back-end.

setEntityIdentifyingCredential

protected final void setEntityIdentifyingCredential(Entity entity,
                                                    Credential authCred)
This is a redirector method to allow the EntityService to change the IdentifyingCredential of the entity object.

Parameters:
entity - Reference to the entity whose identifying credential is being set.
authCred - The new identifying credential of the entity. This credential must be previously authenticated.

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.