public class NfsWriteRequest extends NfsRequestBase
Procedure WRITE writes data to a file.
| Modifier and Type | Field and Description |
|---|---|
static int |
DATA_SYNC
The server must commit all of the data to stable storage and enough of
the metadata to retrieve the data before returning.
|
static int |
FILE_SYNC
The server must commit the data written plus all file system metadata to
stable storage before returning results.
|
static int |
UNSTABLE
The server is free to commit any part of the data and the metadata to
stable storage, including all or none, before returning a reply to the
client.
|
CHARSET| Constructor and Description |
|---|
NfsWriteRequest(byte[] fileHandle,
long offset,
java.util.List<java.nio.ByteBuffer> payload,
int syncType,
Credential credential,
int nfsVersion)
Creates the request, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
| Modifier and Type | Method and Description |
|---|---|
int |
getSize() |
boolean |
isSync() |
void |
marshalling(Xdr xdr)
Transfer data to an Xdr object for RPC use.
|
java.lang.String |
toString() |
getErrorMessage, getFileHandle, getIpKey, startToStringcloneFileHandle, isUsePrivilegedPort, setUsePrivilegedPort, trimFileNamepublic static final int UNSTABLE
public static final int DATA_SYNC
public static final int FILE_SYNC
public NfsWriteRequest(byte[] fileHandle,
long offset,
java.util.List<java.nio.ByteBuffer> payload,
int syncType,
Credential credential,
int nfsVersion)
throws java.io.FileNotFoundException
Procedure WRITE writes data to a file.
fileHandle - The file handle for the file to which data is to be written.
This must identify a file system object of type, NF3REG.offset - The position within the file at which the write is to begin.
An offset of 0 means to write data starting at the beginning
of the file.payload - The data to be written to the file.syncType - One of the values below.
credential - The credential used for RPC authentication.nfsVersion - The NFS version numberjava.io.FileNotFoundExceptionpublic void marshalling(Xdr xdr)
NfsRequestmarshalling in interface NfsRequestmarshalling in class NfsRequestBasexdr - the Xdr to be sent.public java.lang.String toString()
toString in class java.lang.Objectpublic int getSize()
payload). If size is 0, the WRITE will
succeed and return a count of 0, barring errors due
to permissions checking. The size of data must be
less than or equal to the value of the wtmax field
in the FSINFO reply structure for the file system that contains
file. If greater, the server may write only wtmax
bytes, resulting in a short write.public boolean isSync()
true if data is syncedfalse if it is not.