Search in sources :

Example 1 with RemoveInterfaceFromDpnOnVpnEvent

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

the class VpnFootprintService method publishInterfaceRemovedFromVpnNotification.

private void publishInterfaceRemovedFromVpnNotification(String interfaceName, BigInteger dpnId, String vpnName, Long vpnId) {
    LOG.debug("publishInterfaceAddedToVpnNotification: Sending notification for removal of interface {}" + " from dpn {} for vpn {}", interfaceName, dpnId, vpnName);
    RemoveInterfaceEventData data = new RemoveInterfaceEventDataBuilder().setInterfaceName(interfaceName).setVpnId(vpnId).setDpnId(dpnId).build();
    RemoveInterfaceFromDpnOnVpnEvent event = new RemoveInterfaceFromDpnOnVpnEventBuilder().setRemoveInterfaceEventData(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 removing interface {} from dpn {} in vpn {} event ", interfaceName, dpnId, vpnName, error);
        }

        @Override
        public void onSuccess(Object arg) {
            LOG.trace("publishInterfaceAddedToVpnNotification: Successful in notifying listeners for removing" + " interface {} from dpn {} in vpn {} event ", interfaceName, dpnId, vpnName);
        }
    }, MoreExecutors.directExecutor());
}
Also used : RemoveInterfaceFromDpnOnVpnEvent(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.RemoveInterfaceFromDpnOnVpnEvent) RemoveInterfaceEventDataBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.remove._interface.from.dpn.on.vpn.event.RemoveInterfaceEventDataBuilder) RemoveInterfaceFromDpnOnVpnEventBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.RemoveInterfaceFromDpnOnVpnEventBuilder) RemoveInterfaceEventData(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.remove._interface.from.dpn.on.vpn.event.RemoveInterfaceEventData)

Example 2 with RemoveInterfaceFromDpnOnVpnEvent

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

the class VpnFootprintService method publishInterfaceRemovedFromVpnNotification.

private void publishInterfaceRemovedFromVpnNotification(String interfaceName, Uint64 dpnId, String vpnName, Uint32 vpnId) {
    LOG.debug("publishInterfaceAddedToVpnNotification: Sending notification for removal of interface {}" + " from dpn {} for vpn {}", interfaceName, dpnId, vpnName);
    RemoveInterfaceEventData data = new RemoveInterfaceEventDataBuilder().setInterfaceName(interfaceName).setVpnId(vpnId).setDpnId(dpnId).build();
    RemoveInterfaceFromDpnOnVpnEvent event = new RemoveInterfaceFromDpnOnVpnEventBuilder().setRemoveInterfaceEventData(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 removing interface {} from dpn {} in vpn {} event ", interfaceName, dpnId, vpnName, error);
        }

        @Override
        public void onSuccess(Object arg) {
            LOG.trace("publishInterfaceAddedToVpnNotification: Successful in notifying listeners for removing" + " interface {} from dpn {} in vpn {} event ", interfaceName, dpnId, vpnName);
        }
    }, MoreExecutors.directExecutor());
}
Also used : RemoveInterfaceFromDpnOnVpnEvent(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.RemoveInterfaceFromDpnOnVpnEvent) RemoveInterfaceEventDataBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.remove._interface.from.dpn.on.vpn.event.RemoveInterfaceEventDataBuilder) RemoveInterfaceFromDpnOnVpnEventBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.RemoveInterfaceFromDpnOnVpnEventBuilder) RemoveInterfaceEventData(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.remove._interface.from.dpn.on.vpn.event.RemoveInterfaceEventData)

Aggregations

RemoveInterfaceFromDpnOnVpnEvent (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.RemoveInterfaceFromDpnOnVpnEvent)2 RemoveInterfaceFromDpnOnVpnEventBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.RemoveInterfaceFromDpnOnVpnEventBuilder)2 RemoveInterfaceEventData (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.remove._interface.from.dpn.on.vpn.event.RemoveInterfaceEventData)2 RemoveInterfaceEventDataBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.remove._interface.from.dpn.on.vpn.event.RemoveInterfaceEventDataBuilder)2