Class IDPPUtils
- java.lang.Object
-
- com.sun.identity.liberty.ws.idpp.common.IDPPUtils
-
public class IDPPUtils extends Object
ClassIDPPUtilsis utility class used by IDPP service for any common functionality in various modules.
-
-
Field Summary
Fields Modifier and Type Field Description static ResourceBundlebundlestatic Debugdebugstatic HashMapidppIDSMap
-
Constructor Summary
Constructors Constructor Description IDPPUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancheckForUserAttributes(String userDN, Set set)Checks for if the user attribute values exist for a given set.static com.sun.identity.liberty.ws.idpp.jaxb.QueryElementcreateQueryElement(List queryExpressions, String resourceID, boolean includeCommonAttr)Creates a Query Request element given a set of query expressions.static com.sun.identity.liberty.ws.idpp.jaxb.ResourceIDElementcreateResourceIDElement(String resourceID)Creates Discovery resource id type.static DocumentBuildergetDocumentBuilder()Gets the document builder.static StringgetExpressionContext(String select)Looks for the expression context.static intgetIDPPElementType(String element)Returns element type.static com.sun.identity.liberty.ws.idpp.jaxb.ObjectFactorygetIDPPFactory()Gets the IDPPFactory JAXB Object.static MarshallergetMarshaller()Gets the marshallerstatic ListgetQueryDataElements(com.sun.identity.liberty.ws.idpp.jaxb.QueryResponseElement response)Gets the data element given a Query Response.static StringgetResourceExpression(String select)Returns the resource expression from the select xpath expression.static StringgetResourceID(String userID)Gets the resource id for a given user idstatic UnmarshallergetUnmarshaller()Get the unmarshaller object.static MapgetUserAttributes(String userDN, Set requiredSet)Returns the user attribute values.static booleanisUserExists(String userDN)Checks is the user exists or not.static voidsetUserAttributes(String userDN, Map map)Stores the user attribute values in the data store.
-
-
-
Field Detail
-
debug
public static Debug debug
-
bundle
public static ResourceBundle bundle
-
idppIDSMap
public static HashMap idppIDSMap
-
-
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 expressionsresourceID- resource id.includeCommonAttr- include common attribute or not- Returns:
- QueryElement JAXB object.
- Throws:
JAXBExceptionIDPPException
-
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:
JAXBExceptionIDPPException
-
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:
JAXBExceptionIDPPException
-
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 DNmap- 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.
-
getMarshaller
public static Marshaller getMarshaller() throws JAXBException
Gets the marshaller- Returns:
- Marshaller JAXB Marshaller Object.
- Throws:
JAXBException
-
getUnmarshaller
public static Unmarshaller getUnmarshaller() throws JAXBException
Get the unmarshaller object.- Returns:
- Unmarshaller JAXB unmarshaller object.
- Throws:
JAXBException
-
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
-
-