X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=tapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Ftapi%2Futils%2FTapiContext.java;fp=tapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Ftapi%2Futils%2FTapiContext.java;h=14fdb46df990f45c6776d470db1309b71c9001bc;hb=783bace750145350d44a37d9c6a631efe42c7fce;hp=8de4e6faf3d24e7538cfaf8660cbb700ccd90dca;hpb=6b54ed61ef5c53b37bb35d5319835819c806b46e;p=transportpce.git diff --git a/tapi/src/main/java/org/opendaylight/transportpce/tapi/utils/TapiContext.java b/tapi/src/main/java/org/opendaylight/transportpce/tapi/utils/TapiContext.java index 8de4e6faf..14fdb46df 100644 --- a/tapi/src/main/java/org/opendaylight/transportpce/tapi/utils/TapiContext.java +++ b/tapi/src/main/java/org/opendaylight/transportpce/tapi/utils/TapiContext.java @@ -56,6 +56,7 @@ public class TapiContext { private static final Logger LOG = LoggerFactory.getLogger(TapiContext.class); public static final String TAPI_CONTEXT = "T-API context"; + public static final String NODE_NOT_PRESENT = "Node is not present in datastore"; private final NetworkTransactionService networkTransactionService; public TapiContext(NetworkTransactionService networkTransactionService) { @@ -256,7 +257,7 @@ public class TapiContext { Optional optNode = this.networkTransactionService.read(LogicalDatastoreType.OPERATIONAL, nodeIID) .get(); if (!optNode.isPresent()) { - LOG.error("Node is not present in datastore"); + LOG.error(NODE_NOT_PRESENT); return null; } // TODO -> Need to remove CEPs from NEPs. If not error from get Topology details output @@ -305,7 +306,7 @@ public class TapiContext { .read(LogicalDatastoreType.OPERATIONAL, nepIID) .get(); if (!optNode.isPresent()) { - LOG.error("Node is not present in datastore"); + LOG.error(NODE_NOT_PRESENT); return null; } return optNode.get(); @@ -325,7 +326,7 @@ public class TapiContext { Optional optLink = this.networkTransactionService.read(LogicalDatastoreType.OPERATIONAL, linkIID) .get(); if (!optLink.isPresent()) { - LOG.error("Node is not present in datastore"); + LOG.error(NODE_NOT_PRESENT); return null; } return optLink.get(); @@ -483,7 +484,7 @@ public class TapiContext { Optional optNode = this.networkTransactionService .read(LogicalDatastoreType.OPERATIONAL, nepIID).get(); if (!optNode.isPresent()) { - LOG.error("Node is not present in datastore"); + LOG.error(NODE_NOT_PRESENT); return null; } if (optNode.get().augmentation(OwnedNodeEdgePoint1.class) == null) { @@ -493,7 +494,7 @@ public class TapiContext { return optNode.get().augmentation(OwnedNodeEdgePoint1.class).getCepList().getConnectionEndPoint() .get(new ConnectionEndPointKey(cepUuid)); } catch (InterruptedException | ExecutionException e) { - LOG.error("Couldnt read node in topology"); + LOG.error("Couldnt read node in topology", e); return null; } }