Class BaseHttpRequest
- java.lang.Object
-
- com.adobe.pdfservices.operation.internal.http.BaseHttpRequest
-
- All Implemented Interfaces:
HttpRequest
public class BaseHttpRequest extends Object implements HttpRequest
-
-
Constructor Summary
Constructors Constructor Description BaseHttpRequest(HttpMethod httpMethod)BaseHttpRequest(String requestKey, HttpMethod httpMethod, String uriTemplate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidauthenticate()Gets an access token from the authenticator configured with a request and adds it as an authorization headervoidforceAuthenticate()Refreshes the access token via the authenticator configured with a request and adds it as an authorization headerAuthenticatorgetAuthenticator()AuthenticationMethodgetAuthMethod()HttpRequestConfiggetConfig()org.apache.http.entity.StringEntitygetEntity()StringgetFinalUri()Map<String,String>getHeaders()HttpMethodgetHttpMethod()RequestKeygetRequestKey()RequestTypegetRequestType()StringgetTemplateString()HttpRequestwithAcceptType(String acceptHeader)HttpRequestwithAuthenticationMethod(AuthenticationMethod authMethod)HttpRequestwithAuthenticator(Authenticator authenticator)Attaches an authenticator instance to the class, which will be used for all access token operationsHttpRequestwithBody(String body)HttpRequestwithConfig(HttpRequestConfig requestConfig)HttpRequestwithContentType(String contentType)HttpRequestwithHeader(String headerName, String headerValue)HttpRequestwithHeaders(Map<String,String> headers)Will overwrite headers as wellHttpRequestwithRequestKey(RequestKey requestKey)HttpRequestwithTemplate(String uriTemplate)HttpRequestwithUriParam(String name, String value)HttpRequestwithUrlEncodedFormParams(List<org.apache.http.NameValuePair> formParams)
-
-
-
Constructor Detail
-
BaseHttpRequest
public BaseHttpRequest(String requestKey, HttpMethod httpMethod, String uriTemplate)
-
BaseHttpRequest
public BaseHttpRequest(HttpMethod httpMethod)
-
-
Method Detail
-
withContentType
public HttpRequest withContentType(String contentType)
- Specified by:
withContentTypein interfaceHttpRequest
-
withHeader
public HttpRequest withHeader(String headerName, String headerValue)
- Specified by:
withHeaderin interfaceHttpRequest
-
withHeaders
public HttpRequest withHeaders(Map<String,String> headers)
Will overwrite headers as well- Specified by:
withHeadersin interfaceHttpRequest- Parameters:
headers-- Returns:
-
withUriParam
public HttpRequest withUriParam(String name, String value)
- Specified by:
withUriParamin interfaceHttpRequest
-
withUrlEncodedFormParams
public HttpRequest withUrlEncodedFormParams(List<org.apache.http.NameValuePair> formParams)
- Specified by:
withUrlEncodedFormParamsin interfaceHttpRequest
-
withBody
public HttpRequest withBody(String body)
- Specified by:
withBodyin interfaceHttpRequest
-
withAuthenticationMethod
public HttpRequest withAuthenticationMethod(AuthenticationMethod authMethod)
- Specified by:
withAuthenticationMethodin interfaceHttpRequest
-
withAuthenticator
public HttpRequest withAuthenticator(Authenticator authenticator)
Description copied from interface:HttpRequestAttaches an authenticator instance to the class, which will be used for all access token operations- Specified by:
withAuthenticatorin interfaceHttpRequest- Returns:
-
withConfig
public HttpRequest withConfig(HttpRequestConfig requestConfig)
- Specified by:
withConfigin interfaceHttpRequest
-
withRequestKey
public HttpRequest withRequestKey(RequestKey requestKey)
- Specified by:
withRequestKeyin interfaceHttpRequest
-
authenticate
public void authenticate()
Description copied from interface:HttpRequestGets an access token from the authenticator configured with a request and adds it as an authorization header- Specified by:
authenticatein interfaceHttpRequest
-
forceAuthenticate
public void forceAuthenticate()
Description copied from interface:HttpRequestRefreshes the access token via the authenticator configured with a request and adds it as an authorization header- Specified by:
forceAuthenticatein interfaceHttpRequest
-
getConfig
public HttpRequestConfig getConfig()
- Specified by:
getConfigin interfaceHttpRequest
-
withTemplate
public HttpRequest withTemplate(String uriTemplate)
- Specified by:
withTemplatein interfaceHttpRequest
-
withAcceptType
public HttpRequest withAcceptType(String acceptHeader)
- Specified by:
withAcceptTypein interfaceHttpRequest
-
getEntity
public org.apache.http.entity.StringEntity getEntity()
- Specified by:
getEntityin interfaceHttpRequest
-
getHttpMethod
public HttpMethod getHttpMethod()
- Specified by:
getHttpMethodin interfaceHttpRequest
-
getAuthMethod
public AuthenticationMethod getAuthMethod()
- Specified by:
getAuthMethodin interfaceHttpRequest
-
getHeaders
public Map<String,String> getHeaders()
- Specified by:
getHeadersin interfaceHttpRequest
-
getFinalUri
public String getFinalUri()
- Specified by:
getFinalUriin interfaceHttpRequest
-
getTemplateString
public String getTemplateString()
- Specified by:
getTemplateStringin interfaceHttpRequest
-
getRequestType
public RequestType getRequestType()
- Specified by:
getRequestTypein interfaceHttpRequest
-
getAuthenticator
public Authenticator getAuthenticator()
- Specified by:
getAuthenticatorin interfaceHttpRequest
-
getRequestKey
public RequestKey getRequestKey()
- Specified by:
getRequestKeyin interfaceHttpRequest
-
-