Class Misc


  • public class Misc
    extends Object
    The Misc class contains various misc methods :)
    • Constructor Detail

      • Misc

        public Misc()
    • Method Detail

      • getMapAttr

        public static String getMapAttr​(Map m,
                                        String name)
        Deprecated.
        This method is a convenience to get a single attribute from a Map returned by SMS and the dpro SDK. SDK returns a Map with a tuple of attribute name and a Set for the values. When all you want is a string this method is nice.
      • getIntMapAttr

        public static int getIntMapAttr​(Map m,
                                        String name,
                                        String defaultValue,
                                        Debug debug)
                                 throws NumberFormatException
        Deprecated.
        As of OpenSSO version 8.0 com.sun.identity.shared.datastruct.CollectionHelper#getIntMapAttr(Map, String, String, Debug)
        This method is a convenience to get a single int value from a Map returned by SMS and the dpro SDK. This method picks up the first value (String) of the attribute, and returns the int value of the string. If there is no value for the attribute, or the first value could not be parsed as a valid integer, returns the default value as an integer.
        Parameters:
        m - Map, key is attribute name, value is String Set which contains all the values for the attribute
        name - Attribute name
        defaultValue - default value for the attribute
        debug - Debug
        Returns:
        int value
        Throws:
        NumberFormatException - when fails to parse the defaultValue argument as a signed decimal integer for return
      • getIntMapAttr

        public static int getIntMapAttr​(Map m,
                                        String name,
                                        int defaultValue,
                                        Debug debug)
        Deprecated.
        This method is a convenience to get a single int value from a Map returned by SMS and the dpro SDK. This method picks up the first value (String) of the attribute, and returns the int value of the string. If there is no value for the attribute, or the first value could not be parsed as a valid integer, returns the default value as an integer.
        Parameters:
        m - Map, key is attribute name, value is String Set which contains all the values for the attribute
        name - Attribute name
        defaultValue - default value for the attribute
        debug - Debug
        Returns:
        int value
      • getServerMapAttr

        public static String getServerMapAttr​(Map m,
                                              String attrName)
        Deprecated.
        This convenience method is for getting server specific attributes from a list attribute. Server specific is determined by prefixing a list attribute value with DSAME local server name followed by the | character. If the list has more than one entry but no matching local server prefixes than null is returned as this is an invalid configuration for these type of attributes. This allows services like authentication to support a geographic directory configuration.
      • canonicalize

        public static String canonicalize​(String dn)
        Returns a canonicalized form of the DN String
        Parameters:
        dn - String representing a DN.
        Returns:
        a canonicalized form of the DN String