public class CrossConnectImpl221 {
private static final Logger LOG = LoggerFactory.getLogger(CrossConnectImpl221.class);
+ private static final String DEV_TRANSACTION_NOT_FOUND = "Device transaction for device {} was not found!";
+ private static final String UNABLE_DEV_TRANSACTION = "Unable to obtain device transaction for device {}!";
private final DeviceTransactionManager deviceTransactionManager;
public CrossConnectImpl221(DeviceTransactionManager deviceTransactionManager) {
if (deviceTxOpt.isPresent()) {
deviceTx = deviceTxOpt.get();
} else {
- LOG.error("Device transaction for device {} was not found!", deviceId);
+ LOG.error(DEV_TRANSACTION_NOT_FOUND, deviceId);
return Optional.empty();
}
} catch (InterruptedException | ExecutionException e) {
- LOG.error("Unable to obtain device transaction for device {}!", deviceId, e);
+ LOG.error(UNABLE_DEV_TRANSACTION, deviceId, e);
return Optional.empty();
}
if (deviceTxOpt.isPresent()) {
deviceTx = deviceTxOpt.get();
} else {
- LOG.error("Device transaction for device {} was not found!", deviceId);
+ LOG.error(DEV_TRANSACTION_NOT_FOUND, deviceId);
return null;
}
} catch (InterruptedException | ExecutionException e) {
- LOG.error("Unable to obtain device transaction for device {}!", deviceId, e);
+ LOG.error(UNABLE_DEV_TRANSACTION, deviceId, e);
return null;
}
if (deviceTxOpt.isPresent()) {
deviceTx = deviceTxOpt.get();
} else {
- LOG.error("Device transaction for device {} was not found!", deviceId);
+ LOG.error(DEV_TRANSACTION_NOT_FOUND, deviceId);
return Optional.empty();
}
} catch (InterruptedException | ExecutionException e) {
- LOG.error("Unable to obtain device transaction for device {}!", deviceId, e);
+ LOG.error(UNABLE_DEV_TRANSACTION, deviceId, e);
return Optional.empty();
}
}
public boolean addNode(String deviceId, String openROADMversion) {
- boolean sqlResult = false;
+ //boolean sqlResult = false;
return inode121.addNode(deviceId);
}
} catch (SQLException e) {
LOG.error("Something wrong when fetching node in DB", e);
}
- return nodeExists == 0 ? false : true;
+ return nodeExists != 0;
}
public boolean dataExists(String tableName, String searchKeys) {
} catch (SQLException e) {
LOG.error("Something wrong when fetching data in DB", e);
}
- return dataExists == 0 ? false : true;
+ return dataExists != 0;
}
/* public void getRoadmShelves(String nodeId, String openRoadmVersion)
} catch (SQLException e) {
LOG.error("Something wrong when fetching node in DB", e);
}
- return nodeExists == 0 ? false : true;
+ return nodeExists != 0;
}
public void getRoadmShelves(String nodeId) throws InterruptedException, ExecutionException {
} catch (SQLException e) {
LOG.error("Something wrong when fetching node in DB", e);
}
- return nodeExists == 0 ? false : true;
+ return nodeExists != 0;
}
public void getRoadmShelves(String nodeId) throws InterruptedException, ExecutionException {
LOG.info("Serialized event {}", serialized);
return serialized.getBytes(StandardCharsets.UTF_8);
} catch (IOException e) {
+ LOG.error("exception raised during serialization", e);
return new byte[0];
}
}
LOG.info("Serialized event {}", serialized);
return serialized.getBytes(StandardCharsets.UTF_8);
} catch (IOException e) {
+ LOG.error("exception raised during serialization", e);
return new byte[0];
}
}
LOG.warn("Kafka property file '{}' is empty", propertyFileName);
}
} catch (IOException e) {
- LOG.warn("Kafka property file '{}' was not found in the classpath", propertyFileName);
+ LOG.error("Kafka property file '{}' was not found in the classpath", propertyFileName, e);
}
return props;
}
counter++;
}
} catch (IllegalArgumentException e) {
- LOG.debug(" in GnpyResult: the element {} is not a ipv4Address ", nodeIp);
+ LOG.error(" in GnpyResult: the element {} is not a ipv4Address ", nodeIp, e);
}
}
}
public class OpenRoadmInterface710 {
private static final String MAPPING_ERROR_EXCEPTION_MESSAGE =
"Unable to get mapping from PortMapping for node % and logical connection port %s";
+ private static final String ODUC4 = "-ODUC4";
private final PortMapping portMapping;
private final OpenRoadmInterfaces openRoadmInterfaces;
.setMaintTestsignal(maintTestsignal.build());
InterfaceBuilder oduInterfaceBuilder = createGenericInterfaceBuilder(portMap, OtnOdu.class,
- logicalConnPoint + "-ODUC4");
+ logicalConnPoint + ODUC4);
// Create a list
List<String> listSupportingOtucnInterface = new ArrayList<>();
.setMaintTestsignal(maintTestsignal.build());
InterfaceBuilder oduInterfaceBuilder = createGenericInterfaceBuilder(portMapA, OtnOdu.class,
- alogicalConnPoint + "-ODUC4");
+ alogicalConnPoint + ODUC4);
// Create a list
List<String> listSupportingOtucnInterface = new ArrayList<>();
.setMaintTestsignal(maintTestsignal.build());
InterfaceBuilder oduInterfaceBuilder = createGenericInterfaceBuilder(portMap, OtnOdu.class,
- logicalConnPoint + "-ODUC4");
+ logicalConnPoint + ODUC4);
// Create a list
List<String> listSupportingOtucnInterface = new ArrayList<>();
.setMaintTestsignal(maintTestsignal.build());
InterfaceBuilder oduInterfaceBuilder = createGenericInterfaceBuilder(portMapA, OtnOdu.class,
- alogicalConnPoint + "-ODUC4");
+ alogicalConnPoint + ODUC4);
// Create a list
List<String> listSupportingOtucnInterface = new ArrayList<>();
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;
}
}