Search in sources :

Example 1 with AddInterfaceToDpnOnVpnEventBuilder

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

the class VpnFootprintService method publishInterfaceAddedToVpnNotification.

private void publishInterfaceAddedToVpnNotification(String interfaceName, BigInteger dpnId, String vpnName, Long vpnId) {
    LOG.debug("publishInterfaceAddedToVpnNotification: Sending notification for addition of interface {} on dpn {}" + " for vpn {}", interfaceName, dpnId, vpnName);
    AddInterfaceEventData data = new AddInterfaceEventDataBuilder().setInterfaceName(interfaceName).setVpnId(vpnId).setDpnId(dpnId).build();
    AddInterfaceToDpnOnVpnEvent event = new AddInterfaceToDpnOnVpnEventBuilder().setAddInterfaceEventData(data).build();
    final ListenableFuture<?> eventFuture = notificationPublishService.offerNotification(event);
    Futures.addCallback(eventFuture, new FutureCallback<Object>() {

        @Override
        public void onFailure(Throwable error) {
            LOG.warn("publishInterfaceAddedToVpnNotification: Error in notifying listeners for add interface {}" + " on dpn {} in vpn {} event ", interfaceName, dpnId, vpnName, error);
        }

        @Override
        public void onSuccess(Object arg) {
            LOG.trace("publishInterfaceAddedToVpnNotification: Successful in notifying listeners for add" + " interface {} on dpn {} in vpn {} event ", interfaceName, dpnId, vpnName);
        }
    }, MoreExecutors.directExecutor());
}
Also used : AddInterfaceToDpnOnVpnEventBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.AddInterfaceToDpnOnVpnEventBuilder) AddInterfaceToDpnOnVpnEvent(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.AddInterfaceToDpnOnVpnEvent) AddInterfaceEventData(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.add._interface.to.dpn.on.vpn.event.AddInterfaceEventData) AddInterfaceEventDataBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.add._interface.to.dpn.on.vpn.event.AddInterfaceEventDataBuilder)

Example 2 with AddInterfaceToDpnOnVpnEventBuilder

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

the class VpnFootprintService method publishInterfaceAddedToVpnNotification.

private void publishInterfaceAddedToVpnNotification(String interfaceName, Uint64 dpnId, String vpnName, Uint32 vpnId) {
    LOG.debug("publishInterfaceAddedToVpnNotification: Sending notification for addition of interface {} on dpn {}" + " for vpn {}", interfaceName, dpnId, vpnName);
    AddInterfaceEventData data = new AddInterfaceEventDataBuilder().setInterfaceName(interfaceName).setVpnId(vpnId).setDpnId(dpnId).build();
    AddInterfaceToDpnOnVpnEvent event = new AddInterfaceToDpnOnVpnEventBuilder().setAddInterfaceEventData(data).build();
    final ListenableFuture<?> eventFuture = notificationPublishService.offerNotification(event);
    Futures.addCallback(eventFuture, new FutureCallback<Object>() {

        @Override
        public void onFailure(Throwable error) {
            LOG.warn("publishInterfaceAddedToVpnNotification: Error in notifying listeners for add interface {}" + " on dpn {} in vpn {} event ", interfaceName, dpnId, vpnName, error);
        }

        @Override
        public void onSuccess(Object arg) {
            LOG.trace("publishInterfaceAddedToVpnNotification: Successful in notifying listeners for add" + " interface {} on dpn {} in vpn {} event ", interfaceName, dpnId, vpnName);
        }
    }, MoreExecutors.directExecutor());
}
Also used : AddInterfaceToDpnOnVpnEventBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.AddInterfaceToDpnOnVpnEventBuilder) AddInterfaceToDpnOnVpnEvent(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.AddInterfaceToDpnOnVpnEvent) AddInterfaceEventData(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.add._interface.to.dpn.on.vpn.event.AddInterfaceEventData) AddInterfaceEventDataBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.add._interface.to.dpn.on.vpn.event.AddInterfaceEventDataBuilder)

Aggregations

AddInterfaceToDpnOnVpnEvent (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.AddInterfaceToDpnOnVpnEvent)2 AddInterfaceToDpnOnVpnEventBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.AddInterfaceToDpnOnVpnEventBuilder)2 AddInterfaceEventData (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.add._interface.to.dpn.on.vpn.event.AddInterfaceEventData)2 AddInterfaceEventDataBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.add._interface.to.dpn.on.vpn.event.AddInterfaceEventDataBuilder)2