Nitido Inc.

com.nitido.nim
Class Brand

java.lang.Object
  extended by com.nitido.nim.Brand
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BrandImpl

public abstract class Brand
extends java.lang.Object
implements java.io.Serializable

This is the data object for a brand in the multi-tenant environment. It is introduced to support the BrandService.

This object is designed to be non-changable once it has been instantiated. User should NOT modify the collection objects returned by the methods of this class, such as the Map object returned by the getAvailableLocales(). It is because these collection objects are the actual reference used by this object. They are not cloned copies. (We did not clone them in order to reduce the memory requirement).

As long as the user never modified the maps returned from getAvailableLocales(), this object is thread safe.

See Also:
Application, Domain, Serialized Form

Field Summary
protected  java.util.List<Application> _apps
          A list of applications configured for this brand for this person.
protected  java.util.Map<java.lang.String,java.lang.String> _availLocales
          Locales supported by this brand.
protected  java.lang.String _brandID
          The ID of this brand.
protected  java.lang.String _defaultLocale
          The default locale to be used for this brand.
protected  java.lang.String _domainID
          The ID of the requesting domain.
protected  boolean _isSystemDefault
          Boolean flag to indicate whether this object is a system default brand.
protected  java.util.Map<java.lang.String,java.lang.String> _properties
          Brand properties for this brand.
protected  java.lang.String _userLocale
          The user's current locale.
 
Constructor Summary
Brand(boolean isSystemDefault, java.lang.String brandID, java.lang.String domainID, java.lang.String defaultLocale, java.util.Map<java.lang.String,java.lang.String> availLocales, java.util.Map<java.lang.String,java.lang.String> properties, java.util.List<Application> apps, java.lang.String locale)
          Default constructor of the Brand object.
 
Method Summary
 Application getApplication(java.lang.String appName)
          Get an application.
 java.util.List<Application> getApplications()
          Get the list of applications configured for this brand.
 java.util.Map<java.lang.String,java.lang.String> getAvailableLocales()
           
 java.lang.String getBrandID()
          Get the ID of this brand.
 java.lang.String getDefaultLocale()
           
 java.lang.String getDomainID()
          Get the ID of the requesting user's domain.
abstract  java.lang.String getFilePath(java.lang.String path)
           
abstract  java.lang.String getLocale()
           
 java.lang.String getMessage(java.lang.String msgID, java.lang.String locale, java.lang.Object... msgParam)
          This method returns the value associated to the given msgID for the given locale.
 java.lang.String getProperty(java.lang.String propName)
           
 java.util.Set<java.lang.String> getPropertyKeys()
           
 boolean isSystemDefault()
           
 java.lang.String toString()
          Get the string representation of this object (mainly for debug).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_properties

protected final java.util.Map<java.lang.String,java.lang.String> _properties
Brand properties for this brand. The mapping is PropertyKey -> PropertyValue


_availLocales

protected final java.util.Map<java.lang.String,java.lang.String> _availLocales
Locales supported by this brand. The mapping is LocaleCode -> display name The LocaleCode should be ISO639 format. However, most of our applications have been tested with the ISO 639-1 (2 character) format only.


_defaultLocale

protected final java.lang.String _defaultLocale
The default locale to be used for this brand. This is usually determined by the BrandService when constructing this Brand object. This default brand may not be really specified by the corresponding Brand entry in the backend. Instead, it is usually specified by the Domain that the user was requesting, or simply the system default.


_brandID

protected final java.lang.String _brandID
The ID of this brand.


_domainID

protected final java.lang.String _domainID
The ID of the requesting domain.


_apps

protected final java.util.List<Application> _apps
A list of applications configured for this brand for this person.


_isSystemDefault

protected final boolean _isSystemDefault
Boolean flag to indicate whether this object is a system default brand.


_userLocale

protected final java.lang.String _userLocale
The user's current locale. This is specified by the brand service when instantiating this object.

Constructor Detail

Brand

public Brand(boolean isSystemDefault,
             java.lang.String brandID,
             java.lang.String domainID,
             java.lang.String defaultLocale,
             java.util.Map<java.lang.String,java.lang.String> availLocales,
             java.util.Map<java.lang.String,java.lang.String> properties,
             java.util.List<Application> apps,
             java.lang.String locale)
Default constructor of the Brand object.

Parameters:
isSystemDefault - boolean flag that indicates this is a system default brand.
brandID - the brand ID string.
domainID - the domain ID string.
defaultLocale - the default locale of this brand
availLocales - A Map of locale code to "locale display name". The locale code should be the ISO 639 format.
properties - A Map of property key to property value. Both the key and value are String objects.
apps - A list of Application objects
locale -
Method Detail

getBrandID

public java.lang.String getBrandID()
Get the ID of this brand.

Returns:
the ID of the brand

getDomainID

public java.lang.String getDomainID()
Get the ID of the requesting user's domain.

Returns:
the ID of the Domain

isSystemDefault

public boolean isSystemDefault()

getApplications

public java.util.List<Application> getApplications()
Get the list of applications configured for this brand.

Returns:
list of applications

getApplication

public Application getApplication(java.lang.String appName)
Get an application.

Parameters:
appName - the name of the application
Returns:
the application object if an app with the provided name is part of the list of apps that are configured for this brand, returns null if it is not found in the list

getMessage

public java.lang.String getMessage(java.lang.String msgID,
                                   java.lang.String locale,
                                   java.lang.Object... msgParam)
This method returns the value associated to the given msgID for the given locale. If no message exists for the given msgID or locale this operation must return null.

Parameters:
msgID - Reference to the message that needs to be translated.
locale - Defines the language of the message.
Returns:
The message in the given language or null if the message is not available in the dictionary.

getFilePath

public abstract java.lang.String getFilePath(java.lang.String path)
Parameters:
path -
Returns:
file path string

getProperty

public java.lang.String getProperty(java.lang.String propName)
Parameters:
propName -
Returns:
property value

getPropertyKeys

public java.util.Set<java.lang.String> getPropertyKeys()
Returns:
Set of property keys

getAvailableLocales

public java.util.Map<java.lang.String,java.lang.String> getAvailableLocales()
Returns:
Map of available locale

getDefaultLocale

public java.lang.String getDefaultLocale()
Returns:
default locale ID

getLocale

public abstract java.lang.String getLocale()

toString

public java.lang.String toString()
Get the string representation of this object (mainly for debug).

Overrides:
toString in class java.lang.Object

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.