use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetInput in project genius by opendaylight.
the class AlivenessMonitorUtils method buildMonitorGetProfile.
private static MonitorProfileGetInput buildMonitorGetProfile(long monitorInterval, long monitorWindow, long failureThreshold, EtherTypes protocolType) {
org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.profile.get.input.ProfileBuilder profileBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.profile.get.input.ProfileBuilder();
profileBuilder.setFailureThreshold(failureThreshold);
profileBuilder.setMonitorInterval(monitorInterval);
profileBuilder.setMonitorWindow(monitorWindow);
profileBuilder.setProtocolType(protocolType);
MonitorProfileGetInputBuilder buildGetProfile = new MonitorProfileGetInputBuilder();
buildGetProfile.setProfile(profileBuilder.build());
return buildGetProfile.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetInput in project genius by opendaylight.
the class AlivenessMonitor method getExistingProfileId.
private Long getExistingProfileId(MonitorProfileGetInput input) {
org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.profile.get.input.Profile profile = input.getProfile();
final Long failureThreshold = profile.getFailureThreshold();
final Long monitorInterval = profile.getMonitorInterval();
final Long monitorWindow = profile.getMonitorWindow();
final EtherTypes ethType = profile.getProtocolType();
LOG.debug("getExistingProfileId for profile : {}", input.getProfile());
String idKey = getUniqueProfileKey(failureThreshold, monitorInterval, monitorWindow, ethType);
LOG.debug("Obtained existing profile ID for profile : {}", input.getProfile());
return (long) getUniqueId(idKey);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetInput in project genius by opendaylight.
the class AlivenessMonitor method monitorProfileGet.
@Override
public Future<RpcResult<MonitorProfileGetOutput>> monitorProfileGet(MonitorProfileGetInput input) {
LOG.debug("Monitor Profile Get operation for input profile- {}", input.getProfile());
RpcResultBuilder<MonitorProfileGetOutput> rpcResultBuilder;
final Long profileId = getExistingProfileId(input);
MonitorProfileGetOutputBuilder output = new MonitorProfileGetOutputBuilder().setProfileId(profileId);
rpcResultBuilder = RpcResultBuilder.success();
rpcResultBuilder.withResult(output.build());
return Futures.immediateFuture(rpcResultBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetInput in project netvirt by opendaylight.
the class AlivenessMonitorUtils method buildMonitorGetProfile.
private static MonitorProfileGetInput buildMonitorGetProfile(long monitorInterval, long monitorWindow, long failureThreshold, EtherTypes protocolType) {
MonitorProfileGetInputBuilder buildGetProfile = new MonitorProfileGetInputBuilder();
org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.profile.get.input.ProfileBuilder profileBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.profile.get.input.ProfileBuilder();
profileBuilder.setFailureThreshold(failureThreshold).setMonitorInterval(monitorInterval).setMonitorWindow(monitorWindow).setProtocolType(protocolType);
buildGetProfile.setProfile(profileBuilder.build());
return buildGetProfile.build();
}
Aggregations