Class IDPPUtils


  • public class IDPPUtils
    extends Object
    Class IDPPUtils is utility class used by IDPP service for any common functionality in various modules.
    • Constructor Detail

      • IDPPUtils

        public IDPPUtils()
    • Method Detail

      • createQueryElement

        public static com.sun.identity.liberty.ws.idpp.jaxb.QueryElement createQueryElement​(List queryExpressions,
                                                                                            String resourceID,
                                                                                            boolean includeCommonAttr)
                                                                                     throws JAXBException,
                                                                                            IDPPException
        Creates a Query Request element given a set of query expressions.
        Parameters:
        queryExpressions - a list of query expressions
        resourceID - resource id.
        includeCommonAttr - include common attribute or not
        Returns:
        QueryElement JAXB object.
        Throws:
        JAXBException
        IDPPException
      • getQueryDataElements

        public static List getQueryDataElements​(com.sun.identity.liberty.ws.idpp.jaxb.QueryResponseElement response)
                                         throws JAXBException,
                                                IDPPException
        Gets the data element given a Query Response.
        Parameters:
        response - QueryResponseElement
        Returns:
        List of data elements.
        Throws:
        JAXBException
        IDPPException
      • createResourceIDElement

        public static com.sun.identity.liberty.ws.idpp.jaxb.ResourceIDElement createResourceIDElement​(String resourceID)
                                                                                               throws JAXBException,
                                                                                                      IDPPException
        Creates Discovery resource id type.
        Parameters:
        resourceID - resource id string.
        Returns:
        ResourceIDType JAXB object.
        Throws:
        JAXBException
        IDPPException
      • getExpressionContext

        public static String getExpressionContext​(String select)
        Looks for the expression context. For e.g. if the expression is /idpp:IDPP/idpp:IDPPCommonName/idpp:AnalyzedName/idpp:FN, then it one returns "FN".
        Parameters:
        select - string.
        Returns:
        context string.
      • getUserAttributes

        public static Map getUserAttributes​(String userDN,
                                            Set requiredSet)
                                     throws IDPPException
        Returns the user attribute values.
        Parameters:
        userDN - user DN.
        requiredSet - a set of required attributes.
        Returns:
        user attribute value map.
        Throws:
        IDPPException
      • setUserAttributes

        public static void setUserAttributes​(String userDN,
                                             Map map)
                                      throws IDPPException
        Stores the user attribute values in the data store.
        Parameters:
        userDN - user DN
        map - user attribute value map
        Throws:
        IDPPException
      • checkForUserAttributes

        public static boolean checkForUserAttributes​(String userDN,
                                                     Set set)
                                              throws IDPPException
        Checks for if the user attribute values exist for a given set.
        Parameters:
        userDN - user DN.
        set - a set of user attributes that require check.
        Returns:
        true if any of the user attibute values found.
        Throws:
        IDPPException
      • getIDPPElementType

        public static int getIDPPElementType​(String element)
        Returns element type.
        Parameters:
        element - a String representing an Element.
        Returns:
        integer value of the element.
      • isUserExists

        public static boolean isUserExists​(String userDN)
        Checks is the user exists or not.
        Parameters:
        userDN - user DN
        Returns:
        true if the user exists.
      • getIDPPFactory

        public static com.sun.identity.liberty.ws.idpp.jaxb.ObjectFactory getIDPPFactory()
        Gets the IDPPFactory JAXB Object.
        Returns:
        ObjectFactory JAXB IDPP Factory Object.
      • getDocumentBuilder

        public static DocumentBuilder getDocumentBuilder()
        Gets the document builder.
        Returns:
        DocumentBuilder dom document builder
      • getResourceExpression

        public static String getResourceExpression​(String select)
        Returns the resource expression from the select xpath expression.
        Parameters:
        select - Xpath select expression.
        Returns:
        String resource expression
      • getResourceID

        public static String getResourceID​(String userID)
        Gets the resource id for a given user id
        Parameters:
        userID - ID of a user
        Returns:
        String Resource ID