Class RpcResponseHandler<T>

java.lang.Object
com.emc.ecs.nfsclient.rpc.RpcResponseHandler<T>
Direct Known Subclasses:
NfsResponseHandler

public abstract class RpcResponseHandler<T> extends Object
This class allows users to specify how new response instances are created during repeated RPC calls, and how responses are validated before their data is used.
  • Constructor Details

    • RpcResponseHandler

      public RpcResponseHandler()
  • Method Details

    • getResponse

      public T getResponse()
      Get the current response.
      Returns:
      the current response
    • getNewResponse

      public T getNewResponse()
      Create a new response and return it.
      Returns:
      the new response
    • makeNewResponse

      protected abstract T makeNewResponse()
      This is implemented in all concrete subclasses, so that the new response can be created using any available parameters.
      Returns:
      the new response.
    • checkResponse

      public abstract void checkResponse(RpcRequest request) throws IOException
      This is implemented in all concrete subclasses to check responses for validity, and throws an IOException if the response indicates that the request failed.
      Parameters:
      request - This is used for error messages, to aid debugging, since the response will likely not have enough data to determine the request that caused it.
      Throws:
      IOException