mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-21 20:31:00 +02:00
Refactor: Narrow data provided to method
Change-Id: Ib871410d36214457eb1291f308332f35e4e807c5
This commit is contained in:
parent
5c3c091c9f
commit
6d10aed94b
@ -199,7 +199,8 @@ public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircu
|
|||||||
// slots are used only for devices supporting multiplexing
|
// slots are used only for devices supporting multiplexing
|
||||||
Set<TributarySlot> slots = Collections.emptySet();
|
Set<TributarySlot> slots = Collections.emptySet();
|
||||||
|
|
||||||
OpticalConnectivityIntent connIntent = findOpticalConnectivityIntent(intent, multiplexingSupported);
|
OpticalConnectivityIntent connIntent = findOpticalConnectivityIntent(intent.getSrc(), intent.getDst(),
|
||||||
|
intent.getSignalType(), multiplexingSupported);
|
||||||
if ((connIntent != null) && multiplexingSupported) {
|
if ((connIntent != null) && multiplexingSupported) {
|
||||||
// Allocate TributarySlots on existing OCH ports
|
// Allocate TributarySlots on existing OCH ports
|
||||||
slots = assignTributarySlots(intent, Pair.of(connIntent.getSrc(), connIntent.getDst()));
|
slots = assignTributarySlots(intent, Pair.of(connIntent.getSrc(), connIntent.getDst()));
|
||||||
@ -302,14 +303,18 @@ public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircu
|
|||||||
/**
|
/**
|
||||||
* Returns existing and available optical connectivity intent that matches the given circuit intent.
|
* Returns existing and available optical connectivity intent that matches the given circuit intent.
|
||||||
*
|
*
|
||||||
* @param circuitIntent optical circuit intent
|
* @param src source connect point of optical circuit intent
|
||||||
|
* @param dst destination connect point of optical circuit intent
|
||||||
|
* @param signalType signal type of optical circuit intent
|
||||||
* @param multiplexingSupported indicates whether ODU multiplexing is supported
|
* @param multiplexingSupported indicates whether ODU multiplexing is supported
|
||||||
* @return existing optical connectivity intent, null otherwise.
|
* @return existing optical connectivity intent, null otherwise.
|
||||||
*/
|
*/
|
||||||
private OpticalConnectivityIntent findOpticalConnectivityIntent(OpticalCircuitIntent circuitIntent,
|
private OpticalConnectivityIntent findOpticalConnectivityIntent(ConnectPoint src,
|
||||||
boolean multiplexingSupported) {
|
ConnectPoint dst,
|
||||||
|
CltSignalType signalType,
|
||||||
|
boolean multiplexingSupported) {
|
||||||
|
|
||||||
OduSignalType oduSignalType = mappingCltSignalTypeToOduSignalType(circuitIntent.getSignalType());
|
OduSignalType oduSignalType = mappingCltSignalTypeToOduSignalType(signalType);
|
||||||
|
|
||||||
for (Intent intent : intentService.getIntents()) {
|
for (Intent intent : intentService.getIntents()) {
|
||||||
if (!(intent instanceof OpticalConnectivityIntent)) {
|
if (!(intent instanceof OpticalConnectivityIntent)) {
|
||||||
@ -318,16 +323,13 @@ public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircu
|
|||||||
|
|
||||||
OpticalConnectivityIntent connIntent = (OpticalConnectivityIntent) intent;
|
OpticalConnectivityIntent connIntent = (OpticalConnectivityIntent) intent;
|
||||||
|
|
||||||
ConnectPoint src = circuitIntent.getSrc();
|
|
||||||
ConnectPoint dst = circuitIntent.getDst();
|
|
||||||
// Ignore if the intents don't have identical src and dst devices
|
// Ignore if the intents don't have identical src and dst devices
|
||||||
if (!src.deviceId().equals(connIntent.getSrc().deviceId()) ||
|
if (!src.deviceId().equals(connIntent.getSrc().deviceId()) ||
|
||||||
!dst.deviceId().equals(connIntent.getDst().deviceId())) {
|
!dst.deviceId().equals(connIntent.getDst().deviceId())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(isAllowed(circuitIntent.getSrc(), connIntent.getSrc()) &&
|
if (!(isAllowed(src, connIntent.getSrc()) && isAllowed(dst, connIntent.getDst()))) {
|
||||||
isAllowed(circuitIntent.getDst(), connIntent.getDst()))) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user