public class OAuthUtils extends Object
| Constructor and Description |
|---|
OAuthUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
append401HTTPSC(MessageContext synCtx)
Method to append 401 status code to NON_ERROR_HTTP_STATUS_CODES property.
|
static org.apache.axiom.om.OMElement |
createOMElementWithValue(org.apache.axiom.om.OMFactory omFactory,
String elementName,
String elementValue)
This method returns an OMElement containing the elementValue encapsulated by the elementName.
|
static org.apache.axiom.om.OMElement |
createOMRequestParams(org.apache.axiom.om.OMFactory omFactory,
Map<String,String> requestParametersMap)
Create an OMElement for request parameter map.
|
static String |
getChildValue(org.apache.axiom.om.OMElement parentElement,
String childName)
Method to get the value inside a child element.
|
static String |
getRandomOAuthHandlerID()
Method to generate a random id for each OAuth handler.
|
static OAuthHandler |
getSpecificOAuthHandler(org.apache.axiom.om.OMElement oauthElement)
This method will return an OAuthHandler instance depending on the oauth configs.
|
static String |
resolveExpression(String value,
MessageContext messageContext)
This method evaluate the value as an expression or return the value.
|
static boolean |
retryOnOAuthFailure(OAuthConfiguredHTTPEndpoint httpEndpoint,
MessageContext synapseInMsgCtx,
MessageContext synapseOutMsgCtx)
Method to check whether retry is needed.
|
public static OAuthHandler getSpecificOAuthHandler(org.apache.axiom.om.OMElement oauthElement)
oauthElement - Element containing OAuth configspublic static String getChildValue(org.apache.axiom.om.OMElement parentElement, String childName)
parentElement - Parent OMElementchildName - name of the childpublic static String getRandomOAuthHandlerID()
public static boolean retryOnOAuthFailure(OAuthConfiguredHTTPEndpoint httpEndpoint, MessageContext synapseInMsgCtx, MessageContext synapseOutMsgCtx)
httpEndpoint - OAuth Configured HTTP Endpoint related to the message contextsynapseInMsgCtx - MessageContext that has been receivedsynapseOutMsgCtx - Corresponding outgoing Synapse MessageContext for the above received MessageContextpublic static String resolveExpression(String value, MessageContext messageContext) throws AuthException
value - String parameter valuemessageContext - MessageContext of the requestAuthExceptionpublic static void append401HTTPSC(MessageContext synCtx)
synCtx - MessageContext of the requestpublic static org.apache.axiom.om.OMElement createOMElementWithValue(org.apache.axiom.om.OMFactory omFactory,
String elementName,
String elementValue)
elementName - Name of the OMElementelementValue - Value of the OMElementpublic static org.apache.axiom.om.OMElement createOMRequestParams(org.apache.axiom.om.OMFactory omFactory,
Map<String,String> requestParametersMap)
requestParametersMap - input parameter map.Copyright © 2005–2024 Apache Software Foundation. All rights reserved.