Class Nfs3

java.lang.Object
com.emc.ecs.nfsclient.nfs.nfs3.Nfs3
All Implemented Interfaces:
Nfs<Nfs3File>

public class Nfs3 extends Object implements Nfs<Nfs3File>
Nfs3 client operations implementation, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813)
  • Field Details

    • VERSION

      public static final int VERSION
      The NFS version number.
      See Also:
    • NFS_TIMEOUT

      public static final int NFS_TIMEOUT
      The timeout in seconds.
      See Also:
    • MAXIMUM_NFS_REQUEST_SIZE

      public static final int MAXIMUM_NFS_REQUEST_SIZE
      The maximum size in bytes. 8K is enough for all requests except for data writing.
      See Also:
  • Constructor Details

    • Nfs3

      public Nfs3(String server, String exportedPath, byte[] rootFileHandle, int maximumRetries) throws IOException
      Convenience constructor
      Throws:
      IOException
    • Nfs3

      public Nfs3(String server, String exportedPath, Credential credential, int maximumRetries) throws IOException
      Convenience constructor
      Throws:
      IOException
    • Nfs3

      public Nfs3(String absolutePath, int uid, int gid, int maximumRetries) throws IOException
      Convenience constructor
      Parameters:
      absolutePath - The fully qualified path to the export, e.g., 10.32.172.64:/store.
      Throws:
      IOException
    • Nfs3

      public Nfs3(String absolutePath, Credential credential, int maximumRetries) throws IOException
      Convenience constructor
      Parameters:
      absolutePath - The fully qualified path to the export, e.g., 10.32.172.64:/store.
      Throws:
      IOException
    • Nfs3

      public Nfs3(String server, String exportedPath, byte[] rootFileHandle, Credential credential, int maximumRetries) throws IOException
      Full constructor.
      Parameters:
      server - The NFS server name or IP address.
      exportedPath - The exported path
      Throws:
      IOException
    • Nfs3

      public Nfs3(String server, String exportedPath, Credential credential, int maximumRetries, int nfsPort, int mountPort) throws IOException
      Create a client with independently configurable NFS and MOUNT TCP destination ports.
      Parameters:
      server - the NFS server name or IP address (without a port)
      exportedPath - the exported path
      credential - RPC credential, or null for the default UNIX credential
      maximumRetries - positive maximum number of NFS call attempts
      nfsPort - NFS port (1-65535), or 0 to discover through portmapper
      mountPort - MOUNT port (1-65535), or 0 to discover through portmapper
      Throws:
      IOException - if service discovery or mounting fails
      IllegalArgumentException - if a port is outside 0-65535
    • Nfs3

      public Nfs3(String server, String exportedPath, byte[] rootFileHandle, Credential credential, int maximumRetries, int nfsPort, int mountPort) throws IOException
      Full constructor with optional explicit TCP destination ports. A nonzero port bypasses portmapper for that service, including when the root handle is refreshed. Supplying a root handle skips MOUNT; with an explicit NFS port it also skips all portmapper discovery. Existing constructors are equivalent to specifying 0 for both ports.
      Parameters:
      server - the NFS server name or IP address (without a port)
      exportedPath - the exported path
      rootFileHandle - root file handle, or null to obtain it using MOUNT
      credential - RPC credential, or null for the default UNIX credential
      maximumRetries - positive maximum number of NFS call attempts
      nfsPort - NFS port (1-65535), or 0 to discover through portmapper
      mountPort - MOUNT port (1-65535), or 0 to discover through portmapper
      Throws:
      IOException - if service discovery or mounting fails
      IllegalArgumentException - if a port is outside 0-65535
  • Method Details

    • disableSudo

      public void disableSudo() throws IOException
      Return to the default Credential.
      Specified by:
      disableSudo in interface Nfs<Nfs3File>
      Throws:
      IOException
    • enableSudo

      public void enableSudo(int uid, int gid)
      Use a custom Credential.
      Specified by:
      enableSudo in interface Nfs<Nfs3File>
      Parameters:
      uid - Unix uid
      gid - Unix gid
    • getCredential

      public Credential getCredential()
      Returns the Credential used for RPC calls.
      Specified by:
      getCredential in interface Nfs<Nfs3File>
    • getExportedPath

      public String getExportedPath()
      Returns the path on the filesystem that is exported by the NFS server.
      Specified by:
      getExportedPath in interface Nfs<Nfs3File>
    • newFile

      public Nfs3File newFile(String path) throws IOException
      Convenience method to create an nfs file from this client and the path.
      Specified by:
      newFile in interface Nfs<Nfs3File>
      Parameters:
      path - The file's path from the mount point.
      Returns:
      the nfs file object
      Throws:
      IOException
    • getPort

      public int getPort()
      Returns the TCP destination port being used for the NFS server, whether explicitly configured or discovered through portmapper.
      Specified by:
      getPort in interface Nfs<Nfs3File>
    • getMountPort

      public int getMountPort()
      Description copied from interface: Nfs
      Return the configured MOUNT TCP destination port, or the last discovered MOUNT port. This method performs no network calls. A return value of 0 means unknown, for example when a supplied root handle has avoided MOUNT service discovery. The default preserves compatibility with existing Nfs implementations.
      Specified by:
      getMountPort in interface Nfs<Nfs3File>
      Returns:
      the MOUNT port, or 0 if unknown
    • getRootFileHandle

      public byte[] getRootFileHandle()
      Returns the root file handle of the exported filesystem, for debugging and naked API calls.
      Specified by:
      getRootFileHandle in interface Nfs<Nfs3File>
    • getServer

      public String getServer()
      Returns the address of the machine hosting the NFS server.
      Specified by:
      getServer in interface Nfs<Nfs3File>
    • nullCall

      public Xdr nullCall() throws IOException
      Procedure NULL does not do any work. It is made available to allow server response testing and timing. For details, see RFC 1813 (https://tools.ietf.org/html/rfc1813).
      Specified by:
      nullCall in interface Nfs<Nfs3File>
      Returns:
      the returned Xdr
      Throws:
      IOException
    • makeGetAttrRequest

      public Nfs3GetAttrRequest makeGetAttrRequest(byte[] fileHandle) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure GETATTR retrieves the attributes for a specified file system object. The object is identified by the file handle that the server returned as part of the response from a LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD, or READDIRPLUS procedure (or from the MOUNT service, described elsewhere).

      Specified by:
      makeGetAttrRequest in interface Nfs<Nfs3File>
      Parameters:
      fileHandle - The file handle of an object whose attributes are to be retrieved.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • getAttr

      public Nfs3GetAttrResponse getAttr(NfsGetAttrRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure GETATTR retrieves the attributes for a specified file system object. The object is identified by the file handle that the server returned as part of the response from a LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD, or READDIRPLUS procedure (or from the MOUNT service, described elsewhere).

      Specified by:
      getAttr in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_getAttr

      public Nfs3GetAttrResponse wrapped_getAttr(NfsGetAttrRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure GETATTR retrieves the attributes for a specified file system object. The object is identified by the file handle that the server returned as part of the response from a LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD, or READDIRPLUS procedure (or from the MOUNT service, described elsewhere).

      Specified by:
      wrapped_getAttr in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • makeSetAttrRequest

      public NfsSetAttrRequest makeSetAttrRequest(byte[] fileHandle, NfsSetAttributes attributes, NfsTime guardTime) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure SETATTR changes one or more of the attributes of a file system object on the server.

      Specified by:
      makeSetAttrRequest in interface Nfs<Nfs3File>
      Parameters:
      fileHandle - The file handle for the object.
      attributes - The attributes to set.
      guardTime - If guardTime is not null, the server must compare the value of guardTime to the current ctime of the object. If the values are different, the server must preserve the object attributes and must return a status of NFS3ERR_NOT_SYNC.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • setAttr

      public Nfs3SetAttrResponse setAttr(NfsSetAttrRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure SETATTR changes one or more of the attributes of a file system object on the server.

      Specified by:
      setAttr in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_setAttr

      public Nfs3SetAttrResponse wrapped_setAttr(NfsSetAttrRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure SETATTR changes one or more of the attributes of a file system object on the server.

      Specified by:
      wrapped_setAttr in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • makeLookupRequest

      public Nfs3LookupRequest makeLookupRequest(byte[] fileHandle, String name) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure LOOKUP searches a directory for a specific name and returns the file handle for the corresponding file system object.

      Specified by:
      makeLookupRequest in interface Nfs<Nfs3File>
      Parameters:
      fileHandle - The file handle for the directory to search.
      name - The filename to be searched for.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • getLookup

      public Nfs3LookupResponse getLookup(NfsLookupRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure LOOKUP searches a directory for a specific name and returns the file handle for the corresponding file system object.

      Specified by:
      getLookup in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_getLookup

      public Nfs3LookupResponse wrapped_getLookup(NfsLookupRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure LOOKUP searches a directory for a specific name and returns the file handle for the corresponding file system object.

      Specified by:
      wrapped_getLookup in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • makeAccessRequest

      public Nfs3AccessRequest makeAccessRequest(byte[] fileHandle, long accessToCheck) throws FileNotFoundException
      Creates the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure ACCESS determines the access rights that a user, as identified by the credentials in the request, has with respect to a file system object. The client encodes the set of permissions that are to be checked in a bit mask. The server checks the permissions encoded in the bit mask. A status of NFS3_OK is returned along with a bit mask encoded with the permissions that the client is allowed.

      The results of this procedure are necessarily advisory in nature. That is, a return status of NFS3_OK and the appropriate bit set in the bit mask does not imply that such access will be allowed to the file system object in the future, as access rights can be revoked by the server at any time.

      Specified by:
      makeAccessRequest in interface Nfs<Nfs3File>
      Parameters:
      fileHandle - The file handle for the file system object to which access is to be checked.
      accessToCheck - A bit mask of access permissions to check, as specified below.
      ACCESS3_READ    = 0x0001 - Read data from file or read a directory.
      ACCESS3_LOOKUP  = 0x0002 - Look up a name in a directory (no meaning for non-directory objects).
      ACCESS3_MODIFY  = 0x0004 - Rewrite existing file data or modify existing directory entries.
      ACCESS3_EXTEND  = 0x0008 - Write new data or add directory entries.
      ACCESS3_DELETE  = 0x0010 - Delete an existing directory entry.
      ACCESS3_EXECUTE = 0x0020 - Execute file (no meaning for a directory).
                 
      Returns:
      the request
      Throws:
      FileNotFoundException
    • getAccess

      public Nfs3AccessResponse getAccess(NfsAccessRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure ACCESS determines the access rights that a user, as identified by the credentials in the request, has with respect to a file system object. The client encodes the set of permissions that are to be checked in a bit mask. The server checks the permissions encoded in the bit mask. A status of NFS3_OK is returned along with a bit mask encoded with the permissions that the client is allowed.

      The results of this procedure are necessarily advisory in nature. That is, a return status of NFS3_OK and the appropriate bit set in the bit mask does not imply that such access will be allowed to the file system object in the future, as access rights can be revoked by the server at any time.

      Specified by:
      getAccess in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_getAccess

      public Nfs3AccessResponse wrapped_getAccess(NfsAccessRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure ACCESS determines the access rights that a user, as identified by the credentials in the request, has with respect to a file system object. The client encodes the set of permissions that are to be checked in a bit mask. The server checks the permissions encoded in the bit mask. A status of NFS3_OK is returned along with a bit mask encoded with the permissions that the client is allowed.

      The results of this procedure are necessarily advisory in nature. That is, a return status of NFS3_OK and the appropriate bit set in the bit mask does not imply that such access will be allowed to the file system object in the future, as access rights can be revoked by the server at any time.

      Specified by:
      wrapped_getAccess in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • makeReadlinkRequest

      public Nfs3ReadlinkRequest makeReadlinkRequest(byte[] fileHandle) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      This method reads the data associated with a symbolic link. The data is an ASCII string that is opaque to the server. That is, whether created by the NFS version 3 protocol software from a client or created locally on the server, the data in a symbolic link is not interpreted when created, but is simply stored.

      A symbolic link is nominally a pointer to another file. The data is not necessarily interpreted by the server, just stored in the file. It is possible for a client implementation to store a path name that is not meaningful to the server operating system in a symbolic link. A READLINK operation returns the data to the client for interpretation. If different implementations want to share access to symbolic links, then they must agree on the interpretation of the data in the symbolic link.

      Specified by:
      makeReadlinkRequest in interface Nfs<Nfs3File>
      Parameters:
      fileHandle - the fileHandle for the symbolic link
      Returns:
      the request
      Throws:
      FileNotFoundException
    • getReadlink

      public Nfs3ReadlinkResponse getReadlink(NfsReadlinkRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      This method reads the data associated with a symbolic link. The data is an ASCII string that is opaque to the server. That is, whether created by the NFS version 3 protocol software from a client or created locally on the server, the data in a symbolic link is not interpreted when created, but is simply stored.

      A symbolic link is nominally a pointer to another file. The data is not necessarily interpreted by the server, just stored in the file. It is possible for a client implementation to store a path name that is not meaningful to the server operating system in a symbolic link. A READLINK operation returns the data to the client for interpretation. If different implementations want to share access to symbolic links, then they must agree on the interpretation of the data in the symbolic link.

      Specified by:
      getReadlink in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_getReadlink

      public Nfs3ReadlinkResponse wrapped_getReadlink(NfsReadlinkRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      This method reads the data associated with a symbolic link. The data is an ASCII string that is opaque to the server. That is, whether created by the NFS version 3 protocol software from a client or created locally on the server, the data in a symbolic link is not interpreted when created, but is simply stored.

      A symbolic link is nominally a pointer to another file. The data is not necessarily interpreted by the server, just stored in the file. It is possible for a client implementation to store a path name that is not meaningful to the server operating system in a symbolic link. A READLINK operation returns the data to the client for interpretation. If different implementations want to share access to symbolic links, then they must agree on the interpretation of the data in the symbolic link.

      Specified by:
      wrapped_getReadlink in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • makeReadRequest

      public Nfs3ReadRequest makeReadRequest(byte[] fileHandle, long offset, int size) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure READ reads data from a file.

      Specified by:
      makeReadRequest in interface Nfs<Nfs3File>
      Parameters:
      fileHandle - The file handle of the file from which data is to be read. This must identify a file system object of type, NF3REG.
      offset - The position within the file at which the read is to begin. An offset of 0 means to read data starting at the beginning of the file. If offset is greater than or equal to the size of the file, the status, NFS3_OK, is returned with size set to 0 and eof set to true, subject to access permissions checking.
      size - The number of bytes of data that are to be read. If size is 0, the READ will succeed and return 0 bytes of data, subject to access permissions checking. size must be less than or equal to the value of the rtmax field in the FSINFO reply structure for the file system that contains file. If greater, the server may return only rtmax bytes, resulting in a short read.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • getRead

      public Nfs3ReadResponse getRead(NfsReadRequest request, byte[] bytes, int position) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure READ reads data from a file.

      Specified by:
      getRead in interface Nfs<Nfs3File>
      Parameters:
      bytes - optional externally provided buffer - if not provided, the method will create a new, empty buffer for receiving the data.
      position - position to start writing, defaults to 0 if buffer is null
      Returns:
      the response
      Throws:
      IOException
    • wrapped_getRead

      public Nfs3ReadResponse wrapped_getRead(NfsReadRequest request, byte[] bytes, int position) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure READ reads data from a file.

      Specified by:
      wrapped_getRead in interface Nfs<Nfs3File>
      Parameters:
      bytes - optional externally provided buffer - if not provided, the method will create a new, empty buffer for receiving the data.
      position - position to start writing, defaults to 0 if buffer is null
      Returns:
      the response
      Throws:
      IOException
    • makeWriteRequest

      public Nfs3WriteRequest makeWriteRequest(byte[] fileHandle, long offset, List<ByteBuffer> payload, int syncType) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure WRITE writes data to a file.

      Specified by:
      makeWriteRequest in interface Nfs<Nfs3File>
      Parameters:
      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.
      • UNSTABLE = 0 - Best effort, no promises.
      • DATA_SYNC = 1 - Commit all data to stable storage, plus enough metadata for retrieval, before returning.
      • FILE_SYNC = 2 - Commit all data and metadata to stable storage before returning.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendWrite

      public Nfs3WriteResponse sendWrite(NfsWriteRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure WRITE writes data to a file.

      Specified by:
      sendWrite in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendWrite

      public Nfs3WriteResponse wrapped_sendWrite(NfsWriteRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure WRITE writes data to a file.

      Specified by:
      wrapped_sendWrite in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendWrite

      public Nfs3WriteResponse wrapped_sendWrite(NfsWriteRequest request, Long verifier) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure WRITE writes data to a file.

      Specified by:
      wrapped_sendWrite in interface Nfs<Nfs3File>
      Parameters:
      verifier - This is a cookie, previously returned from the server, that the client can use to determine whether the server has changed state between a call to WRITE and a subsequent call to either WRITE or COMMIT.
      Returns:
      the response
      Throws:
      IOException
    • makeCreateRequest

      public Nfs3CreateRequest makeCreateRequest(NfsCreateMode createMode, byte[] parentDirectoryFileHandle, String name, NfsSetAttributes attributes, byte[] verifier) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure CREATE creates a regular file.

      Specified by:
      makeCreateRequest in interface Nfs<Nfs3File>
      Parameters:
      createMode - The instance describing how the file is to be created. UNCHECKED means that the file should be created without checking for the existence of a duplicate file in the same directory. In this case, how.obj_attributes is a sattr3 describing the initial attributes for the file. GUARDED specifies that the server should check for the presence of a duplicate file before performing the create and should fail the request with NFS3ERR_EXIST if a duplicate file exists. If the file does not exist, the request is performed as described for UNCHECKED. EXCLUSIVE specifies that the server is to follow exclusive creation semantics, using the verifier to ensure exclusive creation of the target. No attributes may be provided in this case, since the server may use the target file metadata to store the createverf3 verifier.
      parentDirectoryFileHandle - The file handle for the directory in which the file is to be created.
      name - The name that is to be associated with the created file.
      attributes - the initial attributes for the new file.
      verifier - A unique identifier to ensure exclusive creation of the new file. If no value is provided for exclusive creation, this is generated.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendCreate

      public Nfs3CreateResponse sendCreate(NfsCreateRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure CREATE creates a regular file.

      Specified by:
      sendCreate in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendCreate

      public Nfs3CreateResponse wrapped_sendCreate(NfsCreateRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure CREATE creates a regular file.

      Specified by:
      wrapped_sendCreate in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • makeMkdirRequest

      public Nfs3MkdirRequest makeMkdirRequest(byte[] parentDirectoryFileHandle, String name, NfsSetAttributes attributes) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure MKDIR creates a new subdirectory.

      Specified by:
      makeMkdirRequest in interface Nfs<Nfs3File>
      Parameters:
      parentDirectoryFileHandle - The file handle for the directory in which the subdirectory is to be created.
      name - The name that is to be associated with the created subdirectory.
      attributes - The initial attributes for the subdirectory.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendMkdir

      public Nfs3MkdirResponse sendMkdir(NfsMkdirRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure MKDIR creates a new subdirectory.

      Specified by:
      sendMkdir in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendMkdir

      public Nfs3MkdirResponse wrapped_sendMkdir(NfsMkdirRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure MKDIR creates a new subdirectory.

      Specified by:
      wrapped_sendMkdir in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • makeSymlinkRequest

      public Nfs3SymlinkRequest makeSymlinkRequest(String symbolicLinkData, byte[] parentDirectoryFileHandle, String name, NfsSetAttributes attributes) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure SYMLINK creates a new symbolic link.

      Specified by:
      makeSymlinkRequest in interface Nfs<Nfs3File>
      Parameters:
      symbolicLinkData - The string containing the symbolic link data.
      parentDirectoryFileHandle - The file handle for the directory in which the symbolic link is to be created.
      name - The name that is to be associated with the created symbolic link.
      attributes - The initial attributes for the symbolic link.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendSymlink

      public Nfs3SymlinkResponse sendSymlink(NfsSymlinkRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure SYMLINK creates a new symbolic link.

      Specified by:
      sendSymlink in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendSymlink

      public Nfs3SymlinkResponse wrapped_sendSymlink(NfsSymlinkRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure SYMLINK creates a new symbolic link.

      Specified by:
      wrapped_sendSymlink in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • makeMknodRequest

      public Nfs3MknodRequest makeMknodRequest(byte[] parentDirectoryFileHandle, String name, NfsType type, NfsSetAttributes attributes, long[] rdev) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure MKNOD creates a new special file of the type, type . Special files can be device files or named pipes.

      Specified by:
      makeMknodRequest in interface Nfs<Nfs3File>
      Parameters:
      parentDirectoryFileHandle - The file handle for the directory in which the special file is to be created.
      name - The name that is to be associated with the created special file.
      type - The type of the object to be created.
      attributes - The initial attributes for the special file.
      rdev - When creating a character special file (type is NF3CHR) or a block special file ( type is NF3BLK), rdev[0] is the major number and rdev[1] is the minor number.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendMknod

      public Nfs3MknodResponse sendMknod(NfsMknodRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure MKNOD creates a new special file of the type, type . Special files can be device files or named pipes.

      Specified by:
      sendMknod in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendMknod

      public Nfs3MknodResponse wrapped_sendMknod(NfsMknodRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure MKNOD creates a new special file of the type, type . Special files can be device files or named pipes.

      Specified by:
      wrapped_sendMknod in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • makeRemoveRequest

      public Nfs3RemoveRequest makeRemoveRequest(byte[] parentDirectoryFileHandle, String name) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure REMOVE removes (deletes) an entry from a directory. If the entry in the directory was the last reference to the corresponding file system object, the object may be destroyed.

      Specified by:
      makeRemoveRequest in interface Nfs<Nfs3File>
      Parameters:
      parentDirectoryFileHandle - The file handle for the directory from which the entry is to be removed.
      name - The name of the entry to be removed.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendRemove

      public Nfs3RemoveResponse sendRemove(NfsRemoveRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure REMOVE removes (deletes) an entry from a directory. If the entry in the directory was the last reference to the corresponding file system object, the object may be destroyed.

      Specified by:
      sendRemove in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendRemove

      public Nfs3RemoveResponse wrapped_sendRemove(NfsRemoveRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure REMOVE removes (deletes) an entry from a directory. If the entry in the directory was the last reference to the corresponding file system object, the object may be destroyed.

      Specified by:
      wrapped_sendRemove in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • makeRmdirRequest

      public Nfs3RmdirRequest makeRmdirRequest(byte[] parentDirectoryFileHandle, String name) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure RMDIR removes (deletes) a subdirectory from a directory. If the directory entry of the subdirectory is the last reference to the subdirectory, the subdirectory may be destroyed.

      Specified by:
      makeRmdirRequest in interface Nfs<Nfs3File>
      Parameters:
      parentDirectoryFileHandle - The file handle for the directory from which the subdirectory is to be removed.
      name - The name of the subdirectory to be removed.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendRmdir

      public Nfs3RmdirResponse sendRmdir(NfsRmdirRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure RMDIR removes (deletes) a subdirectory from a directory. If the directory entry of the subdirectory is the last reference to the subdirectory, the subdirectory may be destroyed.

      Specified by:
      sendRmdir in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendRmdir

      public Nfs3RmdirResponse wrapped_sendRmdir(NfsRmdirRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure RMDIR removes (deletes) a subdirectory from a directory. If the directory entry of the subdirectory is the last reference to the subdirectory, the subdirectory may be destroyed.

      Specified by:
      wrapped_sendRmdir in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • makeRenameRequest

      public Nfs3RenameRequest makeRenameRequest(byte[] fromDirectoryFileHandle, String fromName, byte[] toDirectoryFileHandle, String toName) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure RENAME renames the file identified by name in the directory, fileHandle, to toName in the directory, toFileHandle. The operation is required to be atomic to the client. toFileHandle and fileHandle must reside on the same file system and server.

      Specified by:
      makeRenameRequest in interface Nfs<Nfs3File>
      Parameters:
      fromDirectoryFileHandle - The file handle for the directory from which the entry is to be renamed
      fromName - The name of the entry that identifies the object to be renamed
      toDirectoryFileHandle - The file handle for the directory to which the object is to be renamed.
      toName - The new name for the object.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendRename

      public Nfs3RenameResponse sendRename(NfsRenameRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure RENAME renames the file identified by name in the directory, fileHandle, to toName in the directory, toFileHandle. The operation is required to be atomic to the client. toFileHandle and fileHandle must reside on the same file system and server.

      Specified by:
      sendRename in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendRename

      public Nfs3RenameResponse wrapped_sendRename(NfsRenameRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure RENAME renames the file identified by name in the directory, fileHandle, to toName in the directory, toFileHandle. The operation is required to be atomic to the client. toFileHandle and fileHandle must reside on the same file system and server.

      Specified by:
      wrapped_sendRename in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • makeLinkRequest

      public Nfs3LinkRequest makeLinkRequest(byte[] fileHandle, byte[] parentDirectoryFileHandle, String name) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure LINK creates a hard link from fileHandle to name, in the directory, parentDirectoryFileHandle. fileHandle and parentDirectoryFileHandle must reside on the same file system and server.

      Specified by:
      makeLinkRequest in interface Nfs<Nfs3File>
      Parameters:
      fileHandle - The file handle for the existing file system object.
      parentDirectoryFileHandle - The file handle for the directory in which the link is to be created.
      name - The name that is to be associated with the created link.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendLink

      public Nfs3LinkResponse sendLink(NfsLinkRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure LINK creates a hard link from fileHandle to name, in the directory, parentDirectoryFileHandle. fileHandle and parentDirectoryFileHandle must reside on the same file system and server.

      Specified by:
      sendLink in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendLink

      public Nfs3LinkResponse wrapped_sendLink(NfsLinkRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure LINK creates a hard link from fileHandle to name, in the directory, parentDirectoryFileHandle. fileHandle and parentDirectoryFileHandle must reside on the same file system and server.

      Specified by:
      wrapped_sendLink in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • makeReaddirRequest

      public NfsReaddirRequest makeReaddirRequest(byte[] directoryFileHandle, long cookie, long cookieverf, int count) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure READDIR retrieves a variable number of entries, in sequence, from a directory and returns the name and file identifier for each, with information to allow the client to request additional directory entries in a subsequent READDIR request.

      Specified by:
      makeReaddirRequest in interface Nfs<Nfs3File>
      Parameters:
      directoryFileHandle - The file handle for the directory to be read.
      cookie - This should be set to 0 in the first request to read the directory. On subsequent requests, it should be a cookie as returned by the server.
      cookieverf - This should be set to 0 in the first request to read the directory. On subsequent requests, it should be a cookieverf as returned by the server. The cookieverf must match that returned by the READDIR in which the cookie was acquired.
      count - The maximum size of the READDIR3resok structure, in bytes. The size must include all XDR overhead. The server is free to return less than count bytes of data.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • getReaddir

      public Nfs3ReaddirResponse getReaddir(NfsReaddirRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure READDIR retrieves a variable number of entries, in sequence, from a directory and returns the name and file identifier for each, with information to allow the client to request additional directory entries in a subsequent READDIR request.

      Specified by:
      getReaddir in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_getReaddir

      public Nfs3ReaddirResponse wrapped_getReaddir(NfsReaddirRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure READDIR retrieves a variable number of entries, in sequence, from a directory and returns the name and file identifier for each, with information to allow the client to request additional directory entries in a subsequent READDIR request.

      Specified by:
      wrapped_getReaddir in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_getReaddir

      public Nfs3ReaddirResponse wrapped_getReaddir(NfsReaddirRequest request, List<NfsDirectoryEntry> entries) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure READDIR retrieves a variable number of entries, in sequence, from a directory and returns the name and file identifier for each, with information to allow the client to request additional directory entries in a subsequent READDIR request.

      Specified by:
      wrapped_getReaddir in interface Nfs<Nfs3File>
      Parameters:
      entries - A list of entries to which the returned entries should be appended.
      Returns:
      the response
      Throws:
      IOException
    • makeReaddirplusRequest

      public NfsReaddirplusRequest makeReaddirplusRequest(byte[] directoryFileHandle, long cookie, long cookieverf, int dircount, int maxcount) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure READDIRPLUS retrieves a variable number of entries from a file system directory and returns complete information about each along with information to allow the client to request additional directory entries in a subsequent READDIRPLUS. READDIRPLUS differs from READDIR only in the amount of information returned for each entry. In READDIR, each entry returns the filename and the fileid. In READDIRPLUS, each entry returns the name, the fileid, attributes (including the fileid), and file handle.

      Specified by:
      makeReaddirplusRequest in interface Nfs<Nfs3File>
      Parameters:
      directoryFileHandle - The file handle for the directory to be read.
      cookie - This should be set to 0 in the first request to read the directory. On subsequent requests, it should be a cookie as returned by the server.
      cookieverf - This should be set to 0 in the first request to read the directory. On subsequent requests, it should be a cookieverf as returned by the server. The cookieverf must match that returned by the READDIRPLUS in which the cookie was acquired.
      dircount - The maximum number of bytes of directory information returned. This number should not include the size of the attributes and file handle portions of the result.
      maxcount - The maximum size of the READDIRPLUS3resok structure, in bytes. The size must include all XDR overhead. The server is free to return less than maxcount bytes of data.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • getReaddirplus

      public Nfs3ReaddirplusResponse getReaddirplus(NfsReaddirplusRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure READDIRPLUS retrieves a variable number of entries from a file system directory and returns complete information about each along with information to allow the client to request additional directory entries in a subsequent READDIRPLUS. READDIRPLUS differs from READDIR only in the amount of information returned for each entry. In READDIR, each entry returns the filename and the fileid. In READDIRPLUS, each entry returns the name, the fileid, attributes (including the fileid), and file handle.

      Specified by:
      getReaddirplus in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_getReaddirplus

      public Nfs3ReaddirplusResponse wrapped_getReaddirplus(NfsReaddirplusRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure READDIRPLUS retrieves a variable number of entries from a file system directory and returns complete information about each along with information to allow the client to request additional directory entries in a subsequent READDIRPLUS. READDIRPLUS differs from READDIR only in the amount of information returned for each entry. In READDIR, each entry returns the filename and the fileid. In READDIRPLUS, each entry returns the name, the fileid, attributes (including the fileid), and file handle.

      Specified by:
      wrapped_getReaddirplus in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_getReaddirplus

      public Nfs3ReaddirplusResponse wrapped_getReaddirplus(NfsReaddirplusRequest request, List<NfsDirectoryPlusEntry> entries) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure READDIRPLUS retrieves a variable number of entries from a file system directory and returns complete information about each along with information to allow the client to request additional directory entries in a subsequent READDIRPLUS. READDIRPLUS differs from READDIR only in the amount of information returned for each entry. In READDIR, each entry returns the filename and the fileid. In READDIRPLUS, each entry returns the name, the fileid, attributes (including the fileid), and file handle.

      Specified by:
      wrapped_getReaddirplus in interface Nfs<Nfs3File>
      Parameters:
      entries - A list of entries to which the returned entries should be appended.
      Returns:
      the response
      Throws:
      IOException
    • getNfsFsStat

      public NfsFsStat getNfsFsStat() throws IOException
      Procedure FSSTAT retrieves volatile file system state information, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813), using the root handle for the exported filesystem.
      Specified by:
      getNfsFsStat in interface Nfs<Nfs3File>
      Returns:
      the data
      Throws:
      IOException
    • makeFsStatRequest

      public Nfs3FsStatRequest makeFsStatRequest(byte[] fileHandle) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure FSSTAT retrieves volatile file system state information.

      Specified by:
      makeFsStatRequest in interface Nfs<Nfs3File>
      Parameters:
      fileHandle - A file handle identifying a object in the file system. This is normally a file handle for a mount point for a file system, as originally obtained from the MOUNT service on the server.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • makeFsStatRequest

      public Nfs3FsStatRequest makeFsStatRequest() throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This method uses the root file handle for this client.

      Procedure FSSTAT retrieves volatile file system state information.

      Specified by:
      makeFsStatRequest in interface Nfs<Nfs3File>
      Returns:
      the request
      Throws:
      FileNotFoundException
    • getFsStat

      public Nfs3FsStatResponse getFsStat(NfsFsStatRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure FSSTAT retrieves volatile file system state information.

      Specified by:
      getFsStat in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_getFsStat

      public Nfs3FsStatResponse wrapped_getFsStat(NfsFsStatRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure FSSTAT retrieves volatile file system state information.

      Specified by:
      wrapped_getFsStat in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • getNfsFsInfo

      public NfsFsInfo getNfsFsInfo() throws IOException
      Procedure FSINFO retrieves nonvolatile file system state information and general information about the NFS version 3 protocol server implementation, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813), using the root handle for the exported filesystem.
      Specified by:
      getNfsFsInfo in interface Nfs<Nfs3File>
      Returns:
      the data
      Throws:
      IOException
    • makeFsInfoRequest

      public Nfs3FsInfoRequest makeFsInfoRequest(byte[] fileHandle) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure FSINFO retrieves nonvolatile file system state information and general information about the NFS version 3 protocol server implementation.

      Specified by:
      makeFsInfoRequest in interface Nfs<Nfs3File>
      Parameters:
      fileHandle - A file handle identifying a file object. Normal usage is to provide a file handle for a mount point for a file system, as originally obtained from the MOUNT service on the server.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • makeFsInfoRequest

      public Nfs3FsInfoRequest makeFsInfoRequest() throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This method uses the root file handle for this client.

      Procedure FSINFO retrieves nonvolatile file system state information and general information about the NFS version 3 protocol server implementation.

      Specified by:
      makeFsInfoRequest in interface Nfs<Nfs3File>
      Returns:
      the request
      Throws:
      FileNotFoundException
    • getFsInfo

      public Nfs3FsInfoResponse getFsInfo(NfsFsInfoRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure FSINFO retrieves nonvolatile file system state information and general information about the NFS version 3 protocol server implementation.

      Specified by:
      getFsInfo in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_getFsInfo

      public Nfs3FsInfoResponse wrapped_getFsInfo(NfsFsInfoRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure FSINFO retrieves nonvolatile file system state information and general information about the NFS version 3 protocol server implementation.

      Specified by:
      wrapped_getFsInfo in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • makePathconfRequest

      public Nfs3PathconfRequest makePathconfRequest(byte[] fileHandle) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure PATHCONF retrieves the pathconf information for a file or directory. If the FSF_HOMOGENEOUS bit is set in FSFINFO3resok.properties, the pathconf information will be the same for all files and directories in the exported file system in which this file or directory resides.

      Specified by:
      makePathconfRequest in interface Nfs<Nfs3File>
      Parameters:
      fileHandle - The file handle for the file system object.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • getPathconf

      public Nfs3PathconfResponse getPathconf(NfsPathconfRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure PATHCONF retrieves the pathconf information for a file or directory. If the FSF_HOMOGENEOUS bit is set in FSFINFO3resok.properties, the pathconf information will be the same for all files and directories in the exported file system in which this file or directory resides.

      Specified by:
      getPathconf in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_getPathconf

      public Nfs3PathconfResponse wrapped_getPathconf(NfsPathconfRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure PATHCONF retrieves the pathconf information for a file or directory. If the FSF_HOMOGENEOUS bit is set in FSFINFO3resok.properties, the pathconf information will be the same for all files and directories in the exported file system in which this file or directory resides.

      Specified by:
      wrapped_getPathconf in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • makeCommitRequest

      public Nfs3CommitRequest makeCommitRequest(byte[] fileHandle, long offsetToCommit, int dataSizeToCommit) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure COMMIT forces or flushes data to stable storage that was previously written with a WRITE procedure call with the stable field set to UNSTABLE.

      Specified by:
      makeCommitRequest in interface Nfs<Nfs3File>
      Parameters:
      fileHandle - The file handle for the file to which data is to be flushed (committed). This must identify a file system object of type, NF3REG.
      offsetToCommit - The position within the file at which the flush is to begin. An offset of 0 means to flush data starting at the beginning of the file.
      dataSizeToCommit - The number of bytes of data to flush. If count is 0, a flush from offset to the end of file is done.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendCommit

      public Nfs3CommitResponse sendCommit(NfsCommitRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure COMMIT forces or flushes data to stable storage that was previously written with a WRITE procedure call with the stable field set to UNSTABLE.

      Specified by:
      sendCommit in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendCommit

      public Nfs3CommitResponse wrapped_sendCommit(NfsCommitRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure COMMIT forces or flushes data to stable storage that was previously written with a WRITE procedure call with the stable field set to UNSTABLE.

      Specified by:
      wrapped_sendCommit in interface Nfs<Nfs3File>
      Returns:
      the response
      Throws:
      IOException
    • read

      public int read(String path, byte[] fileHandle, long offset, int length, byte[] data, int pos, org.apache.commons.lang3.mutable.MutableBoolean eof) throws IOException
      Read data from a file handle
      Parameters:
      path - the path of the file
      fileHandle - file handle of the file
      offset - offset of the file to read
      length - the length of the data buffer
      data - the data to be returned
      eof - is at the end-of-file
      Returns:
      The number of bytes of data returned by the read. the number may be smaller than len
      Throws:
      IOException
    • fsync

      public void fsync(String path, byte[] fh, Long verifier) throws IOException
      Throws:
      IOException