use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.eventaggregator.rev141202.CreateTopicOutputBuilder in project controller by opendaylight.
the class EventSourceTopology method createTopic.
@Override
public Future<RpcResult<CreateTopicOutput>> createTopic(final CreateTopicInput input) {
LOG.debug("Received Topic creation request: NotificationPattern -> {}, NodeIdPattern -> {}", input.getNotificationPattern(), input.getNodeIdPattern());
final NotificationPattern notificationPattern = new NotificationPattern(input.getNotificationPattern());
// FIXME: do not use Util.wildcardToRegex - NodeIdPatter should be regex
final String nodeIdPattern = input.getNodeIdPattern().getValue();
final EventSourceTopic eventSourceTopic = EventSourceTopic.create(notificationPattern, nodeIdPattern, this);
eventSourceTopicMap.put(eventSourceTopic.getTopicId(), eventSourceTopic);
final CreateTopicOutput cto = new CreateTopicOutputBuilder().setTopicId(eventSourceTopic.getTopicId()).build();
LOG.info("Topic has been created: NotificationPattern -> {}, NodeIdPattern -> {}", input.getNotificationPattern(), input.getNodeIdPattern());
return Util.resultRpcSuccessFor(cto);
}
Aggregations