public class GoodDataHttpClient extends Object implements org.apache.http.client.HttpClient
Http client with ability to handle GoodData authentication.
// create HTTP client with your settings
HttpClient httpClient = HttpClientBuilder.create().build();
// create login strategy, which wil obtain SST via login
SSTRetrievalStrategy sstStrategy = new LoginSSTRetrievalStrategy("user@domain.com", "my secret");
// wrap your HTTP client into GoodData HTTP client
HttpClient client = new GoodDataHttpClient(httpClient, new HttpHost("server.com", 123), sstStrategy);
// use GoodData HTTP client
HttpGet getProject = new HttpGet("/gdc/projects");
getProject.addHeader("Accept", ContentType.APPLICATION_JSON.getMimeType());
HttpResponse getProjectResponse = client.execute(httpHost, getProject);
// create HTTP client
HttpClient httpClient = ...
// create login strategy (you must somehow obtain SST)
SSTRetrievalStrategy sstStrategy = new SimpleSSTRetrievalStrategy("my super-secure token");
// wrap your HTTP client into GoodData HTTP client
HttpClient client = new GoodDataHttpClient(httpClient, new HttpHost("server.com", 123), sstStrategy);
// use GoodData HTTP client
HttpGet getProject = new HttpGet("/gdc/projects");
getProject.addHeader("Accept", ContentType.APPLICATION_JSON.getMimeType());
HttpResponse getProjectResponse = client.execute(httpHost, getProject);
| Modifier and Type | Field and Description |
|---|---|
static String |
COOKIE_GDC_AUTH_SST |
static String |
COOKIE_GDC_AUTH_TT |
| Constructor and Description |
|---|
GoodDataHttpClient(org.apache.http.client.HttpClient httpClient,
org.apache.http.HttpHost authHost,
SSTRetrievalStrategy sstStrategy)
Construct object.
|
GoodDataHttpClient(org.apache.http.client.HttpClient httpClient,
SSTRetrievalStrategy sstStrategy)
Deprecated.
|
GoodDataHttpClient(org.apache.http.HttpHost authHost,
SSTRetrievalStrategy sstStrategy)
Construct object.
|
GoodDataHttpClient(SSTRetrievalStrategy sstStrategy)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.http.HttpResponse |
execute(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request) |
org.apache.http.HttpResponse |
execute(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
org.apache.http.protocol.HttpContext context) |
<T> T |
execute(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
org.apache.http.client.ResponseHandler<? extends T> responseHandler) |
<T> T |
execute(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
org.apache.http.client.ResponseHandler<? extends T> responseHandler,
org.apache.http.protocol.HttpContext context) |
org.apache.http.HttpResponse |
execute(org.apache.http.client.methods.HttpUriRequest request) |
org.apache.http.HttpResponse |
execute(org.apache.http.client.methods.HttpUriRequest request,
org.apache.http.protocol.HttpContext context) |
<T> T |
execute(org.apache.http.client.methods.HttpUriRequest request,
org.apache.http.client.ResponseHandler<? extends T> responseHandler) |
<T> T |
execute(org.apache.http.client.methods.HttpUriRequest request,
org.apache.http.client.ResponseHandler<? extends T> responseHandler,
org.apache.http.protocol.HttpContext context) |
org.apache.http.conn.ClientConnectionManager |
getConnectionManager() |
org.apache.http.params.HttpParams |
getParams() |
public static final String COOKIE_GDC_AUTH_TT
public static final String COOKIE_GDC_AUTH_SST
@Deprecated public GoodDataHttpClient(org.apache.http.client.HttpClient httpClient, SSTRetrievalStrategy sstStrategy)
GoodDataHttpClient(HttpClient, HttpHost, SSTRetrievalStrategy)httpClient - Http clientsstStrategy - super-secure token (SST) obtaining strategyIllegalArgumentException - if sstStrategy argument is not an instance of LoginSSTRetrievalStrategy@Deprecated public GoodDataHttpClient(SSTRetrievalStrategy sstStrategy)
GoodDataHttpClient(HttpHost, SSTRetrievalStrategy)sstStrategy - super-secure token (SST) obtaining strategypublic GoodDataHttpClient(org.apache.http.client.HttpClient httpClient,
org.apache.http.HttpHost authHost,
SSTRetrievalStrategy sstStrategy)
httpClient - Http clientauthHost - http hostsstStrategy - super-secure token (SST) obtaining strategypublic GoodDataHttpClient(org.apache.http.HttpHost authHost,
SSTRetrievalStrategy sstStrategy)
authHost - http hostsstStrategy - super-secure token (SST) obtaining strategypublic org.apache.http.params.HttpParams getParams()
getParams in interface org.apache.http.client.HttpClientpublic org.apache.http.conn.ClientConnectionManager getConnectionManager()
getConnectionManager in interface org.apache.http.client.HttpClientpublic org.apache.http.HttpResponse execute(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request)
throws IOException
execute in interface org.apache.http.client.HttpClientIOExceptionpublic <T> T execute(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
org.apache.http.client.ResponseHandler<? extends T> responseHandler)
throws IOException
execute in interface org.apache.http.client.HttpClientIOExceptionpublic <T> T execute(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
org.apache.http.client.ResponseHandler<? extends T> responseHandler,
org.apache.http.protocol.HttpContext context)
throws IOException
execute in interface org.apache.http.client.HttpClientIOExceptionpublic org.apache.http.HttpResponse execute(org.apache.http.client.methods.HttpUriRequest request)
throws IOException
execute in interface org.apache.http.client.HttpClientIOExceptionpublic org.apache.http.HttpResponse execute(org.apache.http.client.methods.HttpUriRequest request,
org.apache.http.protocol.HttpContext context)
throws IOException
execute in interface org.apache.http.client.HttpClientIOExceptionpublic <T> T execute(org.apache.http.client.methods.HttpUriRequest request,
org.apache.http.client.ResponseHandler<? extends T> responseHandler)
throws IOException
execute in interface org.apache.http.client.HttpClientIOExceptionpublic <T> T execute(org.apache.http.client.methods.HttpUriRequest request,
org.apache.http.client.ResponseHandler<? extends T> responseHandler,
org.apache.http.protocol.HttpContext context)
throws IOException
execute in interface org.apache.http.client.HttpClientIOExceptionpublic org.apache.http.HttpResponse execute(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
org.apache.http.protocol.HttpContext context)
throws IOException
execute in interface org.apache.http.client.HttpClientIOExceptionCopyright © 2020. All rights reserved.