Sho SHIMIZU

Refactor: Extract method

Change-Id: I729f679f2adcdc8507f0bb24a2d89117df18a5e6
......@@ -290,20 +290,24 @@ public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircu
}
private boolean isAllowed(OpticalCircuitIntent circuitIntent, OpticalConnectivityIntent connIntent) {
ConnectPoint srcStaticPort = staticPort(circuitIntent.getSrc());
if (srcStaticPort != null) {
if (!srcStaticPort.equals(connIntent.getSrc())) {
return false;
}
if (!isAllowed(circuitIntent.getSrc(), connIntent.getSrc())) {
return false;
}
ConnectPoint dstStaticPort = staticPort(circuitIntent.getDst());
if (dstStaticPort != null) {
if (!dstStaticPort.equals(connIntent.getDst())) {
if (!isAllowed(circuitIntent.getDst(), connIntent.getDst())) {
return false;
}
return true;
}
private boolean isAllowed(ConnectPoint circuitCp, ConnectPoint connectivityCp) {
ConnectPoint srcStaticPort = staticPort(circuitCp);
if (srcStaticPort != null) {
if (!srcStaticPort.equals(connectivityCp)) {
return false;
}
}
return true;
}
......