Nitido Inc.

com.nitido.nimx.services.configuration.file
Class ConfigurationServiceImpl

java.lang.Object
  extended by com.nitido.nim.NiMKernelService
      extended by com.nitido.nim.ConfigurationService
          extended by com.nitido.nimx.services.configuration.file.ConfigurationServiceImpl
All Implemented Interfaces:
NiMConstants

public class ConfigurationServiceImpl
extends ConfigurationService

This ConfigurationService implementation reads in the configuration from two files, one with default settings and one with local settings.

This Configuration Service requires the NiM Descriptor to specify the following setting for the service.

Since ConfigurationService is the FIRST NiM core service to be loaded, its configuration are specified in the NiM Descriptor file. (For other services, the configuration is usually specified in the configuration files pointed by the previous settings.

The configuration file format follows the specification indicated by the standard Java class java.util.Properties.


Field Summary
static java.lang.String DEFAULT_URL
          The name of the settings key that contains the URL of the file with the default configuration attributes.
static java.lang.String LOCAL_URL
          The name of the settings key that contains the URL of the file with the local configuration attributes.
 
Fields inherited from class com.nitido.nim.ConfigurationService
KEY_APP_ID, KEY_ENV_ID, KEY_NODE_ID, KEY_REV_ID
 
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
ConfigurationServiceImpl(NiMKernelServiceVisa visa)
          This class constructor is used by NiMKernel to instantiate a new ConfigurationService.
 
Method Summary
 java.util.Properties getPropertiesByFilter(java.lang.String searchFilter)
          This method is currently not supported by this service implementation.
 java.util.Properties getPropertiesByPrefix(java.lang.String prefix)
          This method returns all the properties whose keys start with the given prefix.
 java.lang.String getProperty(java.lang.String name)
          This method returns the configuration property associated to the given name.
 java.lang.String getPropertyWithDefault(java.lang.String name, java.lang.String defaultValue)
          This method returns the configuration property associated to the given name.
protected  void init(NiMKernel kernel, java.util.Map settings)
          This method is called by the NiMKernel to initialize the ConfigurationService.
 
Methods inherited from class com.nitido.nim.ConfigurationService
init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_URL

public static final java.lang.String DEFAULT_URL
The name of the settings key that contains the URL of the file with the default configuration attributes.

See Also:
Constant Field Values

LOCAL_URL

public static final java.lang.String LOCAL_URL
The name of the settings key that contains the URL of the file with the local configuration attributes.

See Also:
Constant Field Values
Constructor Detail

ConfigurationServiceImpl

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

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,
                    java.util.Map settings)
             throws InitializationFailedException,
                    NiMException
This method is called by the NiMKernel to initialize the ConfigurationService.

Specified by:
init in class ConfigurationService
Parameters:
kernel - Reference to the kernel that instantitated this service.
settings - The settings used to initialize the service. This service implementation expects the following configuration parameters:
  • The URL of the file that contains the default configuration attributes.
  • The URL of the file that contains the local configuration attributes.
Throws:
InitializationFailedException - If unable to initialize the service due to any of the following reasons:
  • The settings parameter is null.
  • The URL of the file with the default configuration was not included in the settings parameter.
  • Unable to load the default or the local configuration from the corresponding URLs.
NiMException - If unable to contact the back-end service. This exception is never thrown by this service implementation.

getPropertiesByPrefix

public java.util.Properties getPropertiesByPrefix(java.lang.String prefix)
Description copied from class: ConfigurationService
This method returns all the properties whose keys start with the given prefix. If no property matches the given prefix the method returns an empty Properties object.

Specified by:
getPropertiesByPrefix in class ConfigurationService
Parameters:
prefix - The prefix used to search the configuration properties.
Returns:
The Properties object with all the properties whose keys start with the given prefix.
See Also:
Properties

getPropertiesByFilter

public java.util.Properties getPropertiesByFilter(java.lang.String searchFilter)
This method is currently not supported by this service implementation. An UnsupportedOperationException is thrown by this method..

Specified by:
getPropertiesByFilter in class ConfigurationService
Parameters:
searchFilter - The search filter used to retrieve a set of configuration properties. This service implementation ignores this parameter.
Returns:
An UnsupportedOperationException is thrown by this method

getProperty

public java.lang.String getProperty(java.lang.String name)
Description copied from class: ConfigurationService
This method returns the configuration property associated to the given name.

Specified by:
getProperty in class ConfigurationService
Parameters:
name - The name of the configuration property.
Returns:
The value of the requested configuration property.

getPropertyWithDefault

public java.lang.String getPropertyWithDefault(java.lang.String name,
                                               java.lang.String defaultValue)
Description copied from class: ConfigurationService
This method returns the configuration property associated to the given name. If no property matches the given name, the method returns the given default value.

Specified by:
getPropertyWithDefault in class ConfigurationService
Parameters:
name - The name of the configuration property.
defaultValue - The return value if the given property name does not exist.
Returns:
The value of the requested configuration property.

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.