blob: d381268b3f9ea6166474a54e7e6aad6782439dd3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
package org.openecomp.sdc.notification.services.impl;
import org.openecomp.sdc.destinationprovider.impl.MulticastDestination;
import org.openecomp.sdc.destinationprovider.impl.UnicastDestination;
import org.openecomp.sdc.notification.dtos.Event;
import org.openecomp.sdc.notification.services.NotificationPropagationManager;
import org.openecomp.sdc.notification.services.PropagationService;
import org.openecomp.sdc.notification.services.SubscriptionService;
/**
* @author avrahamg
* @since July 10, 2017
*/
public class NotificationPropagationManagerImpl implements NotificationPropagationManager {
private PropagationService propagationService;
private SubscriptionService subscriptionService;
public NotificationPropagationManagerImpl(PropagationService propagationService,
SubscriptionService subscriptionService) {
this.propagationService = propagationService;
this.subscriptionService = subscriptionService;
}
@Override
public void notifySubscribers(Event event, String ... excludedSubscribers) {
propagationService.notify(event, new MulticastDestination(event.getEntityId(),
subscriptionService, excludedSubscribers));
}
@Override
public void directNotification(Event event, String destinationId) {
propagationService.notify(event, new UnicastDestination(destinationId));
}
}
|