Class MastershipBasedTimestamp

  • All Implemented Interfaces:
    java.lang.Comparable<org.onosproject.store.Timestamp>, org.onosproject.store.Timestamp

    public final class MastershipBasedTimestamp
    extends java.lang.Object
    implements org.onosproject.store.Timestamp
    A logical timestamp that derives its value from two things:
    • The current mastership term of the device.
    • The value of the counter used for tracking topology events observed from the device during that current time of a device.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(org.onosproject.store.Timestamp o)  
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      long sequenceNumber()
      Returns the sequenceNumber number.
      long termNumber()
      Returns the termNumber.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.onosproject.store.Timestamp

        isNewerThan, isOlderThan
    • Constructor Detail

      • MastershipBasedTimestamp

        protected MastershipBasedTimestamp()
        Default constructor for serialization.
      • MastershipBasedTimestamp

        public MastershipBasedTimestamp​(long termNumber,
                                        long sequenceNumber)
        Default version tuple.
        Parameters:
        termNumber - the mastership termNumber
        sequenceNumber - the sequenceNumber number within the termNumber
    • Method Detail

      • compareTo

        public int compareTo​(org.onosproject.store.Timestamp o)
        Specified by:
        compareTo in interface java.lang.Comparable<org.onosproject.store.Timestamp>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface org.onosproject.store.Timestamp
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface org.onosproject.store.Timestamp
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • termNumber

        public long termNumber()
        Returns the termNumber.
        Returns:
        termNumber
      • sequenceNumber

        public long sequenceNumber()
        Returns the sequenceNumber number.
        Returns:
        sequenceNumber