net.netheos.pcsapi.request
Class RequestInvoker<T>
java.lang.Object
net.netheos.pcsapi.request.RequestInvoker<T>
- Type Parameters:
T - The request result
- All Implemented Interfaces:
- Callable<T>
public class RequestInvoker<T>
- extends Object
- implements Callable<T>
Invokes http request and validates http server response.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
requestor
protected final Requestor<T> requestor
validator
protected final ResponseValidator<T> validator
RequestInvoker
public RequestInvoker(Requestor<T> requestor,
ResponseValidator<T> validator)
call
public T call()
throws Exception
- Performs and validates http request.
Two steps:
- requests server with doRequest()
- validates response with validateResponse()
- Specified by:
call in interface Callable<T>
- Returns:
- The request result
- Throws:
Exception - Request invocation error
validateResponse
protected void validateResponse(T response)
throws CStorageException
- Throws:
CStorageException
Copyright © 2014. All Rights Reserved.