Class EventSourcedBehaviorImpl<Command,​Event,​State>

    • Constructor Detail

      • EventSourcedBehaviorImpl

        public EventSourcedBehaviorImpl​(PersistenceId persistenceId,
                                        State emptyState,
                                        scala.Function2<State,​Command,​Effect<Event,​State>> commandHandler,
                                        scala.Function2<State,​Event,​State> eventHandler,
                                        java.lang.Class<?> loggerClass,
                                        scala.Option<java.lang.String> journalPluginId,
                                        scala.Option<java.lang.String> snapshotPluginId,
                                        scala.Function1<State,​scala.runtime.BoxedUnit> recoveryCompleted,
                                        scala.Function1<Event,​scala.collection.immutable.Set<java.lang.String>> tagger,
                                        EventAdapter<Event,​java.lang.Object> eventAdapter,
                                        scala.Function3<State,​Event,​java.lang.Object,​java.lang.Object> snapshotWhen,
                                        Recovery recovery,
                                        SupervisorStrategy supervisionStrategy,
                                        scala.Function2<SnapshotMetadata,​scala.util.Try<Done>,​scala.runtime.BoxedUnit> onSnapshot,
                                        scala.Function1<java.lang.Throwable,​scala.runtime.BoxedUnit> onRecoveryFailure)
    • Method Detail

      • $lessinit$greater$default$6

        public static <Command,​Event,​State> scala.Option<java.lang.String> $lessinit$greater$default$6()
      • $lessinit$greater$default$7

        public static <Command,​Event,​State> scala.Option<java.lang.String> $lessinit$greater$default$7()
      • $lessinit$greater$default$8

        public static <Command,​Event,​State> scala.Function1<java.lang.Object,​scala.runtime.BoxedUnit> $lessinit$greater$default$8()
      • $lessinit$greater$default$9

        public static <Command,​Event,​State> scala.Function1<Event,​scala.collection.immutable.Set<java.lang.String>> $lessinit$greater$default$9()
      • $lessinit$greater$default$10

        public static <Command,​Event,​State> NoOpEventAdapter<Event> $lessinit$greater$default$10()
      • $lessinit$greater$default$11

        public static <Command,​Event,​State> scala.Function3<java.lang.Object,​java.lang.Object,​java.lang.Object,​java.lang.Object> $lessinit$greater$default$11()
      • $lessinit$greater$default$12

        public static <Command,​Event,​State> Recovery $lessinit$greater$default$12()
      • $lessinit$greater$default$13

        public static <Command,​Event,​State> SupervisorStrategy $lessinit$greater$default$13()
      • $lessinit$greater$default$14

        public static <Command,​Event,​State> scala.Function2<SnapshotMetadata,​scala.util.Try<Done>,​scala.runtime.BoxedUnit> $lessinit$greater$default$14()
      • $lessinit$greater$default$15

        public static <Command,​Event,​State> scala.Function1<java.lang.Throwable,​scala.runtime.BoxedUnit> $lessinit$greater$default$15()
      • apply$default$10

        public static <Command,​Event,​State> NoOpEventAdapter<Event> apply$default$10()
      • apply$default$11

        public static <Command,​Event,​State> scala.Function3<java.lang.Object,​java.lang.Object,​java.lang.Object,​java.lang.Object> apply$default$11()
      • apply$default$12

        public static <Command,​Event,​State> Recovery apply$default$12()
      • apply$default$13

        public static <Command,​Event,​State> SupervisorStrategy apply$default$13()
      • apply$default$14

        public static <Command,​Event,​State> scala.Function2<SnapshotMetadata,​scala.util.Try<Done>,​scala.runtime.BoxedUnit> apply$default$14()
      • apply$default$15

        public static <Command,​Event,​State> scala.Function1<java.lang.Throwable,​scala.runtime.BoxedUnit> apply$default$15()
      • apply$default$6

        public static <Command,​Event,​State> scala.Option<java.lang.String> apply$default$6()
      • apply$default$7

        public static <Command,​Event,​State> scala.Option<java.lang.String> apply$default$7()
      • apply$default$8

        public static <Command,​Event,​State> scala.Function1<java.lang.Object,​scala.runtime.BoxedUnit> apply$default$8()
      • apply$default$9

        public static <Command,​Event,​State> scala.Function1<Event,​scala.collection.immutable.Set<java.lang.String>> apply$default$9()
      • unapply

        public static <Command,​Event,​State> scala.Option<scala.Tuple15<PersistenceId,​State,​scala.Function2<State,​Command,​Effect<Event,​State>>,​scala.Function2<State,​Event,​State>,​java.lang.Class<?>,​scala.Option<java.lang.String>,​scala.Option<java.lang.String>,​scala.Function1<State,​scala.runtime.BoxedUnit>,​scala.Function1<Event,​scala.collection.immutable.Set<java.lang.String>>,​EventAdapter<Event,​java.lang.Object>,​scala.Function3<State,​Event,​java.lang.Object,​java.lang.Object>,​Recovery,​SupervisorStrategy,​scala.Function2<SnapshotMetadata,​scala.util.Try<Done>,​scala.runtime.BoxedUnit>,​scala.Function1<java.lang.Throwable,​scala.runtime.BoxedUnit>>> unapply​(EventSourcedBehaviorImpl<Command,​Event,​State> x$0)
      • narrow

        public static final <U extends T> Behavior<U> narrow()
      • unsafeCast

        public static final <U> Behavior<U> unsafeCast()
      • emptyState

        public State emptyState()
      • eventHandler

        public scala.Function2<State,​Event,​State> eventHandler()
      • loggerClass

        public java.lang.Class<?> loggerClass()
      • journalPluginId

        public scala.Option<java.lang.String> journalPluginId()
      • snapshotPluginId

        public scala.Option<java.lang.String> snapshotPluginId()
      • recoveryCompleted

        public scala.Function1<State,​scala.runtime.BoxedUnit> recoveryCompleted()
      • tagger

        public scala.Function1<Event,​scala.collection.immutable.Set<java.lang.String>> tagger()
      • snapshotWhen

        public scala.Function3<State,​Event,​java.lang.Object,​java.lang.Object> snapshotWhen()
      • onSnapshot

        public scala.Function2<SnapshotMetadata,​scala.util.Try<Done>,​scala.runtime.BoxedUnit> onSnapshot()
      • onRecoveryFailure

        public scala.Function1<java.lang.Throwable,​scala.runtime.BoxedUnit> onRecoveryFailure()
      • snapshotWhen

        public EventSourcedBehavior<Command,​Event,​State> snapshotWhen​(scala.Function3<State,​Event,​java.lang.Object,​java.lang.Object> predicate)
        Initiates a snapshot if the given function returns true. When persisting multiple events at once the snapshot is triggered after all the events have been persisted.

        predicate receives the State, Event and the sequenceNr used for the Event

        Specified by:
        snapshotWhen in interface EventSourcedBehavior<Command,​Event,​State>
        Parameters:
        predicate - (undocumented)
        Returns:
        (undocumented)
      • withSnapshotSelectionCriteria

        public EventSourcedBehavior<Command,​Event,​State> withSnapshotSelectionCriteria​(SnapshotSelectionCriteria selection)
        Changes the snapshot selection criteria used by this behavior. By default the most recent snapshot is used, and the remaining state updates are recovered by replaying events from the sequence number up until which the snapshot reached.

        You may configure the behavior to skip replaying snapshots completely, in which case the recovery will be performed by replaying all events -- which may take a long time.

        Specified by:
        withSnapshotSelectionCriteria in interface EventSourcedBehavior<Command,​Event,​State>
        Parameters:
        selection - (undocumented)
        Returns:
        (undocumented)
      • copy

        public <Command,​Event,​State> EventSourcedBehaviorImpl<Command,​Event,​State> copy​(PersistenceId persistenceId,
                                                                                                                State emptyState,
                                                                                                                scala.Function2<State,​Command,​Effect<Event,​State>> commandHandler,
                                                                                                                scala.Function2<State,​Event,​State> eventHandler,
                                                                                                                java.lang.Class<?> loggerClass,
                                                                                                                scala.Option<java.lang.String> journalPluginId,
                                                                                                                scala.Option<java.lang.String> snapshotPluginId,
                                                                                                                scala.Function1<State,​scala.runtime.BoxedUnit> recoveryCompleted,
                                                                                                                scala.Function1<Event,​scala.collection.immutable.Set<java.lang.String>> tagger,
                                                                                                                EventAdapter<Event,​java.lang.Object> eventAdapter,
                                                                                                                scala.Function3<State,​Event,​java.lang.Object,​java.lang.Object> snapshotWhen,
                                                                                                                Recovery recovery,
                                                                                                                SupervisorStrategy supervisionStrategy,
                                                                                                                scala.Function2<SnapshotMetadata,​scala.util.Try<Done>,​scala.runtime.BoxedUnit> onSnapshot,
                                                                                                                scala.Function1<java.lang.Throwable,​scala.runtime.BoxedUnit> onRecoveryFailure)
      • copy$default$1

        public <Command,​Event,​State> PersistenceId copy$default$1()
      • copy$default$10

        public <Command,​Event,​State> EventAdapter<Event,​java.lang.Object> copy$default$10()
      • copy$default$11

        public <Command,​Event,​State> scala.Function3<State,​Event,​java.lang.Object,​java.lang.Object> copy$default$11()
      • copy$default$12

        public <Command,​Event,​State> Recovery copy$default$12()
      • copy$default$13

        public <Command,​Event,​State> SupervisorStrategy copy$default$13()
      • copy$default$14

        public <Command,​Event,​State> scala.Function2<SnapshotMetadata,​scala.util.Try<Done>,​scala.runtime.BoxedUnit> copy$default$14()
      • copy$default$15

        public <Command,​Event,​State> scala.Function1<java.lang.Throwable,​scala.runtime.BoxedUnit> copy$default$15()
      • copy$default$2

        public <Command,​Event,​State> State copy$default$2()
      • copy$default$3

        public <Command,​Event,​State> scala.Function2<State,​Command,​Effect<Event,​State>> copy$default$3()
      • copy$default$4

        public <Command,​Event,​State> scala.Function2<State,​Event,​State> copy$default$4()
      • copy$default$5

        public <Command,​Event,​State> java.lang.Class<?> copy$default$5()
      • copy$default$6

        public <Command,​Event,​State> scala.Option<java.lang.String> copy$default$6()
      • copy$default$7

        public <Command,​Event,​State> scala.Option<java.lang.String> copy$default$7()
      • copy$default$8

        public <Command,​Event,​State> scala.Function1<State,​scala.runtime.BoxedUnit> copy$default$8()
      • copy$default$9

        public <Command,​Event,​State> scala.Function1<Event,​scala.collection.immutable.Set<java.lang.String>> copy$default$9()
      • 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
      • 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