use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.rev200120.bmp.monitor.Monitor in project netvirt by opendaylight.
the class ArpMonitorEventListener method onMonitorEvent.
@Override
public void onMonitorEvent(MonitorEvent notification) {
Long monitorId = notification.getEventData().getMonitorId();
MacEntry macEntry = AlivenessMonitorUtils.getMacEntryFromMonitorId(monitorId);
if (macEntry == null) {
LOG.debug("No MacEntry found associated with the monitor Id {}", monitorId);
return;
}
LivenessState livenessState = notification.getEventData().getMonitorState();
if (livenessState.equals(LivenessState.Down)) {
String vpnName = macEntry.getVpnName();
String learntIp = macEntry.getIpAddress().getHostAddress();
LearntVpnVipToPort vpnVipToPort = VpnUtil.getLearntVpnVipToPort(dataBroker, vpnName, learntIp);
if (vpnVipToPort != null && macEntry.getCreatedTime().equals(vpnVipToPort.getCreationTime())) {
jobCoordinator.enqueueJob(ArpMonitoringHandler.buildJobKey(macEntry.getIpAddress().getHostAddress(), macEntry.getVpnName()), new ArpMonitorStopTask(macEntry, dataBroker, alivenessManager));
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.rev200120.bmp.monitor.Monitor in project netvirt by opendaylight.
the class StatisticsImpl method createIdPool.
private void createIdPool() {
if (checkPoolExists()) {
return;
}
CreateIdPoolInput createPool = new CreateIdPoolInputBuilder().setPoolName(CountersServiceUtils.COUNTERS_PULL_NAME).setLow(CountersServiceUtils.COUNTERS_PULL_START).setHigh(CountersServiceUtils.COUNTERS_PULL_START + CountersServiceUtils.COUNTERS_PULL_END).build();
ListenableFuture<RpcResult<CreateIdPoolOutput>> result = idManagerService.createIdPool(createPool);
Futures.addCallback(result, new FutureCallback<RpcResult<CreateIdPoolOutput>>() {
@Override
public void onFailure(Throwable error) {
LOG.error("Failed to create idPool for Aliveness Monitor Service", error);
}
@Override
public void onSuccess(@NonNull RpcResult<CreateIdPoolOutput> rpcResult) {
if (rpcResult.isSuccessful()) {
LOG.debug("Created IdPool for tap");
} else {
LOG.error("RPC to create Idpool failed {}", rpcResult.getErrors());
}
}
}, MoreExecutors.directExecutor());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.rev200120.bmp.monitor.Monitor in project netvirt by opendaylight.
the class IpMonitorEventListener method onMonitorEvent.
@Override
public void onMonitorEvent(MonitorEvent notification) {
Long monitorId = notification.getEventData().getMonitorId().toJava();
MacEntry macEntry = AlivenessMonitorUtils.getMacEntryFromMonitorId(monitorId);
if (macEntry == null) {
LOG.debug("No MacEntry found associated with the monitor Id {}", monitorId);
return;
}
LivenessState livenessState = notification.getEventData().getMonitorState();
if (livenessState.equals(LivenessState.Down)) {
String vpnName = macEntry.getVpnName();
String learntIp = macEntry.getIpAddress().getHostAddress();
LearntVpnVipToPort vpnVipToPort = vpnUtil.getLearntVpnVipToPort(vpnName, learntIp);
if (vpnVipToPort != null && macEntry.getCreatedTime().equals(vpnVipToPort.getCreationTime())) {
String jobKey = VpnUtil.buildIpMonitorJobKey(macEntry.getIpAddress().getHostAddress(), macEntry.getVpnName());
jobCoordinator.enqueueJob(jobKey, new IpMonitorStopTask(macEntry, dataBroker, Boolean.TRUE, vpnUtil, alivenessMonitorUtils));
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.rev200120.bmp.monitor.Monitor in project genius by opendaylight.
the class ItmMonitorIntervalWorker method toggle.
private void toggle(String tunnelInterfaceName, WriteTransaction transaction) {
if (tunnelInterfaceName != null) {
LOG.debug("tunnel {} will have monitor interval {}", tunnelInterfaceName, interval);
InstanceIdentifier<IfTunnel> trunkIdentifier = ItmUtils.buildTunnelId(tunnelInterfaceName);
IfTunnel tunnel = new IfTunnelBuilder().setMonitorInterval(interval.longValue()).build();
transaction.merge(LogicalDatastoreType.CONFIGURATION, trunkIdentifier, tunnel);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.rev200120.bmp.monitor.Monitor in project genius by opendaylight.
the class AlivenessMonitorTest method testMonitorProfileCreate.
@Test
public void testMonitorProfileCreate() throws InterruptedException, ExecutionException {
MonitorProfileCreateInput input = new MonitorProfileCreateInputBuilder().setProfile(new ProfileBuilder().setFailureThreshold(10L).setMonitorInterval(10000L).setMonitorWindow(10L).setProtocolType(EtherTypes.Arp).build()).build();
doReturn(Futures.immediateCheckedFuture(Optional.absent())).when(readWriteTx).read(eq(LogicalDatastoreType.OPERATIONAL), argThat(isType(MonitorProfile.class)));
doReturn(Futures.immediateCheckedFuture(null)).when(readWriteTx).submit();
RpcResult<MonitorProfileCreateOutput> output = alivenessMonitor.monitorProfileCreate(input).get();
assertTrue("Monitor Profile Create result", output.isSuccessful());
assertNotNull("Monitor Profile Output", output.getResult().getProfileId());
}
Aggregations