public final class StandAloneTrustedHttpClientImpl extends Object implements TrustedHttpClient
TrustedHttpClient.RequestRunner<A>| Modifier and Type | Field and Description |
|---|---|
static String |
AUTHORIZATION_HEADER_NAME
Header name used to request a new nonce from a server a request is sent to.
|
static int |
DEFAULT_CONNECTION_TIMEOUT
The default time until a connection attempt fails
|
static int |
DEFAULT_NONCE_TIMEOUT_RETRIES
The default number of times to attempt a request after it has failed due to a nonce expiring.
|
static int |
DEFAULT_RETRY_BASE_DELAY
The default amount of time to wait after a nonce timeout.
|
static int |
DEFAULT_RETRY_MAXIMUM_VARIABLE_TIME
Default maximum amount of time in a random range between 0 and this value to add to the base time.
|
static int |
DEFAULT_SOCKET_TIMEOUT
The default time between packets that causes a connection to fail
|
static String |
DIGEST_AUTH |
static String |
REQUESTED_AUTH_HEADER |
| Constructor and Description |
|---|
StandAloneTrustedHttpClientImpl(String user,
String pass,
Option<Integer> nonceTimeoutRetries,
Option<Integer> retryBaseDelay,
Option<Integer> retryMaximumVariableTime) |
| Modifier and Type | Method and Description |
|---|---|
void |
close(org.apache.http.HttpResponse response)
Closes this response.
|
org.apache.http.HttpResponse |
execute(org.apache.http.client.methods.HttpUriRequest httpUriRequest)
Executes an HttpRequest using a secure, but not necessarily encrypted, http connection.
|
org.apache.http.HttpResponse |
execute(org.apache.http.client.methods.HttpUriRequest httpUriRequest,
int connectionTimeout,
int socketTimeout)
Executes an HttpRequest using a secure, but not necessarily encrypted, http connection, waiting for the specified
timeouts.
|
<T> T |
execute(org.apache.http.client.methods.HttpUriRequest httpUriRequest,
org.apache.http.client.ResponseHandler<T> responseHandler)
Executes an HttpRequest using a secure, but not necessarily encrypted, http connection.
|
<T> T |
execute(org.apache.http.client.methods.HttpUriRequest httpUriRequest,
org.apache.http.client.ResponseHandler<T> responseHandler,
int connectionTimeout,
int socketTimeout)
Executes an HttpRequest using a secure, but not necessarily encrypted, http connection, waiting for the specified
timeouts.
|
<A> Function<Function<org.apache.http.HttpResponse,A>,Either<Exception,A>> |
run(org.apache.http.client.methods.HttpUriRequest httpUriRequest)
Create a function that takes a function to handle the response of the given request returning
either a result or any occurred exception.
|
static <A> Function<Function<org.apache.http.HttpResponse,A>,Either<Exception,A>> |
run(TrustedHttpClient client,
org.apache.http.client.methods.HttpUriRequest httpUriRequest) |
<A> TrustedHttpClient.RequestRunner<A> |
runner(org.apache.http.client.methods.HttpUriRequest req)
Create a request runner to execute the request.
|
static <A> TrustedHttpClient.RequestRunner<A> |
runner(TrustedHttpClient client,
org.apache.http.client.methods.HttpUriRequest req) |
public static final String AUTHORIZATION_HEADER_NAME
public static final String REQUESTED_AUTH_HEADER
public static final String DIGEST_AUTH
public static final int DEFAULT_CONNECTION_TIMEOUT
public static final int DEFAULT_SOCKET_TIMEOUT
public static final int DEFAULT_NONCE_TIMEOUT_RETRIES
public static final int DEFAULT_RETRY_BASE_DELAY
public static final int DEFAULT_RETRY_MAXIMUM_VARIABLE_TIME
public <A> Function<Function<org.apache.http.HttpResponse,A>,Either<Exception,A>> run(org.apache.http.client.methods.HttpUriRequest httpUriRequest)
TrustedHttpClientrun in interface TrustedHttpClienthttpUriRequest - The http requestHttpUriRequest -> (HttpResponse -> A) -> Either Exception Apublic static <A> Function<Function<org.apache.http.HttpResponse,A>,Either<Exception,A>> run(TrustedHttpClient client, org.apache.http.client.methods.HttpUriRequest httpUriRequest)
public <A> TrustedHttpClient.RequestRunner<A> runner(org.apache.http.client.methods.HttpUriRequest req)
TrustedHttpClient
This method replaces TrustedHttpClient.run(org.apache.http.client.methods.HttpUriRequest) to avoid
type annotation mess. To actually run the request call the runners
run
method.
runner in interface TrustedHttpClientpublic static <A> TrustedHttpClient.RequestRunner<A> runner(TrustedHttpClient client, org.apache.http.client.methods.HttpUriRequest req)
public org.apache.http.HttpResponse execute(org.apache.http.client.methods.HttpUriRequest httpUriRequest)
throws TrustedHttpClientException
TrustedHttpClientexecute in interface TrustedHttpClienthttpUriRequest - The http requestTrustedHttpClientExceptionpublic org.apache.http.HttpResponse execute(org.apache.http.client.methods.HttpUriRequest httpUriRequest,
int connectionTimeout,
int socketTimeout)
throws TrustedHttpClientException
TrustedHttpClientexecute in interface TrustedHttpClienthttpUriRequest - The http requestconnectionTimeout - the wait time in milliseconds at which a connection attempt will throwsocketTimeout - the maximum time in milliseconds allowed between packets before this method will throwTrustedHttpClientExceptionpublic <T> T execute(org.apache.http.client.methods.HttpUriRequest httpUriRequest,
org.apache.http.client.ResponseHandler<T> responseHandler,
int connectionTimeout,
int socketTimeout)
throws TrustedHttpClientException
TrustedHttpClientexecute in interface TrustedHttpClienthttpUriRequest - The http requestresponseHandler - the response handlerconnectionTimeout - the wait time in milliseconds at which a connection attempt will throwsocketTimeout - the maximum time in milliseconds allowed between packets before this method will throwTrustedHttpClientExceptionpublic void close(org.apache.http.HttpResponse response)
close in interface TrustedHttpClientresponse - The response to closeTrustedHttpClient.close(org.apache.http.HttpResponse)public <T> T execute(org.apache.http.client.methods.HttpUriRequest httpUriRequest,
org.apache.http.client.ResponseHandler<T> responseHandler)
throws TrustedHttpClientException
execute in interface TrustedHttpClienthttpUriRequest - The http requestTrustedHttpClientExceptionTrustedHttpClient.execute(org.apache.http.client.methods.HttpUriRequest,
org.apache.http.client.ResponseHandler)Copyright © 2009–2021 Opencast Project. All rights reserved.