public class TransformingHttpCommandImpl<T> extends Object implements TransformingHttpCommand<T>
EndpointCommand
into generic
type TransformingHttpCommand
Modifier and Type | Field and Description |
---|---|
protected Exception |
exception |
protected TransformingHttpCommandExecutorService |
executorService |
protected int |
failureCount |
protected Logger |
logger |
protected int |
redirectCount |
protected HttpRequest |
request |
protected com.google.common.base.Function<HttpResponse,T> |
transformer |
Constructor and Description |
---|
TransformingHttpCommandImpl(TransformingHttpCommandExecutorService executorService,
HttpRequest request,
com.google.common.base.Function<HttpResponse,T> transformer) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object that) |
com.google.common.util.concurrent.ListenableFuture<T> |
execute()
invoke and transform the response
<R> into value type <T> |
HttpRequest |
getCurrentRequest()
The request associated with this command.
|
Exception |
getException() |
int |
getFailureCount()
This displays the current number of error retries for this command.
|
int |
getRedirectCount()
This displays the current number of redirect attempts for this command.
|
int |
hashCode() |
int |
incrementFailureCount()
increment the current failure count.
|
int |
incrementRedirectCount()
increments the current number of redirect attempts for this command.
|
boolean |
isReplayable()
Commands need to be replayed, if redirected or on a retryable error.
|
void |
setCurrentRequest(HttpRequest request)
The request associated with this command.
|
void |
setException(Exception exception)
Used to prevent a command from being re-executed, or having its response parsed.
|
String |
toString() |
protected final TransformingHttpCommandExecutorService executorService
protected final com.google.common.base.Function<HttpResponse,T> transformer
protected volatile HttpRequest request
protected volatile int failureCount
protected volatile int redirectCount
protected volatile Exception exception
protected Logger logger
@Inject public TransformingHttpCommandImpl(TransformingHttpCommandExecutorService executorService, HttpRequest request, com.google.common.base.Function<HttpResponse,T> transformer)
public com.google.common.util.concurrent.ListenableFuture<T> execute() throws ExecutionException
<R>
into value type <T>
execute
in interface TransformingHttpCommand<T>
ExecutionException
- if there is a fatal error preventing the command from invokingpublic int getFailureCount()
getFailureCount
in interface HttpCommand
org.jclouds.Constants.PROPERTY_MAX_RETRIES
public int incrementFailureCount()
incrementFailureCount
in interface HttpCommand
HttpCommand.getFailureCount()
public void setException(Exception exception)
setException
in interface HttpCommand
public Exception getException()
getException
in interface HttpCommand
HttpCommand.setException(java.lang.Exception)
public int incrementRedirectCount()
incrementRedirectCount
in interface HttpCommand
HttpCommand.getRedirectCount()
public int getRedirectCount()
getRedirectCount
in interface HttpCommand
org.jclouds.Constants.PROPERTY_MAX_REDIRECTS
public boolean isReplayable()
isReplayable
in interface HttpCommand
public HttpRequest getCurrentRequest()
getCurrentRequest
in interface HttpCommand
public void setCurrentRequest(HttpRequest request)
setCurrentRequest
in interface HttpCommand
Copyright © 2009-2012 jclouds. All Rights Reserved.