.
- Author:
- Adrian Cole
- See Also:
TransformingHttpCommand
executorService
protected final TransformingHttpCommandExecutorService executorService
transformer
protected final com.google.common.base.Function<HttpResponse,T> transformer
request
protected volatile HttpRequest request
failureCount
protected volatile int failureCount
redirectCount
protected volatile int redirectCount
exception
protected volatile Exception exception
logger
protected Logger logger
TransformingHttpCommandImpl
@Inject
public TransformingHttpCommandImpl(TransformingHttpCommandExecutorService executorService,
HttpRequest request,
com.google.common.base.Function<HttpResponse,T> transformer)
execute
public com.google.common.util.concurrent.ListenableFuture<T> execute()
throws ExecutionException
- invoke and transform the response
<R>
into value type <T>
- Specified by:
execute
in interface TransformingHttpCommand<T>
- Returns:
- future containing the expected value
- Throws:
ExecutionException
- if there is a fatal error preventing the command from invoking
getFailureCount
public int getFailureCount()
- This displays the current number of error retries for this command.
- Specified by:
getFailureCount
in interface HttpCommand
- See Also:
org.jclouds.Constants.PROPERTY_MAX_RETRIES
incrementFailureCount
public int incrementFailureCount()
- increment the current failure count.
- Specified by:
incrementFailureCount
in interface HttpCommand
- See Also:
HttpCommand.getFailureCount()
setException
public void setException(Exception exception)
- Used to prevent a command from being re-executed, or having its response parsed.
- Specified by:
setException
in interface HttpCommand
getException
public Exception getException()
-
- Specified by:
getException
in interface HttpCommand
- See Also:
HttpCommand.setException(java.lang.Exception)
incrementRedirectCount
public int incrementRedirectCount()
- increments the current number of redirect attempts for this command.
- Specified by:
incrementRedirectCount
in interface HttpCommand
- See Also:
HttpCommand.getRedirectCount()
getRedirectCount
public int getRedirectCount()
- This displays the current number of redirect attempts for this command.
- Specified by:
getRedirectCount
in interface HttpCommand
- See Also:
org.jclouds.Constants.PROPERTY_MAX_REDIRECTS
isReplayable
public boolean isReplayable()
- Commands need to be replayed, if redirected or on a retryable error. Typically, this implies
the payload carried is not a streaming type.
- Specified by:
isReplayable
in interface HttpCommand
getCurrentRequest
public HttpRequest getCurrentRequest()
- The request associated with this command.
- Specified by:
getCurrentRequest
in interface HttpCommand
setCurrentRequest
public void setCurrentRequest(HttpRequest request)
- The request associated with this command.
- Specified by:
setCurrentRequest
in interface HttpCommand
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object that)
- Overrides:
equals
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2009-2012 jclouds. All Rights Reserved.