Class NfsTime

java.lang.Object
com.emc.ecs.nfsclient.nfs.NfsTime
All Implemented Interfaces:
NfsRequest, NfsResponse

public class NfsTime extends Object implements NfsRequest, NfsResponse
NFS time getter and setter handling, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final NfsTime
    This constant is the NfsTime passed to setters to indicate that the time should not be changed.
    static final NfsTime
    This constant is the NfsTime passed to setters to indicate that the time should be reset to the current server time.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new NfsTime for the current time.
    NfsTime(long milliseconds)
    Create a new NfsTime for the setting time corresponding to milliseconds.
    NfsTime(long milliseconds, boolean isSettingTime)
    Create a new NfsTime for the setting or guard time corresponding to milliseconds.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns time in milliseconds, same as java.util.Calendar.
    boolean
    Returns true if this is a bare time (with no time setting type), false otherwise.
    void
    Transfer data to an Xdr object for RPC use.
    void
    Transfer data from an Xdr object after RPC use.

    Methods inherited from class Object

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

    • DO_NOT_CHANGE

      public static final NfsTime DO_NOT_CHANGE
      This constant is the NfsTime passed to setters to indicate that the time should not be changed.
    • SET_TO_CURRENT_ON_SERVER

      public static final NfsTime SET_TO_CURRENT_ON_SERVER
      This constant is the NfsTime passed to setters to indicate that the time should be reset to the current server time.
  • Constructor Details

    • NfsTime

      public NfsTime()
      Create a new NfsTime for the current time.
    • NfsTime

      public NfsTime(long milliseconds)
      Create a new NfsTime for the setting time corresponding to milliseconds.
      Parameters:
      milliseconds - same as for java.util.Date.
    • NfsTime

      public NfsTime(long milliseconds, boolean isSettingTime)
      Create a new NfsTime for the setting or guard time corresponding to milliseconds.
      Parameters:
      milliseconds - same as for java.util.Date.
      isSettingTime - true if the time is to be used for setting a value, false if not (e.g., guard time)
  • Method Details

    • isBareTime

      public boolean isBareTime()
      Returns true if this is a bare time (with no time setting type), false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • marshalling

      public void marshalling(Xdr xdr)
      Transfer data to an Xdr object for RPC use. The format is specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      Specified by:
      marshalling in interface NfsRequest
      Parameters:
      xdr - the Xdr to be sent.
    • unmarshalling

      public void unmarshalling(Xdr xdr)
      Transfer data from an Xdr object after RPC use. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      Specified by:
      unmarshalling in interface NfsResponse
      Parameters:
      xdr - the returned Xdr.
    • getTimeInMillis

      public long getTimeInMillis()
      Returns time in milliseconds, same as java.util.Calendar.