T
- The type of entity described by this modelpublic interface EntityModel<T>
T
. The
entity may be child entity or an aggregate root.Modifier and Type | Method and Description |
---|---|
default Map<Class<?>,List<MessageHandlingMember<? super T>>> |
allCommandHandlerInterceptors()
Gets all command handler interceptors per type in this aggregate hierarchy.
|
default Map<Class<?>,List<MessageHandlingMember<? super T>>> |
allCommandHandlers()
Gets all command handlers per type in this aggregate hierarchy.
|
default Map<Class<?>,List<MessageHandlingMember<? super T>>> |
allEventHandlers()
Gets all event handlers per type in this aggregate hierarchy.
|
default List<MessageHandlingMember<? super T>> |
commandHandlerInterceptors()
Deprecated.
use
allCommandHandlerInterceptors() or commandHandlerInterceptors(Class) instead |
default Stream<MessageHandlingMember<? super T>> |
commandHandlerInterceptors(Class<? extends T> type)
Gets command handler interceptors for provided
type in this aggregate hierarchy. |
default List<MessageHandlingMember<? super T>> |
commandHandlers()
Deprecated.
use
allCommandHandlers() or commandHandlers(Class) instead |
default Stream<MessageHandlingMember<? super T>> |
commandHandlers(Class<? extends T> type)
Gets command handlers for provided
type in this aggregate hierarchy. |
Class<? extends T> |
entityClass()
Returns the class this model describes
|
Object |
getIdentifier(T target)
Get the identifier of the given
target entity. |
<C> EntityModel<C> |
modelOf(Class<? extends C> childEntityType)
Get the EntityModel of an entity of type
childEntityType in case it is the child of the modeled entity. |
void |
publish(EventMessage<?> message,
T target)
Publish given event
message on the given target entity. |
String |
routingKey()
Get the name of the routing key property on commands and events that provides the identifier that should be used
to target entities of this kind.
|
Object getIdentifier(T target)
target
entity.target
- The entity instanceString routingKey()
void publish(EventMessage<?> message, T target)
message
on the given target
entity.message
- The event message to publishtarget
- The target entity for the event@Deprecated default List<MessageHandlingMember<? super T>> commandHandlers()
allCommandHandlers()
or commandHandlers(Class)
insteadMessageHandlingMember
to command name (obtained via CommandMessage.getCommandName()
) for this entityClass()
.default Map<Class<?>,List<MessageHandlingMember<? super T>>> allCommandHandlers()
default Stream<MessageHandlingMember<? super T>> commandHandlers(Class<? extends T> type)
type
in this aggregate hierarchy.type
- the aggregate type in this hierarchytype
@Deprecated default List<MessageHandlingMember<? super T>> commandHandlerInterceptors()
allCommandHandlerInterceptors()
or commandHandlerInterceptors(Class)
insteadentityClass()
.default Map<Class<?>,List<MessageHandlingMember<? super T>>> allCommandHandlerInterceptors()
default Stream<MessageHandlingMember<? super T>> commandHandlerInterceptors(Class<? extends T> type)
type
in this aggregate hierarchy.type
- the aggregate type in this hierarchytype
default Map<Class<?>,List<MessageHandlingMember<? super T>>> allEventHandlers()
<C> EntityModel<C> modelOf(Class<? extends C> childEntityType)
childEntityType
in case it is the child of the modeled entity.C
- the type of the child entitychildEntityType
- The class instance of the child entity typeCopyright © 2010–2023. All rights reserved.