I
- the type of the IDsM
- the type of the state objects holding projection datapublic abstract class Projection<I,M extends io.spine.base.EntityState,B extends io.spine.protobuf.ValidatingBuilder<M>> extends TransactionalEntity<I,M,B> implements EventSubscriber, HasVersionColumn<I,M>, HasLifecycleColumns<I,M>
Projection
holds a structural representation of data extracted from a stream of events.
The process of projecting the event stream into data we collect is performed by event subscribers for the events of interest. These event handlers are implemented in the classes extending this abstract class.
Event subscribers are invoked by a ProjectionRepository
that manages instances
of a stream projection class.
Entity.GenericParameter
Modifier | Constructor and Description |
---|---|
protected |
Projection()
Creates a new instance.
|
protected |
Projection(I id)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected B |
builder()
Obtains the instance of the state builder.
|
protected java.lang.String |
missingTxMessage()
Provides error message text for the case of not having an active transaction when a state
modification call is made.
|
io.spine.server.dispatch.BatchDispatchOutcome |
play(java.lang.Iterable<io.spine.core.Event> events) |
protected ProjectionClass<?> |
thisClass()
Obtains model class for this entity.
|
clearRecentHistory, getLifecycleFlags, recentHistory, remember, setArchived, setDeleted, setInitialState, tx
afterInvoke, at, beforeInvoke, checkEntityState, checkNotArchived, checkNotDeleted, defaultState, equals, hashCode, id, idAsString, isArchived, isDeleted, lifecycleFlagsChanged, state, toString, version, versionNumber, whenModified
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isActive, lifecycleFlags
protected Projection()
protected Projection(I id)
id
- the ID for the new instanceprotected ProjectionClass<?> thisClass()
AbstractEntity
thisClass
in class AbstractEntity<I,M extends io.spine.base.EntityState>
protected final B builder()
This method must be called only from within an active transaction.
Overridden to expose the method to the package.
protected java.lang.String missingTxMessage()
TransactionalEntity
missingTxMessage
in class TransactionalEntity<I,M extends io.spine.base.EntityState,B extends io.spine.protobuf.ValidatingBuilder<M>>
public io.spine.server.dispatch.BatchDispatchOutcome play(java.lang.Iterable<io.spine.core.Event> events)