Package com.sun.identity.common
Class ISResourceBundle
- java.lang.Object
-
- java.util.ResourceBundle
-
- java.util.ListResourceBundle
-
- com.sun.identity.common.ISResourceBundle
-
public class ISResourceBundle extends ListResourceBundle
This class provides static utility methods to be used by console and Access Manager admin * CLI for storing, retrieving and deleting locale-specific resource bundles in the directory (data store)This class is a subclass of
java.util.ListResourceBundle
. The method (shown below) returns an instance of ISResourceBundle, which can be used to obtain the key and values as any other ResourceBundle.ResourceBundle rb = ISResourceBundle.getBundle(token, "test", "en_US");
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.ResourceBundle
ResourceBundle.Control
-
-
Field Summary
Fields Modifier and Type Field Description static ResourceBundle
_bundle
-
Fields inherited from class java.util.ResourceBundle
parent
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ISResourceBundle(Map keyValues)
Non-default construtor used to create a new ISResourceBundle object This constructor takes a Map of key-value pairs (both Strings) and uses that Map to construct an ISResourceBundle object
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
deleteResourceBundle(SSOToken token, String rbName, String locale)
Deletes the specified ResourceBundle from the directory.protected Object[][]
getContents()
static ResourceBundle
getResourceBundle(SSOToken token, String rbName, String locale)
Returns a ResourceBundle.static ResourceBundle
getResourceBundle(SSOToken token, String rbName, Locale locale)
Returns a ResourceBundle.static void
storeResourceBundle(SSOToken token, String rbName, String locale, Map attributes)
Stores or creates the ResourceBundle in the directory.-
Methods inherited from class java.util.ListResourceBundle
getKeys, handleGetObject, handleKeySet
-
Methods inherited from class java.util.ResourceBundle
clearCache, clearCache, containsKey, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, keySet, setParent
-
-
-
-
Field Detail
-
_bundle
public static ResourceBundle _bundle
-
-
Constructor Detail
-
ISResourceBundle
protected ISResourceBundle(Map keyValues)
Non-default construtor used to create a new ISResourceBundle object This constructor takes a Map of key-value pairs (both Strings) and uses that Map to construct an ISResourceBundle object- Parameters:
keyValues
- Map of key-value pairs.
-
-
Method Detail
-
getResourceBundle
public static ResourceBundle getResourceBundle(SSOToken token, String rbName, Locale locale) throws SSOException
Returns a ResourceBundle. This method tries to find a ResourceBundle given locale usingjava.util.ResourceManager
first. But if it doesn't find the ResourceBundle in the local file system, then look for it in the directory (data store). In the directory, it follows the same protocol as the default ResourceManager. It looks for the specific locale first (language and country) and if not found than language locale, and if that is not found then the default locale.- Parameters:
token
- Single sign-on token of the userrbName
- Name of the ResourceBundlelocale
- Specific locale of ResourceBundle- Returns:
- ResourceBundle with the key-value pairs.
- Throws:
SSOException
-
getResourceBundle
public static ResourceBundle getResourceBundle(SSOToken token, String rbName, String locale) throws SSOException
Returns a ResourceBundle. This method tries to find a ResourceBundle given locale usingjava.util.ResourceManager
first. But if it doesn't find the ResourceBundle in the local file system, then look for it in the directory (data store). In the directory, it follows the same protocol as the default ResourceManager. It looks for the specific locale first (language and country) and if not found than language locale, and if that is not found then the default locale.- Parameters:
token
- Single sign-on token of the userrbName
- Name of the ResourceBundlelocale
- String identifying the language and country (for example: en_US). If this is null, then the default ResourceBundle is returned.- Returns:
- ISResourceBundle
- Throws:
SSOException
- If user does not have read access to read the ResourceBundles from directory.
-
deleteResourceBundle
public static void deleteResourceBundle(SSOToken token, String rbName, String locale) throws SMSException, SSOException
Deletes the specified ResourceBundle from the directory.- Parameters:
token
- Single sign-on token of userrbName
- Name of ResourceBundlelocale
- String defining the locale. If null, then all the locales of this ResourceBundle, including the default one, are deleted.- Throws:
SMSException
- If there is an error trying to modify the datastoreSSOException
- If this user's token has expired.
-
storeResourceBundle
public static void storeResourceBundle(SSOToken token, String rbName, String locale, Map attributes) throws SMSException, SSOException
Stores or creates the ResourceBundle in the directory.- Parameters:
token
- Single sign-on token of userrbName
- Name of ResourceBundlelocale
- Locale of ResourceBundle. If null, the default ResourceBundle is updated.attributes
- Map of key-value pairs defining the ResourceBundle.- Throws:
SMSException
- If there is an error trying to modify the datastoreSSOException
- If this user's token has expired.
-
getContents
protected Object[][] getContents()
- Specified by:
getContents
in classListResourceBundle
-
-