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 HttpCommandorg.jclouds.Constants.PROPERTY_MAX_RETRIESpublic int incrementFailureCount()
incrementFailureCount in interface HttpCommandHttpCommand.getFailureCount()public void setException(Exception exception)
setException in interface HttpCommandpublic Exception getException()
getException in interface HttpCommandHttpCommand.setException(java.lang.Exception)public int incrementRedirectCount()
incrementRedirectCount in interface HttpCommandHttpCommand.getRedirectCount()public int getRedirectCount()
getRedirectCount in interface HttpCommandorg.jclouds.Constants.PROPERTY_MAX_REDIRECTSpublic boolean isReplayable()
isReplayable in interface HttpCommandpublic HttpRequest getCurrentRequest()
getCurrentRequest in interface HttpCommandpublic void setCurrentRequest(HttpRequest request)
setCurrentRequest in interface HttpCommandCopyright © 2009-2013 jclouds. All Rights Reserved.