Package com.iplanet.services.cdm
Class G11NSettings
- java.lang.Object
-
- com.iplanet.services.cdm.G11NSettings
-
- All Implemented Interfaces:
AMClientDataListener
,ServiceListener
public class G11NSettings extends Object implements ServiceListener, AMClientDataListener
G11NSettings service identifies the list of valid charsets to be used for any given locale.It is a helper class to identify suitable charset to be used for a client. Client will provide supported charsets using CcppAccept-Charset attribute and this class has methods such as getCharset() to parse the parameter and locate a charset suitable for a given client for a locale
-
-
Field Summary
Fields Modifier and Type Field Description static String
CDM_ACCEPT_CHARSET
static String
CDM_DEFAULT_CHARSET
static String
CDM_DEFAULT_CLIENT_TYPE
static String
CDM_DEFAULT_CONTENT_TYPE
Default content type for unidentified client type.static String
CHARSET_ALIAS_ATTR
static String
DEFAULT_CHARSET_PROPERTY
static String
G11N_SETTINGS_SERVICE_NAME
static String
JAVA_CHARSET_NAME
static String
LOCALE_CHARSET_ATTR
-
Fields inherited from interface com.sun.identity.sm.ServiceListener
ADDED, MODIFIED, REMOVED
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clientChanged(String clientType, int dbType, int opType)
Called when a client-type data gets changed.String
getCharset(String clientType, Locale loc)
Map
getCharsetAliasTable(String mimeCharset)
List
getCharsetForLocale(String loc)
String
getDefaultCharsetForLocale(Locale loc)
static G11NSettings
getInstance()
String
getJavaCharset(String mimeCharset)
void
globalConfigChanged(String serviceName, String version, String groupName, String serviceComponent, int type)
This method will be invoked when a service's global configuration data has been changed.void
organizationConfigChanged(String serviceName, String version, String orgName, String groupName, String serviceComponent, int type)
This method will be invoked when a service's organization configuration data has been changed.void
schemaChanged(String serviceName, String version)
This method will be invoked when a service's schema has been changed.
-
-
-
Field Detail
-
G11N_SETTINGS_SERVICE_NAME
public static final String G11N_SETTINGS_SERVICE_NAME
- See Also:
- Constant Field Values
-
LOCALE_CHARSET_ATTR
public static final String LOCALE_CHARSET_ATTR
- See Also:
- Constant Field Values
-
CHARSET_ALIAS_ATTR
public static final String CHARSET_ALIAS_ATTR
- See Also:
- Constant Field Values
-
JAVA_CHARSET_NAME
public static final String JAVA_CHARSET_NAME
- See Also:
- Constant Field Values
-
CDM_ACCEPT_CHARSET
public static final String CDM_ACCEPT_CHARSET
- See Also:
- Constant Field Values
-
DEFAULT_CHARSET_PROPERTY
public static final String DEFAULT_CHARSET_PROPERTY
- See Also:
- Constant Field Values
-
CDM_DEFAULT_CHARSET
public static final String CDM_DEFAULT_CHARSET
-
CDM_DEFAULT_CLIENT_TYPE
public static final String CDM_DEFAULT_CLIENT_TYPE
- See Also:
- Constant Field Values
-
CDM_DEFAULT_CONTENT_TYPE
public static final String CDM_DEFAULT_CONTENT_TYPE
Default content type for unidentified client type.- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static G11NSettings getInstance()
- Returns:
- unique instance of G11NSettings Object Gets singletion instance of G11NSettings Reads the G11NSettings Service and find out charsets applicable for a given locale.
-
getDefaultCharsetForLocale
public String getDefaultCharsetForLocale(Locale loc)
- Returns:
- preferred charset to be used for the locale It uses fall back mechanism by dropping variant, country to find suitable charset.
-
getCharsetForLocale
public List getCharsetForLocale(String loc)
- Parameters:
loc
- locale such as en, en_US- Returns:
- list of charsets supported by a locale
-
getCharsetAliasTable
public Map getCharsetAliasTable(String mimeCharset)
- Parameters:
mimeCharset
-- Returns:
- a Map which can provide equivalent charset names. Currently, OpenAM uses only Java name; however an application can be configured to have different names for platform level mapping etc.
-
getJavaCharset
public String getJavaCharset(String mimeCharset)
- Parameters:
mimeCharset
-- Returns:
- charset name used in Java. If there is no such mapping, same mimecharset is returned
-
schemaChanged
public void schemaChanged(String serviceName, String version)
Description copied from interface:ServiceListener
This method will be invoked when a service's schema has been changed.- Specified by:
schemaChanged
in interfaceServiceListener
- Parameters:
serviceName
- name of the serviceversion
- version of the service
-
globalConfigChanged
public void globalConfigChanged(String serviceName, String version, String groupName, String serviceComponent, int type)
Description copied from interface:ServiceListener
This method will be invoked when a service's global configuration data has been changed. The parametergroupName
denote the name of the configuration grouping (e.g. default) andserviceComponent
denotes the service's sub-component that changed (e.g./NamedPolicy
,/Templates
).- Specified by:
globalConfigChanged
in interfaceServiceListener
- Parameters:
serviceName
- name of the service.version
- version of the service.groupName
- name of the configuration grouping.serviceComponent
- name of the service components that changed.type
- change type, i.e., ADDED, REMOVED or MODIFIED.
-
organizationConfigChanged
public void organizationConfigChanged(String serviceName, String version, String orgName, String groupName, String serviceComponent, int type)
Description copied from interface:ServiceListener
This method will be invoked when a service's organization configuration data has been changed. The parametersorgName
,groupName
andserviceComponent
denotes the organization name, configuration grouping name and service's sub-component that are changed respectively.- Specified by:
organizationConfigChanged
in interfaceServiceListener
- Parameters:
serviceName
- name of the serviceversion
- version of the serviceorgName
- organization name as DNgroupName
- name of the configuration groupingserviceComponent
- the name of the service components that changedtype
- change type, i.e., ADDED, REMOVED or MODIFIED
-
getCharset
public String getCharset(String clientType, Locale loc) throws ClientException
- Parameters:
clientType
- Client type identified by CDM moduleloc
- Locale such as en_US This method computes the characterset to be used for any given clientType It uses Ccpp-Accept-Charset of the ClientType and picks appropriate charset for any given locale. CcppAccept-Charset list may have Q factor to weigh the client preference of the charset- Returns:
- string Charset to be used for the given locale
- Throws:
ClientException
-
clientChanged
public void clientChanged(String clientType, int dbType, int opType)
Description copied from interface:AMClientDataListener
Called when a client-type data gets changed.- Specified by:
clientChanged
in interfaceAMClientDataListener
- Parameters:
clientType
- The clientType that changed.dbType
- The database that contained the clientType AMClientCapData.INTERNAL or AMClientCapData.EXTERNAL.opType
- The type of the change - AMClientCapData.ADDED OR AMClientCapData.REMOVED OR AMClientCapData.MODIFIED
-
-