Search in sources :

Example 1 with MonitorProfileGetInput

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();
}
Also used : MonitorProfileGetInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetInputBuilder) ProfileBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.profile.create.input.ProfileBuilder)

Example 2 with MonitorProfileGetInput

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);
}
Also used : EtherTypes(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.EtherTypes)

Example 3 with MonitorProfileGetInput

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());
}
Also used : MonitorProfileGetOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetOutputBuilder) MonitorProfileGetOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetOutput)

Example 4 with MonitorProfileGetInput

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();
}
Also used : MonitorProfileGetInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetInputBuilder) ProfileBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.profile.create.input.ProfileBuilder)

Aggregations

MonitorProfileGetInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetInputBuilder)2 ProfileBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.monitor.profile.create.input.ProfileBuilder)2 EtherTypes (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.EtherTypes)1 MonitorProfileGetOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetOutput)1 MonitorProfileGetOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.MonitorProfileGetOutputBuilder)1