private void consumeUnSubscriptionRequest( String endpointId, EventSubscription eventSubscription) { remoteSubscriptionStorage.removeSubscription(eventSubscription.getMethod(), endpointId); }
public <T> void register( String method, Class<T> eventType, BiPredicate<T, Map<String, String>> biPredicate) { eventService.subscribe( event -> remoteSubscriptionStorage .getByMethod(method) .stream() .filter(context -> biPredicate.test(event, context.getScope())) .forEach(context -> transmit(context.getEndpointId(), method, event)), eventType); }
private void consumeSubscriptionRequest(String endpointId, EventSubscription eventSubscription) { remoteSubscriptionStorage.addSubscription( eventSubscription.getMethod(), new RemoteSubscriptionContext(endpointId, eventSubscription.getScope())); }