Class Recovery

  • All Implemented Interfaces:
    java.io.Serializable, scala.Equals, scala.Product

    public final class Recovery
    extends java.lang.Object
    implements scala.Product, java.io.Serializable
    Recovery mode configuration object to be returned in PersistenceRecovery.recovery().

    By default recovers from latest snapshot replays through to the last available event (last sequenceId).

    Recovery will start from a snapshot if the persistent actor has previously saved one or more snapshots and at least one of these snapshots matches the specified fromSnapshot criteria. Otherwise, recovery will start from scratch by replaying all stored events.

    If recovery starts from a snapshot, the persistent actor is offered that snapshot with a SnapshotOffer message, followed by replayed messages, if any, that are younger than the snapshot, up to the specified upper sequence number bound (toSequenceNr).

    param: fromSnapshot criteria for selecting a saved snapshot from which recovery should start. Default is latest (= youngest) snapshot. param: toSequenceNr upper sequence number bound (inclusive) for recovery. Default is no upper bound. param: replayMax maximum number of messages to replay. Default is no limit.

    See Also:
    Serialized Form
    • Method Detail

      • $lessinit$greater$default$2

        public static long $lessinit$greater$default$2()
      • $lessinit$greater$default$3

        public static long $lessinit$greater$default$3()
      • create

        public static Recovery create​(long toSequenceNr)
        Java API
        See Also:
        Recovery
      • none

        public static Recovery none()
        Convenience method for skipping recovery in PersistentActor.

        It will still retrieve previously highest sequence number so that new events are persisted with higher sequence numbers rather than starting from 1 and assuming that there are no previous event with that sequence number.

        See Also:
        Recovery
      • apply$default$2

        public static long apply$default$2()
      • apply$default$3

        public static long apply$default$3()
      • toSequenceNr

        public long toSequenceNr()
      • replayMax

        public long replayMax()
      • copy$default$2

        public long copy$default$2()
      • copy$default$3

        public long copy$default$3()
      • productPrefix

        public java.lang.String productPrefix()
        Specified by:
        productPrefix in interface scala.Product
      • productArity

        public int productArity()
        Specified by:
        productArity in interface scala.Product
      • productElement

        public java.lang.Object productElement​(int x$1)
        Specified by:
        productElement in interface scala.Product
      • productIterator

        public scala.collection.Iterator<java.lang.Object> productIterator()
        Specified by:
        productIterator in interface scala.Product
      • canEqual

        public boolean canEqual​(java.lang.Object x$1)
        Specified by:
        canEqual in interface scala.Equals
      • productElementName

        public java.lang.String productElementName​(int x$1)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

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

        public boolean equals​(java.lang.Object x$1)
        Specified by:
        equals in interface scala.Equals
        Overrides:
        equals in class java.lang.Object