Class RpcRequest

java.lang.Object
com.emc.ecs.nfsclient.rpc.RpcRequest
Direct Known Subclasses:
GetPortRequest, MountRequest, NfsRequestBase, UnmountRequest

public abstract class RpcRequest extends Object
An RPC request, as specified by RFC 1831 (https://tools.ietf.org/html/rfc1831).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Charset
    The default Internet charset.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RpcRequest(int serviceProgram, int serviceVersion, int serviceProcedure, Credential credential)
    Create the request, as specified by RFC 1831 (https://tools.ietf.org/html/rfc1831).
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static final byte[]
    cloneFileHandle(byte[] fileHandle)
    Utility function for cloning file handles.
    abstract String
    Returns an appropriate error message.
    boolean
    Returns true if the client should use a privileged local port (below 1024).
    void
    Writes the RPC call header and authentication credentials to the XDR buffer.
    void
    setUsePrivilegedPort(boolean usePrivilegedPort)
    Set the flag.
    protected StringBuilder
    startToString(String requestLabel)
    Start a StringBuilder for use in toString() (for logging).
    protected static final String
    Trims a file name and rejects blank names.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CHARSET

      public static final Charset CHARSET
      The default Internet charset.
  • Constructor Details

    • RpcRequest

      public RpcRequest(int serviceProgram, int serviceVersion, int serviceProcedure, Credential credential)
      Create the request, as specified by RFC 1831 (https://tools.ietf.org/html/rfc1831).
      Parameters:
      serviceProgram - The program number of the service.
      serviceVersion - The version number of the service.
      serviceProcedure - The service procedure number to be called.
      credential - The authentication credential to be used for the call.
  • Method Details

    • marshalling

      public void marshalling(Xdr xdr)
      Writes the RPC call header and authentication credentials to the XDR buffer.
    • isUsePrivilegedPort

      public boolean isUsePrivilegedPort()
      Returns
      • true if the client should use a privileged local port (below 1024).
      • false if the client should use any available local port.
      .
    • setUsePrivilegedPort

      public void setUsePrivilegedPort(boolean usePrivilegedPort)
      Set the flag.
      Parameters:
      usePrivilegedPort -
      • true if the client should use a privileged local port (below 1024).
      • false if the client should use any available local port.
    • startToString

      protected StringBuilder startToString(String requestLabel)
      Start a StringBuilder for use in toString() (for logging).
      Returns:
      the builder
    • getErrorMessage

      public abstract String getErrorMessage()
      Returns an appropriate error message.
    • cloneFileHandle

      protected static final byte[] cloneFileHandle(byte[] fileHandle) throws FileNotFoundException
      Utility function for cloning file handles. These can never be null.
      Parameters:
      fileHandle - The file handle to clone.
      Returns:
      A clone if fileHandle is not null.
      Throws:
      FileNotFoundException - If the file handle is null.
    • trimFileName

      protected static final String trimFileName(String name) throws IllegalArgumentException
      Trims a file name and rejects blank names.
      Parameters:
      name - The file name to trim.
      Returns:
      The trimmed file name.
      Throws:
      IllegalArgumentException - If the file name is blank.