Class 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");
     
     
    • 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 using java.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 user
        rbName - Name of the ResourceBundle
        locale - 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 using java.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 user
        rbName - Name of the ResourceBundle
        locale - 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 user
        rbName - Name of ResourceBundle
        locale - 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 datastore
        SSOException - 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 user
        rbName - Name of ResourceBundle
        locale - 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 datastore
        SSOException - If this user's token has expired.