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) {
Optional<Node> 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
.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();
Optional<Link> 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();
Optional<OwnedNodeEdgePoint> 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) {
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;
}
}