Class DefaultEventExternalizationConfiguration
java.lang.Object
org.springframework.modulith.events.DefaultEventExternalizationConfiguration
- All Implemented Interfaces:
EventExternalizationConfiguration
class DefaultEventExternalizationConfiguration
extends Object
implements EventExternalizationConfiguration
Default implementation of
EventExternalizationConfiguration.- Since:
- 1.1
- Author:
- Oliver Drotbohm
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.modulith.events.EventExternalizationConfiguration
EventExternalizationConfiguration.Router, EventExternalizationConfiguration.Selector -
Constructor Summary
ConstructorsConstructorDescriptionDefaultEventExternalizationConfiguration(Predicate<Object> filter, Function<Object, Object> mapper, Function<Object, RoutingTarget> router, Function<Object, Map<String, Object>> headers) Creates a newDefaultEventExternalizationConfiguration -
Method Summary
Modifier and TypeMethodDescription(package private) static EventExternalizationConfiguration.Selectorbuilder()Returns a newEventExternalizationConfiguration.Selectorinstance to build up a new configuration.determineTarget(Object event) Determines theRoutingTargetfor the given event based on the current configuration.getHeadersFor(Object event) Returns the headers to be attached to the message sent out for the given event.Map the event to be externalized before publishing it.booleanWhether the configuration supports the given event.
-
Constructor Details
-
DefaultEventExternalizationConfiguration
DefaultEventExternalizationConfiguration(Predicate<Object> filter, Function<Object, Object> mapper, Function<Object, RoutingTarget> router, Function<Object, Map<String, Object>> headers) Creates a newDefaultEventExternalizationConfiguration- Parameters:
filter- must not be null.mapper- must not be null.router- must not be null.headers- must not be null.
-
-
Method Details
-
builder
Returns a newEventExternalizationConfiguration.Selectorinstance to build up a new configuration.- Returns:
- will never be null.
-
supports
Description copied from interface:EventExternalizationConfigurationWhether the configuration supports the given event. In other words, whether the given event is supposed to be externalized in the first place.- Specified by:
supportsin interfaceEventExternalizationConfiguration- Parameters:
event- must not be null.- Returns:
- whether to externalize the given event.
-
map
Description copied from interface:EventExternalizationConfigurationMap the event to be externalized before publishing it.- Specified by:
mapin interfaceEventExternalizationConfiguration- Parameters:
event- must not be null.- Returns:
- the mapped event.
-
determineTarget
Description copied from interface:EventExternalizationConfigurationDetermines theRoutingTargetfor the given event based on the current configuration.- Specified by:
determineTargetin interfaceEventExternalizationConfiguration- Parameters:
event- must not be null.- Returns:
- will never be null.
-
getHeadersFor
Description copied from interface:EventExternalizationConfigurationReturns the headers to be attached to the message sent out for the given event.- Specified by:
getHeadersForin interfaceEventExternalizationConfiguration- Parameters:
event- must not be null.- Returns:
- will never be null.
-