import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirection;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.HardConstraints;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint32;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class GnpyUtilitiesImpl {
- private static final Logger LOG = LoggerFactory.getLogger(GnpyResult.class);
+ private static final Logger LOG = LoggerFactory.getLogger(GnpyUtilitiesImpl.class);
private NetworkTransactionService networkTransaction;
private PathComputationRequestInput input;
private GnpyTopoImpl gnpyTopo = null;
private GnpyResult gnpyAtoZ;
private GnpyResult gnpyZtoA;
- private Long requestId;
+ private Uint32 requestId;
public GnpyUtilitiesImpl(NetworkTransactionService networkTransaction, PathComputationRequestInput input)
throws GnpyException {
this.input = input;
this.gnpyAtoZ = null;
this.gnpyZtoA = null;
- this.requestId = (long) 0;
+ this.requestId = Uint32.valueOf(0);
}
public boolean verifyComputationByGnpy(AToZDirection atoz, ZToADirection ztoa, PceConstraints pceHardConstraints)
}
public GnpyResult gnpyResponseOneDirection(GnpyServiceImpl gnpySvc) throws GnpyException, Exception {
- requestId++;
+ requestId = Uint32.valueOf((requestId.toJava()) + 1);
List<PathRequest> pathRequestList = gnpySvc.getPathRequest();
List<Synchronization> synchronizationList = gnpySvc.getSynchronization();
// Send the computed path to GNPY tool
synchronizationList);
// Analyze the response
if (gnpyResponse == null) {
- throw new GnpyException("In GnpyUtilities: no respnse from GNPy server");
+ throw new GnpyException("In GnpyUtilities: no response from GNPy server");
}
GnpyResult result = new GnpyResult(gnpyResponse, gnpyTopo);
result.analyzeResult();
return result;
}
- public HardConstraints askNewPathFromGnpy(HardConstraints gnpyPathAsHC, PceConstraints pceHardConstraints)
+ public HardConstraints askNewPathFromGnpy(PceConstraints pceHardConstraints)
throws GnpyException, Exception {
AToZDirection atoztmp = new AToZDirectionBuilder()
GnpyResult result = gnpyResponseOneDirection(gnpySvc);
if (result == null) {
- throw new GnpyException("In GnpyUtilities: no response from the GNPy server");
+ throw new GnpyException("In GnpyUtilities: no result from the GNPy server");
}
if (!result.getPathFeasibility()) {
return null;
}
List<PathRouteObjects> pathRouteObjectList = result.analyzeResult();
- gnpyPathAsHC = result.computeHardConstraintsFromGnpyPath(pathRouteObjectList);
-
- return gnpyPathAsHC;
+ return result.computeHardConstraintsFromGnpyPath(pathRouteObjectList);
}
public String getGnpyResponse(List<Elements> elementsList, List<Connections> connectionsList,
.replace("gnpy-path-computation-simplified:", "")
.replace("gnpy-network-topology:", "");
- String gnpyResponse = connect.gnpyCnx(gnpyJsonModified);
- return gnpyResponse;
+ return connect.returnGnpyResponse(gnpyJsonModified);
}
public GnpyResult getGnpyAtoZ() {