use of org.opendaylight.genius.itm.confighelpers.ItmMonitorIntervalWorker in project genius by opendaylight.
the class TunnelMonitorIntervalListener method remove.
@Override
protected void remove(InstanceIdentifier<TunnelMonitorInterval> key, TunnelMonitorInterval dataObjectModification) {
LOG.debug("remove TunnelMonitorIntervalListener called with {}", dataObjectModification.getInterval());
InstanceIdentifier<TransportZones> path = InstanceIdentifier.builder(TransportZones.class).build();
Optional<TransportZones> transportZonesOptional = ItmUtils.read(LogicalDatastoreType.CONFIGURATION, path, broker);
if (transportZonesOptional.isPresent()) {
TransportZones tzones = transportZonesOptional.get();
for (TransportZone tzone : tzones.getTransportZone()) {
// if you remove configuration, the last configured interval is only set i.e no change
LOG.debug("Remove:Calling TunnelMonitorIntervalWorker with tzone = {} and {}", tzone.getZoneName(), dataObjectModification.getInterval());
ItmMonitorIntervalWorker toggleWorker = new ItmMonitorIntervalWorker(tzone.getZoneName(), dataObjectModification.getInterval(), broker);
jobCoordinator.enqueueJob(tzone.getZoneName(), toggleWorker);
}
}
}
use of org.opendaylight.genius.itm.confighelpers.ItmMonitorIntervalWorker in project genius by opendaylight.
the class TunnelMonitorIntervalListener method update.
@Override
protected void update(InstanceIdentifier<TunnelMonitorInterval> key, TunnelMonitorInterval dataObjectModificationBefore, TunnelMonitorInterval dataObjectModificationAfter) {
LOG.debug("update TunnelMonitorIntervalListener called with {}", dataObjectModificationAfter.getInterval());
InstanceIdentifier<TransportZones> path = InstanceIdentifier.builder(TransportZones.class).build();
Optional<TransportZones> transportZonesOptional = ItmUtils.read(LogicalDatastoreType.CONFIGURATION, path, broker);
if (transportZonesOptional.isPresent()) {
TransportZones tzones = transportZonesOptional.get();
for (TransportZone tzone : tzones.getTransportZone()) {
LOG.debug("Update:Calling TunnelMonitorIntervalWorker with tzone = {} and {}", tzone.getZoneName(), dataObjectModificationAfter.getInterval());
ItmMonitorIntervalWorker intervalWorker = new ItmMonitorIntervalWorker(tzone.getZoneName(), dataObjectModificationAfter.getInterval(), broker);
jobCoordinator.enqueueJob(tzone.getZoneName(), intervalWorker);
}
}
}
use of org.opendaylight.genius.itm.confighelpers.ItmMonitorIntervalWorker in project genius by opendaylight.
the class TunnelMonitorIntervalListener method add.
@Override
protected void add(InstanceIdentifier<TunnelMonitorInterval> key, TunnelMonitorInterval dataObjectModification) {
LOG.debug("Add TunnelMonitorIntervalListener called with {}", dataObjectModification.getInterval());
InstanceIdentifier<TransportZones> path = InstanceIdentifier.builder(TransportZones.class).build();
Optional<TransportZones> transportZonesOptional = ItmUtils.read(LogicalDatastoreType.CONFIGURATION, path, broker);
if (transportZonesOptional.isPresent()) {
TransportZones tzones = transportZonesOptional.get();
for (TransportZone tzone : tzones.getTransportZone()) {
LOG.debug("Add:Calling TunnelMonitorIntervalWorker with tzone = {} and {}", tzone.getZoneName(), dataObjectModification.getInterval());
ItmMonitorIntervalWorker intervalWorker = new ItmMonitorIntervalWorker(tzone.getZoneName(), dataObjectModification.getInterval(), broker);
// conversion to milliseconds done while writing to i/f-mgr config DS
jobCoordinator.enqueueJob(tzone.getZoneName(), intervalWorker);
}
}
}
Aggregations