Search in sources :

Example 1 with CreateTopicInput

use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.eventaggregator.rev141202.CreateTopicInput 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);
}
Also used : NotificationPattern(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.eventaggregator.rev141202.NotificationPattern) CreateTopicOutput(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.eventaggregator.rev141202.CreateTopicOutput) CreateTopicOutputBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.eventaggregator.rev141202.CreateTopicOutputBuilder)

Aggregations

CreateTopicOutput (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.eventaggregator.rev141202.CreateTopicOutput)1 CreateTopicOutputBuilder (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.eventaggregator.rev141202.CreateTopicOutputBuilder)1 NotificationPattern (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.eventaggregator.rev141202.NotificationPattern)1