Class COTUtils


  • public class COTUtils
    extends Object
    This class contains circle of trust utilities.
    • Constructor Detail

      • COTUtils

        public COTUtils()
        Default Constructor.
    • Method Detail

      • getFirstEntry

        public static String getFirstEntry​(Map attrMap,
                                           String key)
        Get the first value of set by given key searching in the given map. return null if attrMap is null or key is null.
        Parameters:
        attrMap - Map of attributes name and their values in the circle of trust service. The key is the attribute name and the value is a Set.
        key - the attribute name to be retrieved.
        Returns:
        the first value of the attribute in the value set.
      • fillEntriesInSet

        public static void fillEntriesInSet​(Map attrMap,
                                            String key,
                                            String value)
        Adds a set of a given value to a map. Set will not be added if attrMap is null or value is null or key is null.
        Parameters:
        attrMap - Map of which set is to be added.
        key - Key of the entry to be added.
        value - Value to be added to the Set.
      • isValidProtocolType

        public static boolean isValidProtocolType​(String protocolType)
        Checks if the federation protocol type is valid. The valid values are IDFF or SAML2.
        Parameters:
        protocolType - the federation protocol type.
        Returns:
        true if value is idff or saml2.
      • findProtocolsForEntity

        public static Set findProtocolsForEntity​(String entityId,
                                                 String realm)
        Returns set of protocol the entity supports.
        Parameters:
        entityId - The ID of the entity to be checked.
        realm - the realm in which the entity resides.
        Returns:
        Set of protocol the entity supports, values could be COTConstants.SAML2, COTConstants.IDFF or COTConstants.WS_FED.