public class OAuthUtils
extends java.lang.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,
java.lang.String elementName,
java.lang.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,
java.util.Map<java.lang.String,java.lang.String> requestParametersMap)
Create an OMElement for request parameter map.
|
static OAuthHandler |
getOAuthHandler(org.apache.axiom.om.OMElement httpElement)
This method will return an OAuthHandler instance depending on the oauth configs.
|
static java.lang.String |
getRandomOAuthHandlerID()
Method to generate a random id for each OAuth handler.
|
static java.lang.String |
resolveExpression(java.lang.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 getOAuthHandler(org.apache.axiom.om.OMElement httpElement) throws OAuthException
httpElement
- Element containing http configsOAuthException
- throw exception for invalid oauth configspublic static java.lang.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 java.lang.String resolveExpression(java.lang.String value, MessageContext messageContext) throws OAuthException
value
- String parameter valuemessageContext
- MessageContext of the requestOAuthException
public static void append401HTTPSC(MessageContext synCtx)
synCtx
- MessageContext of the requestpublic static org.apache.axiom.om.OMElement createOMElementWithValue(org.apache.axiom.om.OMFactory omFactory, java.lang.String elementName, java.lang.String elementValue)
elementName
- Name of the OMElementelementValue
- Value of the OMElementpublic static org.apache.axiom.om.OMElement createOMRequestParams(org.apache.axiom.om.OMFactory omFactory, java.util.Map<java.lang.String,java.lang.String> requestParametersMap)
requestParametersMap
- input parameter map.Copyright © 2005-2021 Apache Software Foundation. All Rights Reserved.