Nitido Inc.

com.nitido.nim
Class BrandService

java.lang.Object
  extended by com.nitido.nim.NiMKernelService
      extended by com.nitido.nim.BrandService
All Implemented Interfaces:
NiMConstants
Direct Known Subclasses:
BrandServiceImpl, BrandServiceImpl

public abstract class BrandService
extends NiMKernelService

The BrandService provides access to branding (multi-tentant) and application (class-of-service) configuration for the system.


Field Summary
protected  ConfigurationService _confService
          Reference to the configuration service
 
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
BrandService(NiMKernelServiceVisa visa)
          Default constructor.
 
Method Summary
abstract  java.util.List<Application> getApplications(java.util.List<java.lang.String> appIDs, Entity user)
          Getting a list of application object based on the provided appIDs.
protected  boolean getBooleanPropertyWithDefault(java.lang.String confKey, boolean defValue)
          Retrieve a boolean property from the system configuration (with default value).
abstract  Brand getBrand(NimletInput input, Entity user)
          Returns a brand object for this user.
abstract  Brand getDomainBrand(java.lang.String domain)
          Get a brand object for a given domain without relying on input or an authenticated entity.
protected  long getLongProperty(java.lang.String confKey, boolean checkMin, long minValue)
          Retrieve a Long property from the system configuration.
protected  long getLongPropertyWithDefault(java.lang.String confKey, boolean checkMin, long minValue, long defValue)
          Retrieve a long property from the system configuration (with default value).
abstract  java.lang.String getMessage(java.lang.String domainID, java.lang.String brandID, java.lang.String msgID, java.lang.String locale, java.lang.Object... msgParams)
          Translates a message to given locale based on the brand's dictionary
protected  java.lang.String getStringProperty(java.lang.String confKey)
          Retrieve a String property from the system configuration.
protected  java.lang.String getStringPropertyWithDefault(java.lang.String confKey, java.lang.String defValue)
          Retrieve a String property from the system configuration (with default value).
abstract  Brand getSystemDefaultBrand()
          Getting the system default brand.
abstract  java.lang.String getSystemDefaultLocale()
          Getting the system default locale string.
protected  void init(NiMKernel kernel, ConfigurationService confService)
          This method is used to initialize the kernel service.
protected  java.util.Map<java.lang.String,java.lang.String> loadLocaleMap()
           
protected  java.util.List<java.lang.String> loadSysDefaultApps()
          Loads a list of system default application IDs from the NiM configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_confService

protected ConfigurationService _confService
Reference to the configuration service

Constructor Detail

BrandService

public BrandService(NiMKernelServiceVisa visa)
Default constructor.

Parameters:
visa - kernel service visa
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 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.

getBrand

public abstract Brand getBrand(NimletInput input,
                               Entity user)
Returns a brand object for this user. The brand is determined based on the domain of the request and the active brand ID from the user space. Depending on the values of those properties a brand object is constructed for the user. If both the domain and active brand are valid then that brand is returned. If the domain is not valid then the system default Brand is returned. If the active brand is not valid then an attempt is made to retrieve the default brand for the domain. The Brand object also contains a list of applications that are configured for the brand.

Parameters:
user - the current user
input - the current request's nimlet input object. If this brand object is required for an unauthenticated entity it may be left null.
Returns:
the Brand object

getDomainBrand

public abstract Brand getDomainBrand(java.lang.String domain)
Get a brand object for a given domain without relying on input or an authenticated entity.

Parameters:
domain - domain whose default brand is to be retrieved
Returns:
the default brand for a given domain, or the system default brand if the domain was not found

getMessage

public abstract java.lang.String getMessage(java.lang.String domainID,
                                            java.lang.String brandID,
                                            java.lang.String msgID,
                                            java.lang.String locale,
                                            java.lang.Object... msgParams)
Translates a message to given locale based on the brand's dictionary

Parameters:
domainID - the requesting user's domainID (used for fail over for
brandID - the ID of the brand (this brand's dictionary will be used to retrieve the message) the error message)
msgID - the ID of the message
locale - the locale for which to retrieve this message
msgParams - variable argument which can take an array of objects, or 1 or more objects, or not be supplied at all
Returns:
the text of the message in the specified locale

getSystemDefaultBrand

public abstract Brand getSystemDefaultBrand()
Getting the system default brand. This method is called by NiM.getSystemDefaultBrand().


getApplications

public abstract java.util.List<Application> getApplications(java.util.List<java.lang.String> appIDs,
                                                            Entity user)
Getting a list of application object based on the provided appIDs.

Parameters:
appIDs - the list of application IDs to be retrieved. If this parameter is null, the method should use the system default application ID list instead.
user - the User's entity object. It is used to populate the user specific preference for each application. If this parameter is null, the method should use the system default preference for the application.

getSystemDefaultLocale

public abstract java.lang.String getSystemDefaultLocale()
Getting the system default locale string. This method should return a character string that represent the locale as defined in ISO 639. This string is usually a 2 character string.


getStringProperty

protected java.lang.String getStringProperty(java.lang.String confKey)
                                      throws InitializationFailedException
Retrieve a String property from the system configuration.

Parameters:
confKey - the key for the property
Returns:
the value of the property for the given key
Throws:
InitializationFailedException - if a property value for the provided key was not found

getLongProperty

protected long getLongProperty(java.lang.String confKey,
                               boolean checkMin,
                               long minValue)
                        throws InitializationFailedException
Retrieve a Long property from the system configuration.

Parameters:
confKey - the key for the property
checkMin - boolean flag to indicate whether to check for the minimum value of a valid value.
minValue - the minimum value of a valid value.
Returns:
the value of the property parsed as a Long
Throws:
InitializationFailedException - if the property value for the provided key was not found or is not a valid Long

getBooleanPropertyWithDefault

protected boolean getBooleanPropertyWithDefault(java.lang.String confKey,
                                                boolean defValue)
Retrieve a boolean property from the system configuration (with default value). It return the default value if the specified configuration is not defined or the value is invalid.

Parameters:
confKey - the key for the property
defValue - the default value
Returns:
the value of the property for the given key
Throws:
InitializationFailedException - if a property value for the provided key was not found

getStringPropertyWithDefault

protected java.lang.String getStringPropertyWithDefault(java.lang.String confKey,
                                                        java.lang.String defValue)
Retrieve a String property from the system configuration (with default value). It return the default value if the specified configuration is not defined or the value is invalid.

Parameters:
confKey - the key for the property
defValue - the default value
Returns:
the value of the property for the given key
Throws:
InitializationFailedException - if a property value for the provided key was not found

getLongPropertyWithDefault

protected long getLongPropertyWithDefault(java.lang.String confKey,
                                          boolean checkMin,
                                          long minValue,
                                          long defValue)
Retrieve a long property from the system configuration (with default value). It return the default value if the specified configuration is not defined or the value is invalid.

Parameters:
confKey - the key for the property.
checkMin - boolean flag to indicate whether to check for the minimum value of a valid value.
minValue - the minimum value of a valid value.
defValue - the default value
Returns:
the value of the property for the given key
Throws:
InitializationFailedException - if a property value for the provided key was not found

loadSysDefaultApps

protected java.util.List<java.lang.String> loadSysDefaultApps()
Loads a list of system default application IDs from the NiM configuration.

Returns:
list of system default application IDs.

loadLocaleMap

protected java.util.Map<java.lang.String,java.lang.String> loadLocaleMap()

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.