Search in sources :

Example 1 with AddDpnEvent

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.AddDpnEvent in project netvirt by opendaylight.

the class VpnFootprintService method publishAddNotification.

private void publishAddNotification(final BigInteger dpnId, final String vpnName, final String rd) {
    LOG.debug("publishAddNotification: Sending notification for add dpn {} in vpn {} rd {} event ", dpnId, vpnName, rd);
    AddEventData data = new AddEventDataBuilder().setVpnName(vpnName).setRd(rd).setDpnId(dpnId).build();
    AddDpnEvent event = new AddDpnEventBuilder().setAddEventData(data).build();
    final ListenableFuture<?> eventFuture = notificationPublishService.offerNotification(event);
    Futures.addCallback(eventFuture, new FutureCallback<Object>() {

        @Override
        public void onFailure(Throwable error) {
            LOG.error("publishAddNotification: Error in notifying listeners for add dpn {} in vpn {} rd {} event ", dpnId, vpnName, rd, error);
        }

        @Override
        public void onSuccess(Object arg) {
            LOG.info("publishAddNotification: Successful in notifying listeners for add dpn {} in vpn {} rd {}" + " event ", dpnId, vpnName, rd);
        }
    }, MoreExecutors.directExecutor());
}
Also used : AddEventDataBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.add.dpn.event.AddEventDataBuilder) AddDpnEvent(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.AddDpnEvent) AddEventData(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.add.dpn.event.AddEventData) AddDpnEventBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.AddDpnEventBuilder)

Aggregations

AddDpnEvent (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.AddDpnEvent)1 AddDpnEventBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.AddDpnEventBuilder)1 AddEventData (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.add.dpn.event.AddEventData)1 AddEventDataBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.add.dpn.event.AddEventDataBuilder)1