Class ConnectionStatusMessageHandler<T extends PermissionRequest>
java.lang.Object
energy.eddie.regionconnector.shared.event.sourcing.handlers.integration.ConnectionStatusMessageHandler<T>
- All Implemented Interfaces:
ConnectionStatusMessageProvider,EventHandler<PermissionEvent>,AutoCloseable
public class ConnectionStatusMessageHandler<T extends PermissionRequest>
extends Object
implements EventHandler<PermissionEvent>, ConnectionStatusMessageProvider
Subscribes to all events of an
EventBus and creates connection status messages based on an event.-
Constructor Summary
ConstructorsConstructorDescriptionConnectionStatusMessageHandler(EventBus eventBus, PermissionRequestRepository<T> repository, Function<T, String> messageFunc) ConnectionStatusMessageHandler(EventBus eventBus, PermissionRequestRepository<T> repository, Function<T, String> messageFunc, Function<T, com.fasterxml.jackson.databind.JsonNode> additionalDataFunc) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(PermissionEvent permissionEvent) Subscription method for the event busvoidclose()Emit a complete signal on the Flow in this method.reactor.core.publisher.Flux<ConnectionStatusMessage> Data stream of all connection status updates created by this region connector.
-
Constructor Details
-
Method Details
-
accept
Description copied from interface:EventHandlerSubscription method for the event bus- Specified by:
acceptin interfaceEventHandler<T extends PermissionRequest>- Parameters:
permissionEvent- event that indicates that a permission request has been changed
-
getConnectionStatusMessageStream
Description copied from interface:ConnectionStatusMessageProviderData stream of all connection status updates created by this region connector.- Specified by:
getConnectionStatusMessageStreamin interfaceConnectionStatusMessageProvider- Returns:
- connection status message stream
-
close
public void close()Description copied from interface:ConnectionStatusMessageProviderEmit a complete signal on the Flow in this method.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnectionStatusMessageProvider
-