Class RpcRequest
java.lang.Object
com.emc.ecs.nfsclient.rpc.RpcRequest
- Direct Known Subclasses:
GetPortRequest, MountRequest, NfsRequestBase, UnmountRequest
An RPC request, as specified by RFC 1831 (https://tools.ietf.org/html/rfc1831).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRpcRequest(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 TypeMethodDescriptionprotected static final byte[]cloneFileHandle(byte[] fileHandle) Utility function for cloning file handles.abstract StringReturns an appropriate error message.booleanReturnstrueif the client should use a privileged local port (below 1024).voidmarshalling(Xdr xdr) Writes the RPC call header and authentication credentials to the XDR buffer.voidsetUsePrivilegedPort(boolean usePrivilegedPort) Set the flag.protected StringBuilderstartToString(String requestLabel) Start a StringBuilder for use in toString() (for logging).protected static final StringtrimFileName(String name) Trims a file name and rejects blank names.
-
Field Details
-
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
Writes the RPC call header and authentication credentials to the XDR buffer. -
isUsePrivilegedPort
public boolean isUsePrivilegedPort()Returnstrueif the client should use a privileged local port (below 1024).falseif the client should use any available local port.
-
setUsePrivilegedPort
public void setUsePrivilegedPort(boolean usePrivilegedPort) Set the flag.- Parameters:
usePrivilegedPort-trueif the client should use a privileged local port (below 1024).falseif the client should use any available local port.
-
startToString
Start a StringBuilder for use in toString() (for logging).- Returns:
- the builder
-
getErrorMessage
Returns an appropriate error message. -
cloneFileHandle
Utility function for cloning file handles. These can never be null.- Parameters:
fileHandle- The file handle to clone.- Returns:
- A clone if
fileHandleis notnull. - Throws:
FileNotFoundException- If the file handle is null.
-
trimFileName
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.
-