public static class RYRequestFactory.RYApplinkRequest extends Object implements com.atlassian.applinks.api.ApplicationLinkRequest
Modifier and Type | Field and Description |
---|---|
private Integer |
connectionTimeout |
private com.atlassian.applinks.api.ApplicationLinkRequest |
delegate |
private RYRequestFactory |
factory |
private org.apache.log4j.Logger |
log |
private com.atlassian.sal.api.net.Request.MethodType |
methodType |
private String |
requestBodyAbbreviated |
private Integer |
soTimeout |
private String |
url |
private Supplier<String> |
webpageUrl |
Constructor and Description |
---|
RYApplinkRequest(org.apache.log4j.Logger log,
com.atlassian.applinks.api.ApplicationLinkRequest request,
RYRequestFactory factory,
com.atlassian.sal.api.net.Request.MethodType methodType,
String url) |
Modifier and Type | Method and Description |
---|---|
RYRequestFactory.RYApplinkRequest |
addBasicAuthentication(String hostname,
String username,
String password) |
RYRequestFactory.RYApplinkRequest |
addHeader(String headerName,
String headerValue) |
RYRequestFactory.RYApplinkRequest |
addRequestParameters(String... params) |
String |
execute() |
<R> R |
execute(com.atlassian.applinks.api.ApplicationLinkResponseHandler<R> responseHandler) |
void |
execute(com.atlassian.sal.api.net.ResponseHandler<? super com.atlassian.sal.api.net.Response> responseHandler) |
String |
execute2() |
<T> T |
executeAndParseJson(Class<T> classOfT)
Executes the request and manages 200-OK and Json parsing.
|
<RET> RET |
executeAndReturn(com.atlassian.sal.api.net.ReturningResponseHandler<? super com.atlassian.sal.api.net.Response,RET> responseHandler) |
Map<String,List<String>> |
getHeaders() |
private void |
logThisRequest() |
com.atlassian.applinks.api.ApplicationLinkRequest |
setConnectionTimeout(int connectionTimeout) |
RYRequestFactory.RYApplinkRequest |
setEntity(Object entity) |
RYRequestFactory.RYApplinkRequest |
setFiles(List<com.atlassian.sal.api.net.RequestFilePart> files) |
RYRequestFactory.RYApplinkRequest |
setFollowRedirects(boolean follow) |
RYRequestFactory.RYApplinkRequest |
setHeader(String headerName,
String headerValue) |
RYRequestFactory.RYApplinkRequest |
setRequestBody(String requestBody) |
RYRequestFactory.RYApplinkRequest |
setRequestBody(String requestBody,
String contentType) |
com.atlassian.applinks.api.ApplicationLinkRequest |
setSoTimeout(int soTimeout) |
com.atlassian.applinks.api.ApplicationLinkRequest |
setUrl(String url) |
RYRequestFactory.RYApplinkRequest |
setWebpageUrl(Supplier<String> webpageUrl) |
private final org.apache.log4j.Logger log
private final com.atlassian.applinks.api.ApplicationLinkRequest delegate
private final RYRequestFactory factory
private final com.atlassian.sal.api.net.Request.MethodType methodType
private String url
private Integer connectionTimeout
private Integer soTimeout
private String requestBodyAbbreviated
public RYApplinkRequest(org.apache.log4j.Logger log, com.atlassian.applinks.api.ApplicationLinkRequest request, RYRequestFactory factory, com.atlassian.sal.api.net.Request.MethodType methodType, String url)
public RYRequestFactory.RYApplinkRequest setWebpageUrl(Supplier<String> webpageUrl)
private void logThisRequest()
public <T> T executeAndParseJson(Class<T> classOfT) throws ApplinkException
classOfT
- the type of JSON class in which the respnose should be parsed.
JsonElement.class
is a satisfying value.ApplinkException
public <R> R execute(com.atlassian.applinks.api.ApplicationLinkResponseHandler<R> responseHandler) throws com.atlassian.sal.api.net.ResponseException
execute
in interface com.atlassian.applinks.api.ApplicationLinkRequest
com.atlassian.sal.api.net.ResponseException
public void execute(com.atlassian.sal.api.net.ResponseHandler<? super com.atlassian.sal.api.net.Response> responseHandler) throws com.atlassian.sal.api.net.ResponseException
execute
in interface com.atlassian.sal.api.net.Request<com.atlassian.applinks.api.ApplicationLinkRequest,com.atlassian.sal.api.net.Response>
com.atlassian.sal.api.net.ResponseException
public String execute() throws com.atlassian.sal.api.net.ResponseException
execute
in interface com.atlassian.sal.api.net.Request<com.atlassian.applinks.api.ApplicationLinkRequest,com.atlassian.sal.api.net.Response>
com.atlassian.sal.api.net.ResponseException
public String execute2() throws ApplinkException
ApplinkException
public <RET> RET executeAndReturn(com.atlassian.sal.api.net.ReturningResponseHandler<? super com.atlassian.sal.api.net.Response,RET> responseHandler) throws com.atlassian.sal.api.net.ResponseException
executeAndReturn
in interface com.atlassian.sal.api.net.Request<com.atlassian.applinks.api.ApplicationLinkRequest,com.atlassian.sal.api.net.Response>
com.atlassian.sal.api.net.ResponseException
public com.atlassian.applinks.api.ApplicationLinkRequest setConnectionTimeout(int connectionTimeout)
setConnectionTimeout
in interface com.atlassian.sal.api.net.Request<com.atlassian.applinks.api.ApplicationLinkRequest,com.atlassian.sal.api.net.Response>
public com.atlassian.applinks.api.ApplicationLinkRequest setSoTimeout(int soTimeout)
setSoTimeout
in interface com.atlassian.sal.api.net.Request<com.atlassian.applinks.api.ApplicationLinkRequest,com.atlassian.sal.api.net.Response>
public com.atlassian.applinks.api.ApplicationLinkRequest setUrl(String url)
setUrl
in interface com.atlassian.sal.api.net.Request<com.atlassian.applinks.api.ApplicationLinkRequest,com.atlassian.sal.api.net.Response>
public RYRequestFactory.RYApplinkRequest setRequestBody(String requestBody)
setRequestBody
in interface com.atlassian.sal.api.net.Request<com.atlassian.applinks.api.ApplicationLinkRequest,com.atlassian.sal.api.net.Response>
public RYRequestFactory.RYApplinkRequest setRequestBody(String requestBody, String contentType)
setRequestBody
in interface com.atlassian.sal.api.net.Request<com.atlassian.applinks.api.ApplicationLinkRequest,com.atlassian.sal.api.net.Response>
public RYRequestFactory.RYApplinkRequest setFiles(List<com.atlassian.sal.api.net.RequestFilePart> files)
setFiles
in interface com.atlassian.sal.api.net.Request<com.atlassian.applinks.api.ApplicationLinkRequest,com.atlassian.sal.api.net.Response>
public RYRequestFactory.RYApplinkRequest setEntity(Object entity)
setEntity
in interface com.atlassian.sal.api.net.Request<com.atlassian.applinks.api.ApplicationLinkRequest,com.atlassian.sal.api.net.Response>
public RYRequestFactory.RYApplinkRequest addRequestParameters(String... params)
addRequestParameters
in interface com.atlassian.sal.api.net.Request<com.atlassian.applinks.api.ApplicationLinkRequest,com.atlassian.sal.api.net.Response>
public RYRequestFactory.RYApplinkRequest addBasicAuthentication(String hostname, String username, String password)
addBasicAuthentication
in interface com.atlassian.sal.api.net.Request<com.atlassian.applinks.api.ApplicationLinkRequest,com.atlassian.sal.api.net.Response>
public RYRequestFactory.RYApplinkRequest addHeader(String headerName, String headerValue)
addHeader
in interface com.atlassian.sal.api.net.Request<com.atlassian.applinks.api.ApplicationLinkRequest,com.atlassian.sal.api.net.Response>
public RYRequestFactory.RYApplinkRequest setHeader(String headerName, String headerValue)
setHeader
in interface com.atlassian.sal.api.net.Request<com.atlassian.applinks.api.ApplicationLinkRequest,com.atlassian.sal.api.net.Response>
public RYRequestFactory.RYApplinkRequest setFollowRedirects(boolean follow)
setFollowRedirects
in interface com.atlassian.sal.api.net.Request<com.atlassian.applinks.api.ApplicationLinkRequest,com.atlassian.sal.api.net.Response>
Copyright © 2020 Play SQL. All rights reserved.