use of org.onosproject.net.behaviour.protection.ProtectionConfigBehaviour in project onos by opennetworkinglab.
the class RoadmManager method getProtectionConfig.
private ProtectionConfigBehaviour getProtectionConfig(DeviceId deviceId) {
Device device = deviceService.getDevice(deviceId);
if (device != null && device.is(ProtectionConfigBehaviour.class)) {
return device.as(ProtectionConfigBehaviour.class);
}
// Do not need warning here for port polling.
log.debug("Unable to load ProtectionConfigBehaviour for {}", deviceId);
return null;
}
use of org.onosproject.net.behaviour.protection.ProtectionConfigBehaviour in project onos by opennetworkinglab.
the class RoadmManager method setProtectionSwitchWorkingPath.
@Deprecated
@Override
public void setProtectionSwitchWorkingPath(DeviceId deviceId, int index) {
checkNotNull(deviceId);
ProtectionConfigBehaviour behaviour = getProtectionConfig(deviceId);
if (behaviour == null) {
return;
}
Map<ConnectPoint, ProtectedTransportEndpointState> map = getProtectionSwitchStates(behaviour);
if (map == null) {
log.warn("Failed to get protected transport endpoint state in device {}", deviceId);
return;
}
if (map.isEmpty()) {
log.warn("No protected transport endpoint state found in device {}", deviceId);
return;
}
behaviour.switchToManual(map.keySet().toArray(new ConnectPoint[0])[0], index);
}
use of org.onosproject.net.behaviour.protection.ProtectionConfigBehaviour in project onos by opennetworkinglab.
the class RoadmManager method configProtectionSwitch.
@Override
public void configProtectionSwitch(DeviceId deviceId, String operation, ConnectPoint identifier, int index) {
checkNotNull(deviceId);
ProtectionConfigBehaviour behaviour = getProtectionConfig(deviceId);
if (behaviour == null) {
return;
}
// automatic operation
if (OPS_OPT_AUTO.equals(operation)) {
behaviour.switchToAutomatic(identifier);
return;
}
// force or manual operation
if (OPS_OPT_MANUAL.equals(operation)) {
behaviour.switchToManual(identifier, index);
} else if (OPS_OPT_FORCE.equals(operation)) {
behaviour.switchToForce(identifier, index);
}
}
Aggregations