Class MastershipBasedTimestamp

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

    public final class MastershipBasedTimestamp
    extends 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.
    • 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 Comparable<org.onosproject.store.Timestamp>
      • hashCode

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

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

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

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