Class ClockBackwardsException

All Implemented Interfaces:
Serializable

public class ClockBackwardsException extends CosIdException
Exception thrown when system clock moves backwards.

Indicates that the current system time is less than the last timestamp used for ID generation, which could cause ID duplication.

See Also:
  • Constructor Details

    • ClockBackwardsException

      public ClockBackwardsException(long lastTimestamp, long currentTimestamp)
      Creates a new exception.
      Parameters:
      lastTimestamp - the last generated timestamp
      currentTimestamp - the current system timestamp
  • Method Details

    • getLastTimestamp

      public long getLastTimestamp()
      Gets the last timestamp.
      Returns:
      the last timestamp
    • getCurrentTimestamp

      public long getCurrentTimestamp()
      Gets the current timestamp.
      Returns:
      the current timestamp