Class

akka.persistence.typed.javadsl

PersistentBehavior

Related Doc: package javadsl

Permalink

abstract class PersistentBehavior[Command, Event, State >: Null] extends DeferredBehavior[Command]

Java API

Annotations
@ApiMayChange()
Source
PersistentBehavior.scala
Linear Supertypes
DeferredBehavior[Command], Behavior[Command], AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PersistentBehavior
  2. DeferredBehavior
  3. Behavior
  4. AnyRef
  5. Any
Implicitly
  1. by BehaviorDecorators
  2. by BehaviorDecorators
  3. by any2stringadd
  4. by StringFormat
  5. by Ensuring
  6. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PersistentBehavior(persistenceId: String, backoffSupervisorStrategy: BackoffSupervisorStrategy)

    Permalink
  2. new PersistentBehavior(persistenceId: String)

    Permalink

Abstract Value Members

  1. abstract def commandHandler(): CommandHandler[Command, Event, State]

    Permalink

    Implement by handling incoming commands and return an Effect() to persist or signal other effects of the command handling such as stopping the behavior or others.

    Implement by handling incoming commands and return an Effect() to persist or signal other effects of the command handling such as stopping the behavior or others.

    The command handlers are only invoked when the actor is running (i.e. not replaying). While the actor is persisting events, the incoming messages are stashed and only delivered to the handler once persisting them has completed.

    Attributes
    protected
  2. abstract def emptyState: State

    Permalink

    Implement by returning the initial empty state object.

    Implement by returning the initial empty state object. This object will be passed into this behaviors handlers, until a new state replaces it.

    Also known as "zero state" or "neutral state".

    Attributes
    protected
  3. abstract def eventHandler(): EventHandler[State, Event]

    Permalink

    Implement by applying the event to the current state in order to return a new state.

    Implement by applying the event to the current state in order to return a new state.

    The event handlers are invoked during recovery as well as running operation of this behavior, in order to keep updating the state state.

    For that reason it is strongly discouraged to perform side-effects in this handler; Side effects should be executed in andThen or recoveryCompleted blocks.

    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from PersistentBehavior[Command, Event, State] to any2stringadd[PersistentBehavior[Command, Event, State]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (PersistentBehavior[Command, Event, State], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from PersistentBehavior[Command, Event, State] to ArrowAssoc[PersistentBehavior[Command, Event, State]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def Effect: EffectFactories[Command, Event, State]

    Permalink

    Factory of effects.

    Factory of effects.

    Return effects from your handlers in order to instruct persistence on how to act on the incoming message (i.e. persist events).

    Attributes
    protected
  7. def apply(context: ActorContext[Command]): Behavior[Command]

    Permalink

    INTERNAL API: DeferredBehavior init

    INTERNAL API: DeferredBehavior init

    Definition Classes
    PersistentBehavior → DeferredBehavior
    Annotations
    @InternalApi()
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def commandHandlerBuilder(statePredicate: Predicate[State]): CommandHandlerBuilder[Command, Event, State, State]

    Permalink

    statePredicate

    The handlers defined by this builder are used when the statePredicate is true, * useful for example when state type is an Optional

    returns

    A new, mutable, command handler builder

    Attributes
    protected
  11. final def commandHandlerBuilder[S <: State](stateClass: Class[S]): CommandHandlerBuilder[Command, Event, S, State]

    Permalink

    stateClass

    The handlers defined by this builder are used when the state is an instance of the stateClass

    returns

    A new, mutable, command handler builder

    Attributes
    protected
  12. def ensuring(cond: (PersistentBehavior[Command, Event, State]) ⇒ Boolean, msg: ⇒ Any): PersistentBehavior[Command, Event, State]

    Permalink
    Implicit information
    This member is added by an implicit conversion from PersistentBehavior[Command, Event, State] to Ensuring[PersistentBehavior[Command, Event, State]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: (PersistentBehavior[Command, Event, State]) ⇒ Boolean): PersistentBehavior[Command, Event, State]

    Permalink
    Implicit information
    This member is added by an implicit conversion from PersistentBehavior[Command, Event, State] to Ensuring[PersistentBehavior[Command, Event, State]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean, msg: ⇒ Any): PersistentBehavior[Command, Event, State]

    Permalink
    Implicit information
    This member is added by an implicit conversion from PersistentBehavior[Command, Event, State] to Ensuring[PersistentBehavior[Command, Event, State]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean): PersistentBehavior[Command, Event, State]

    Permalink
    Implicit information
    This member is added by an implicit conversion from PersistentBehavior[Command, Event, State] to Ensuring[PersistentBehavior[Command, Event, State]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  18. def eventAdapter(): EventAdapter[Event, _]

    Permalink
  19. final def eventHandlerBuilder(): EventHandlerBuilder[State, Event]

    Permalink

    returns

    A new, mutable, event handler builder

    Attributes
    protected
  20. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from PersistentBehavior[Command, Event, State] to StringFormat[PersistentBehavior[Command, Event, State]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  22. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  23. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  25. final def narrow[U <: Command]: Behavior[U]

    Permalink
    Definition Classes
    Behavior
  26. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  27. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. def onRecoveryCompleted(state: State): Unit

    Permalink

    The callback function is called to notify the actor that the recovery process is finished.

  30. def onSnapshot(meta: SnapshotMetadata, result: Optional[Throwable]): Unit

    Permalink

    Override to get notified when a snapshot is finished.

    Override to get notified when a snapshot is finished.

    result

    None if successful otherwise contains the exception thrown when snapshotting

  31. final def orElse(that: Behavior[Command]): Behavior[Command]

    Permalink
    Definition Classes
    Behavior
  32. val persistenceId: String

    Permalink
  33. def shouldSnapshot(state: State, event: Event, sequenceNr: Long): Boolean

    Permalink

    Initiates a snapshot if the given function returns true.

    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.

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

    returns

    true if snapshot should be saved for the given event

    See also

    PersistentBehavior#snapshotEvery

  34. def snapshotEvery(): Long

    Permalink

    Override and define that snapshot should be saved every N events.

    Override and define that snapshot should be saved every N events.

    If this is overridden shouldSnapshot is not used.

    returns

    number of events between snapshots, should be greater than 0

    See also

    PersistentBehavior#shouldSnapshot

  35. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  36. def tagsFor(event: Event): Set[String]

    Permalink

    The tagger function should give event tags, which will be used in persistence query

  37. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  38. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. def [B](y: B): (PersistentBehavior[Command, Event, State], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from PersistentBehavior[Command, Event, State] to ArrowAssoc[PersistentBehavior[Command, Event, State]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. val behavior: Behavior[Command]

    Permalink
    Implicit information
    This member is added by an implicit conversion from PersistentBehavior[Command, Event, State] to BehaviorDecorators[Command] performed by method BehaviorDecorators in akka.actor.typed.Behavior.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (persistentBehavior: BehaviorDecorators[Command]).behavior
    Definition Classes
    BehaviorDecorators
  2. val behavior: Behavior[Command]

    Permalink
    Implicit information
    This member is added by an implicit conversion from PersistentBehavior[Command, Event, State] to BehaviorDecorators[Command] performed by method BehaviorDecorators in akka.actor.typed.Behavior.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (persistentBehavior: BehaviorDecorators[Command]).behavior
    Definition Classes
    BehaviorDecorators
  3. def widen[U](matcher: PartialFunction[U, Command]): Behavior[U]

    Permalink
    Implicit information
    This member is added by an implicit conversion from PersistentBehavior[Command, Event, State] to BehaviorDecorators[Command] performed by method BehaviorDecorators in akka.actor.typed.Behavior.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (persistentBehavior: BehaviorDecorators[Command]).widen(matcher)
    Definition Classes
    BehaviorDecorators
  4. def widen[U](matcher: PartialFunction[U, Command]): Behavior[U]

    Permalink
    Implicit information
    This member is added by an implicit conversion from PersistentBehavior[Command, Event, State] to BehaviorDecorators[Command] performed by method BehaviorDecorators in akka.actor.typed.Behavior.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (persistentBehavior: BehaviorDecorators[Command]).widen(matcher)
    Definition Classes
    BehaviorDecorators

Inherited from DeferredBehavior[Command]

Inherited from Behavior[Command]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion BehaviorDecorators from PersistentBehavior[Command, Event, State] to BehaviorDecorators[Command]

Inherited by implicit conversion BehaviorDecorators from PersistentBehavior[Command, Event, State] to BehaviorDecorators[Command]

Inherited by implicit conversion any2stringadd from PersistentBehavior[Command, Event, State] to any2stringadd[PersistentBehavior[Command, Event, State]]

Inherited by implicit conversion StringFormat from PersistentBehavior[Command, Event, State] to StringFormat[PersistentBehavior[Command, Event, State]]

Inherited by implicit conversion Ensuring from PersistentBehavior[Command, Event, State] to Ensuring[PersistentBehavior[Command, Event, State]]

Inherited by implicit conversion ArrowAssoc from PersistentBehavior[Command, Event, State] to ArrowAssoc[PersistentBehavior[Command, Event, State]]

Ungrouped