Search in sources :

Example 1 with TunnelList

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.TunnelList in project genius by opendaylight.

the class ItmMonitorIntervalWorker method toggleTunnelMonitoring.

private void toggleTunnelMonitoring(WriteTransaction transaction) {
    List<String> tunnelList = ItmUtils.getInternalTunnelInterfaces(dataBroker);
    LOG.debug("ItmMonitorIntervalWorker toggleTunnelMonitoring: List of tunnel interfaces: {}", tunnelList);
    InstanceIdentifier<TunnelMonitorInterval> iid = InstanceIdentifier.builder(TunnelMonitorInterval.class).build();
    TunnelMonitorInterval intervalBuilder = new TunnelMonitorIntervalBuilder().setInterval(interval).build();
    ItmUtils.asyncUpdate(LogicalDatastoreType.OPERATIONAL, iid, intervalBuilder, dataBroker, ItmUtils.DEFAULT_CALLBACK);
    for (String tunnel : tunnelList) {
        toggle(tunnel, transaction);
    }
}
Also used : TunnelMonitorIntervalBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.TunnelMonitorIntervalBuilder) TunnelMonitorInterval(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.TunnelMonitorInterval)

Example 2 with TunnelList

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.TunnelList in project genius by opendaylight.

the class ItmMonitorToggleWorker method toggleTunnelMonitoring.

private void toggleTunnelMonitoring(WriteTransaction transaction) {
    List<String> tunnelList = ItmUtils.getInternalTunnelInterfaces(dataBroker);
    LOG.debug("toggleTunnelMonitoring: TunnelList size {}", tunnelList.size());
    InstanceIdentifier<TunnelMonitorParams> iid = InstanceIdentifier.builder(TunnelMonitorParams.class).build();
    TunnelMonitorParams protocolBuilder = new TunnelMonitorParamsBuilder().setEnabled(enabled).setMonitorProtocol(monitorProtocol).build();
    LOG.debug("toggleTunnelMonitoring: Updating Operational DS");
    ItmUtils.asyncUpdate(LogicalDatastoreType.OPERATIONAL, iid, protocolBuilder, dataBroker, ItmUtils.DEFAULT_CALLBACK);
    for (String tunnel : tunnelList) {
        toggle(tunnel, transaction);
    }
}
Also used : TunnelMonitorParamsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.TunnelMonitorParamsBuilder) TunnelMonitorParams(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.TunnelMonitorParams)

Aggregations

TunnelMonitorInterval (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.TunnelMonitorInterval)1 TunnelMonitorIntervalBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.TunnelMonitorIntervalBuilder)1 TunnelMonitorParams (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.TunnelMonitorParams)1 TunnelMonitorParamsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.TunnelMonitorParamsBuilder)1