+ public void pathComputation() throws Exception {
+ // Comput the path according to the constraints of PCE
+ rc = pathComputationPCE();
+
+ LOG.info("setPathDescription ...");
+ AToZDirection atoz = rc.getAtoZDirection();
+ ZToADirection ztoa = rc.getZtoADirection();
+ ConnectToGnpyServer connectToGnpy = new ConnectToGnpyServer();
+ if ((atoz == null) || (atoz.getAToZ() == null)) {
+ rc.setRC("400");
+ LOG.warn("In PCE pathComputation: empty atoz path after description: result = {}", rc.toString());
+ return;
+ } else {
+ // Send the computed path A-to-Z to GNPY tool
+ if (connectToGnpy.isGnpyURLExist()) {
+ ExtractTopoDataStoreImpl xtrTopo = new ExtractTopoDataStoreImpl(dataBroker, input, atoz, gnpyRequestId);
+ gnpyRequestId++;
+ List<Elements> elementsList1 = xtrTopo.getElements();
+ List<Connections> connectionsList1 = xtrTopo.getConnections();
+ List<PathRequest> pathRequestList1 = xtrTopo.getPathRequest();
+ List<Synchronization> synchronizationList1 = xtrTopo.getSynchronization();
+ String gnpyResponse1 = getGnpyResponse(elementsList1, connectionsList1, pathRequestList1,
+ synchronizationList1);
+ // Analyze the response
+ if (gnpyResponse1 != null) {
+ GnpyResult gnpyResult = new GnpyResult(gnpyResponse1);
+ LOG.debug("GNPy result created");
+ gnpyResult.analyzeResult();
+ } else {
+ LOG.error("No response from the GNPy server");
+ }
+ }
+ }
+
+ if ((ztoa == null) || (ztoa.getZToA() == null)) {
+ rc.setRC("400");
+ LOG.error("In pathComputation empty ztoa path after description: result = {}", rc.toString());
+ return;
+ } else {
+ // Send the computed path Z-to-A to GNPY tool
+ if (connectToGnpy.isGnpyURLExist()) {
+ ExtractTopoDataStoreImpl xtrTopo = new ExtractTopoDataStoreImpl(dataBroker, input, ztoa, gnpyRequestId);
+ gnpyRequestId++;
+ List<Elements> elementsList2 = xtrTopo.getElements();
+ List<Connections> connectionsList2 = xtrTopo.getConnections();
+ List<PathRequest> pathRequestList2 = xtrTopo.getPathRequest();
+ List<Synchronization> synchronizationList2 = xtrTopo.getSynchronization();
+ String gnpyResponse2 = getGnpyResponse(elementsList2, connectionsList2, pathRequestList2,
+ synchronizationList2);
+ // Analyze the response
+ if (gnpyResponse2 != null) {
+ GnpyResult gnpyResult = new GnpyResult(gnpyResponse2);
+ LOG.debug("GNPy result created");
+ gnpyResult.analyzeResult();
+ } else {
+ LOG.info("No response from the GNPy server");
+ }
+ }
+ }
+ // Set the description of the path
+ setPathDescription(new PathDescriptionBuilder().setAToZDirection(atoz).setZToADirection(ztoa));
+ LOG.info("In pathComputation Graph is Found");
+ }
+
+ public PceResult pathComputationPCE() {