|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.plumtree.portaluiinfrastructure.restconsumerframework.RestRequest
public class RestRequest
Helper class to perform REST API Requests
Field Summary | |
---|---|
protected static java.lang.String |
ACCEPT_LANGUAGE
|
static int |
AUTHENTICATION_METHOD_BASICAUTH
|
static int |
AUTHENTICATION_METHOD_CSPLOGINTOKEN
|
static int |
AUTHENTICATION_METHOD_HEADERTOKEN
|
static int |
AUTHENTICATION_METHOD_NONE
|
protected static java.lang.String |
BASICAUTH_PASSWORD
|
protected static java.lang.String |
BASICAUTH_USERNAME
|
protected static java.lang.String |
CSPLOGINTOKEN_NAME
|
protected static java.lang.String |
CSPLOGINTOKEN_VALUE
|
protected static java.lang.String |
HEADERTOKEN_NAME
|
protected static java.lang.String |
HEADERTOKEN_VALUE
|
protected XPHashtable |
m_authData
Container to store authentication data |
protected int |
m_authMethod
Authentication method |
protected java.lang.String |
m_contentType
Content-Type header value |
protected int |
m_msTimeout
|
protected byte[] |
m_postBody
Request Post body |
protected java.lang.String |
m_reqMethod
HTTP Request method |
protected IOKUrl |
m_url
HTTP Request url |
Constructor Summary | |
---|---|
protected |
RestRequest()
Used by MockRestRequest |
Method Summary | |
---|---|
java.lang.String |
GetContentTypeHeader()
Returns the Content-Type header value being set on this request. |
static RestRequest |
GetInstance(java.lang.String url,
IOKHttpService service,
IOKHttpSession session)
Gets an instance of a RestRequest object |
java.lang.String |
getRequestMethod()
Getter |
IOKUrl |
getRequestUrl()
Getter |
protected void |
SetAuthenticationOnRequest(IOKHttpRequest req)
Applies the authentication on the request Extend this method to add additional authentication methods |
void |
SetContentTypeHeader(java.lang.String contentType)
This method can be used to set Content-Type header on the rest request. |
void |
SetCSPLoginToken(java.lang.String tokenValue)
Set a WCI issued login token recognized by portlets |
void |
SetHttpAuthentication(java.lang.String userName,
java.lang.String password)
Sets basic http authentication name and passsword |
void |
SetPostBody(java.lang.String bodyContent)
|
void |
SetRequestHeaderTokenAuthentication(java.lang.String tokenName,
java.lang.String tokenValue)
Sets a generic request header name value pair |
void |
SetRequestMethod(java.lang.String method)
Setter |
IRestResponse |
Submit()
Submits the Rest request |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int AUTHENTICATION_METHOD_NONE
public static final int AUTHENTICATION_METHOD_BASICAUTH
public static final int AUTHENTICATION_METHOD_HEADERTOKEN
public static final int AUTHENTICATION_METHOD_CSPLOGINTOKEN
protected static final java.lang.String BASICAUTH_USERNAME
protected static final java.lang.String BASICAUTH_PASSWORD
protected static final java.lang.String HEADERTOKEN_NAME
protected static final java.lang.String HEADERTOKEN_VALUE
protected static final java.lang.String CSPLOGINTOKEN_VALUE
protected static final java.lang.String CSPLOGINTOKEN_NAME
protected static final java.lang.String ACCEPT_LANGUAGE
protected java.lang.String m_reqMethod
protected IOKUrl m_url
protected int m_authMethod
protected XPHashtable m_authData
protected int m_msTimeout
protected byte[] m_postBody
protected java.lang.String m_contentType
Constructor Detail |
---|
protected RestRequest()
Method Detail |
---|
public static RestRequest GetInstance(java.lang.String url, IOKHttpService service, IOKHttpSession session)
url
- Url to the Rest endpointservice
- Same service object should be used for all requests. Available from OpenHTTPServiceHelpersession
- Same session object should be used for all requests. Available from OpenHTTPServiceHelperpublic IRestResponse Submit()
protected void SetAuthenticationOnRequest(IOKHttpRequest req)
req
- public void SetHttpAuthentication(java.lang.String userName, java.lang.String password)
userName
- password
- public void SetRequestHeaderTokenAuthentication(java.lang.String tokenName, java.lang.String tokenValue)
tokenName
- tokenValue
- public void SetCSPLoginToken(java.lang.String tokenValue)
tokenValue
- public void SetRequestMethod(java.lang.String method)
method
- public void SetPostBody(java.lang.String bodyContent)
public java.lang.String getRequestMethod()
public IOKUrl getRequestUrl()
public void SetContentTypeHeader(java.lang.String contentType)
contentType
- public java.lang.String GetContentTypeHeader()
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |