Nitido Inc.

com.nitido.nimx.services.nugget.simple
Class NuggetServiceImpl

java.lang.Object
  extended by com.nitido.nim.NiMKernelService
      extended by com.nitido.nim.NuggetService
          extended by com.nitido.nimx.services.nugget.simple.NuggetServiceImpl
All Implemented Interfaces:
NiMConstants

public class NuggetServiceImpl
extends NuggetService

This class provides a simple implementation of the NuggetService. This implementation will directly copy the settings for the nugget from the configuration service. The application need to populate the nugget settings when they call the createNugget method on the Entity object.


Field Summary
protected  java.lang.ClassLoader _classLoader
          Reference to the class loader used to load the nugget
protected  java.lang.String _configPrefix
          The prefix for the keys used to get the nugget configuration from the configuration service.
protected  ConfigurationService _confService
          Reference to the kernel configuration service.
protected  NiMKernel _kernel
          Reference to the kernel license service.
static java.lang.String CONF_KEY_PREFIX_NUGGETSETTING
          The key prefix of the nugget settings information.
static java.lang.String CONF_KEY_PREFIX_NUGGETTYPE
          The key prefix of the nugget class information.
static java.lang.String CONF_KEY_PREFIX_TYPEMAP
          The configuration key prefix for the mapping settings from a user space key to a LDAP attribute name.
static int LEN_CONF_KEY_PREFIX_TYPEMAP
          The length of the string CONF_KEY_PREFIX_TYPEMAP.
 
Fields inherited from class com.nitido.nim.NuggetService
_nuggetVisa
 
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
NuggetServiceImpl(NiMKernelServiceVisa visa)
          This class constructor is used by NiMKernel to instantiate a new NuggetService.
 
Method Summary
 Nugget createNugget(Entity entity, java.lang.String nuggetName)
          This method is used to load and instantiate a Nugget of the given nuggetName.
 Nugget createNugget(Entity entity, java.lang.String nuggetName, java.lang.String nuggetType, java.util.Hashtable nuggetSettings)
          This method is used to load and instantiate a Nugget of the given type and for the given entity.
protected  void init(NiMKernel kernel, ConfigurationService confService)
          This method is used to initialize the kernel service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_classLoader

protected java.lang.ClassLoader _classLoader
Reference to the class loader used to load the nugget


_confService

protected ConfigurationService _confService
Reference to the kernel configuration service.


_kernel

protected NiMKernel _kernel
Reference to the kernel license service.


_configPrefix

protected java.lang.String _configPrefix
The prefix for the keys used to get the nugget configuration from the configuration service.


CONF_KEY_PREFIX_NUGGETTYPE

public static final java.lang.String CONF_KEY_PREFIX_NUGGETTYPE
The key prefix of the nugget class information.

See Also:
Constant Field Values

CONF_KEY_PREFIX_NUGGETSETTING

public static final java.lang.String CONF_KEY_PREFIX_NUGGETSETTING
The key prefix of the nugget settings information.

See Also:
Constant Field Values

CONF_KEY_PREFIX_TYPEMAP

public static final java.lang.String CONF_KEY_PREFIX_TYPEMAP
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_TYPEMAP

public static final int LEN_CONF_KEY_PREFIX_TYPEMAP
The length of the string CONF_KEY_PREFIX_TYPEMAP.

Constructor Detail

NuggetServiceImpl

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

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 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 NuggetService
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.

createNugget

public Nugget createNugget(Entity entity,
                           java.lang.String nuggetName,
                           java.lang.String nuggetType,
                           java.util.Hashtable nuggetSettings)
                    throws PermissionDeniedException,
                           InvalidSettingException,
                           InitializationFailedException
Description copied from class: NuggetService
This method is used to load and instantiate a Nugget of the given type and for the given entity. The requested nugget will be instantiated only if the given credential has permission to load the Nugget.

Specified by:
createNugget in class NuggetService
Parameters:
entity - Reference to the entity object that calls this method.
nuggetName - The name to be associated to the new nugget instance.
nuggetType - The type of the nugget to be created. This parameter is used to match with the nugget description on the configuration service for the nugget.
nuggetSettings - Reference to the settings used to initialize the Nugget.
Returns:
Reference to the new Nugget instance.
Throws:
PermissionDeniedException - If the given credential is not entitled to create the nugget.
InvalidSettingException - If the setting contains invalid information. This exception is usually caused by invalid nuggetType or settings parameters. It can also be the result of configuration problems for this nugget.
InitializationFailedException - If unable to initialize the nugget with the given settings.

createNugget

public Nugget createNugget(Entity entity,
                           java.lang.String nuggetName)
                    throws NuggetNotAvailableException,
                           PermissionDeniedException,
                           InvalidSettingException,
                           InitializationFailedException
Description copied from class: NuggetService
This method is used to load and instantiate a Nugget of the given nuggetName. The requested nugget will be instantiated only if the given credential has permission to load the Nugget.

This method will determine the nugget type and settings from the ConfigurationService. If it cannot locate the information for the specified nuggetName, a NuggetNotAvailableException must be thrown by the service implementation.

Specified by:
createNugget in class NuggetService
Parameters:
entity - Reference to the entity object that calls this method.
nuggetName - The name to be associated to the new nugget instance.
Returns:
Reference to the new Nugget instance.
Throws:
NuggetNotAvailableException - If the NuggetService cannot retrieve the required information from the configuration service to instantiate the nugget.
PermissionDeniedException - If the given credential is not entitled to create the nugget.
InvalidSettingException - If the setting contains invalid information. This exception is usually caused by invalid nuggetType or settings parameters. It can also be the result of configuration problems for this nugget.
InitializationFailedException - If unable to initialize the nugget with the given settings.

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.