return store;
}
- private final class SchemaContextHolder implements DOMSchemaService, SchemaContextProvider {
+ private static final class SchemaContextHolder implements DOMSchemaService, SchemaContextProvider {
private final SchemaContext schemaContext;
private final ListenerRegistry<SchemaContextListener> listeners;
*/
package org.opendaylight.transportpce.common.converter;
-import com.google.common.base.Preconditions;
+//import com.google.common.base.Preconditions;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
public <T extends DataObject> Optional<T> getDataObject(
@Nonnull NormalizedNode<?, ?> normalizedNode,
@Nonnull QName rootNode) {
- Preconditions.checkNotNull(normalizedNode);
+ //Preconditions.checkNotNull(normalizedNode);
if (normalizedNode instanceof ContainerNode) {
YangInstanceIdentifier.PathArgument directChildIdentifier =
YangInstanceIdentifier.of(rootNode).getLastPathArgument();
JsonReader reader = new JsonReader(new InputStreamReader(inputStream, "UTF-8"));
return parseInputJSON(reader);
} catch (IOException e) {
- LOG.warn(e.getMessage(), e);
+ LOG.warn("IOException {}",e.getMessage());
return Optional.empty();
}
}
getSchemaContext())) {
jsonParser.parse(reader);
} catch (IOException e) {
- LOG.warn("An error {} occured during parsing Json input stream", e.getMessage(), e);
+ LOG.warn("An error occured during parsing Json input stream", e);
return Optional.empty();
}
return Optional.ofNullable(result.getResult());
XMLStreamReader reader = this.xmlInputFactory.createXMLStreamReader(inputStream);
return parseInputXML(reader);
} catch (XMLStreamException e) {
- LOG.warn(e.getMessage(), e);
+ LOG.warn("XMLStreamException: {}", e.getMessage());
return Optional.empty();
}
}
XMLStreamReader reader = this.xmlInputFactory.createXMLStreamReader(inputReader);
return parseInputXML(reader, parentSchema);
} catch (XMLStreamException e) {
- LOG.warn(e.getMessage(), e);
+ LOG.warn("XMLStreamException: {}", e.getMessage());
return Optional.empty();
}
}
XMLStreamReader reader = this.xmlInputFactory.createXMLStreamReader(inputReader);
return parseInputXML(reader);
} catch (XMLStreamException e) {
- LOG.warn(e.getMessage(), e);
+ LOG.warn("XMLStreamException: {}", e.getMessage());
return Optional.empty();
}
}
XmlParserStream xmlParser = XmlParserStream.create(streamWriter, getSchemaContext(), parentSchemaNode)) {
xmlParser.parse(reader);
} catch (XMLStreamException | URISyntaxException | IOException | SAXException e) {
- LOG.warn("An error {} occured during parsing XML input stream", e.getMessage(), e);
+ LOG.warn("An error occured during parsing XML input stream", e);
return Optional.empty();
}
return Optional.ofNullable(result.getResult());
factory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true);
xmlStreamWriter = factory.createXMLStreamWriter(backingWriter);
} catch (XMLStreamException | FactoryConfigurationError e) {
- LOG.error("Error [{}] while creating XML writer", e.getMessage(), e);
+ LOG.error("Error while creating XML writer: ", e);
throw new IllegalStateException(e);
}
return xmlStreamWriter;
else if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_2_2_1)) {
return crossConnectImpl221.getCrossConnect(nodeId,connectionNumber);
}
- return null;
+ return Optional.empty();
}
return crossConnectImpl221.postCrossConnect(nodeId, waveNumber, srcTp, destTp);
}
LOG.info("Device Version not found");
- return null;
+ return Optional.empty();
}
LOG.info("Roadm-connection successfully created: {}-{}-{}", srcTp, destTp, waveNumber);
return Optional.of(connectionNumber);
} catch (InterruptedException | ExecutionException e) {
- LOG.warn("Failed to post {}. Exception: {}", rdmConnBldr.build(), e);
+ LOG.warn("Failed to post {}. Exception: ", rdmConnBldr.build(), e);
}
return Optional.empty();
}
Optional<RoadmConnections> rdmConnOpt = getCrossConnect(deviceId, connectionNumber);
if (rdmConnOpt.isPresent()) {
- RoadmConnectionsBuilder rdmConnBldr = new RoadmConnectionsBuilder(rdmConnOpt.get());
- rdmConnBldr.setOpticalControlMode(OpticalControlMode.class.cast(mode));
+ RoadmConnectionsBuilder rdmConnBldr = new RoadmConnectionsBuilder(rdmConnOpt.get())
+ .setOpticalControlMode(OpticalControlMode.class.cast(mode));
if (powerValue != null) {
rdmConnBldr.setTargetOutputPower(new PowerDBm(powerValue));
}
LOG.info("Roadm-connection successfully created: {}-{}-{}", srcTp, destTp, waveNumber);
return Optional.of(connectionNumber);
} catch (InterruptedException | ExecutionException e) {
- LOG.warn("Failed to post {}. Exception: {}", rdmConnBldr.build(), e);
+ LOG.warn("Failed to post {}. Exception: ", rdmConnBldr.build(), e);
}
return Optional.empty();
}
Optional<RoadmConnections> xc = getCrossConnect(deviceId, connectionName);
//Check if cross connect exists before delete
if (xc.isPresent()) {
- String name = xc.get().getSource().getSrcIf();
- name.replace("nmc", "mc");
+ String name = xc.get().getSource().getSrcIf().replace("nmc", "mc");
interfList.add(xc.get().getSource().getSrcIf());
interfList.add(xc.get().getDestination().getDstIf());
interfList.add(xc.get().getSource().getSrcIf().replace("nmc", "mc"));
future.addCallback(new FutureCallback<CommitInfo>() {
@Override
public void onSuccess(@Nullable CommitInfo result) {
- LOG.debug("Transaction with lock {} successfully committed:", deviceLock, result);
+ LOG.debug("Transaction with lock {} successfully committed: {}", deviceLock, result);
afterClose();
}
LOG.debug("Timeout to submit transaction run out! Transaction was {} submitted or canceled.",
deviceTx.wasSubmittedOrCancelled().get() ? "" : "not");
if (!deviceTx.wasSubmittedOrCancelled().get()) {
- LOG.error(String.format("Transaction for node %s was not submitted or canceled after %s"
- + " milliseconds! Cancelling transaction!", deviceId,
- timeoutToSubmit));
+ LOG.error(
+ "Transaction for node {} not submitted/canceled after {} ms. Cancelling transaction.",
+ deviceId, timeoutToSubmit);
deviceTx.cancel();
}
}
private double wavelength;
// wavelengthSpacing is in GHz
float wavelengthSpacing = 50;
- // beginWavelength is in nm: f or F is appended to treat it explicitly as simple float (and not double float)
- final float beginWavelength = 1528.77f;
+ // BEGIN_WAVELENGTH is in nm: f or F is appended to treat it explicitly as simple float (and not double float)
+ static final float BEGIN_WAVELENGTH = 1528.77f;
// java double is double float - d or D is appended to treat it explicitly as double float
- final double precision = 10000d;
+ static final double PRECISION = 10000d;
public FixedFlexImpl(Long index, double centreFrequency, double start, double stop, double wavelength) {
this.index = index;
public FixedFlexImpl(long wlIndex) {
this.centerFrequency = 196.1 - (wlIndex - 1) * wavelengthSpacing / 1000;
// Truncate the value to the two decimal places
- this.centerFrequency = Math.round(this.centerFrequency * precision) / precision;
+ this.centerFrequency = Math.round(this.centerFrequency * PRECISION) / PRECISION;
this.start = this.centerFrequency - (wavelengthSpacing / 2) / 1000;
- this.start = Math.round(this.start * precision) / precision;
+ this.start = Math.round(this.start * PRECISION) / PRECISION;
this.stop = this.centerFrequency + (wavelengthSpacing / 2) / 1000;
- this.stop = Math.round(this.stop * precision) / precision;
- this.wavelength = beginWavelength + ((wlIndex - 1) * 0.40);
- this.wavelength = Math.round(this.wavelength * precision) / precision;
+ this.stop = Math.round(this.stop * PRECISION) / PRECISION;
+ this.wavelength = BEGIN_WAVELENGTH + ((wlIndex - 1) * 0.40);
+ this.wavelength = Math.round(this.wavelength * PRECISION) / PRECISION;
}
@Override
long mappedWL = 61 - wlIndex;
FixedFlexImpl fixedFlex = new FixedFlexImpl();
fixedFlex.centerFrequency = 193.1 + (50.0 / 1000.0) * mappedWL;
- fixedFlex.centerFrequency = Math.round(fixedFlex.centerFrequency * precision) / precision;
- fixedFlex.wavelength = beginWavelength + ((wlIndex - 1) * 0.40);
- fixedFlex.wavelength = Math.round(fixedFlex.wavelength * precision) / precision;
+ fixedFlex.centerFrequency = Math.round(fixedFlex.centerFrequency * PRECISION) / PRECISION;
+ fixedFlex.wavelength = BEGIN_WAVELENGTH + ((wlIndex - 1) * 0.40);
+ fixedFlex.wavelength = Math.round(fixedFlex.wavelength * PRECISION) / PRECISION;
fixedFlex.start = 193.1 + (50.0 * mappedWL - 25) / 1000.0;
- fixedFlex.start = Math.round(fixedFlex.start * precision) / precision;
+ fixedFlex.start = Math.round(fixedFlex.start * PRECISION) / PRECISION;
fixedFlex.stop = 193.1 + (50.0 * mappedWL + 25) / 1000.0;
- fixedFlex.stop = Math.round(fixedFlex.stop * precision) / precision;
+ fixedFlex.stop = Math.round(fixedFlex.stop * PRECISION) / PRECISION;
fixedFlex.index = wlIndex;
return fixedFlex;
}
package org.opendaylight.transportpce.common.mapping;
import com.google.common.util.concurrent.FluentFuture;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
degrees.add(ordmDegreeObject.get());
}
}
- LOG.info("Device {} has {} degree", degrees.size());
+ LOG.info("Device {} has {} degree", deviceId, degrees.size());
return degrees;
}
interfaceName = interfaceList.get(circuitPackName);
}
return new CpToDegreeBuilder().withKey(new CpToDegreeKey(circuitPackName)).setCircuitPackName(circuitPackName)
- .setDegreeNumber(new Long(degreeNumber)).setInterfaceName(interfaceName).build();
+ .setDegreeNumber(Long.valueOf(degreeNumber)).setInterfaceName(interfaceName).build();
}
private Mapping createMappingObject(String nodeId, Ports port, String circuitPackName,
// some LOG messages are too long
@SuppressWarnings("checkstyle:linelength")
+ @SuppressFBWarnings("DM_CONVERT_CASE")
private boolean createTtpPortMapping(String nodeId, Info deviceInfo, List<Mapping> portMapList) {
// Creating mapping data for degree TTP's
List<Degree> degrees = getDegrees(nodeId, deviceInfo);
&& Direction.Tx.getIntValue() == port2.getPortDirection().getIntValue()
&& port1.getPartnerPort() != null && port2.getPartnerPort() != null
&& port1.getPartnerPort().getCircuitPackName().equals(cp2Name)
- && port1.getPartnerPort().getPortName().equals(port2.getPortName().toString())
+ && port1.getPartnerPort().getPortName().equals(port2.getPortName())
&& port2.getPartnerPort().getCircuitPackName().equals(cp1Name)
&& port2.getPartnerPort().getPortName().equals(port1.getPortName()))
||
&& Direction.Tx.getIntValue() == port1.getPortDirection().getIntValue()
&& port1.getPartnerPort() != null && port2.getPartnerPort() != null
&& port1.getPartnerPort().getCircuitPackName().equals(cp2Name)
- && port1.getPartnerPort().getPortName().equals(port2.getPortName().toString())
+ && port1.getPartnerPort().getPortName().equals(port2.getPortName())
&& port2.getPartnerPort().getCircuitPackName().equals(cp1Name)
- && port2.getPartnerPort().getPortName().equals(port1.getPortName().toString()))) {
+ && port2.getPartnerPort().getPortName().equals(port1.getPortName()))) {
String logicalConnectionPoint1 = new StringBuilder("DEG").append(k).append("-TTP-")
.append(port1.getPortDirection().getName().toUpperCase()).toString();
LOG.info("{} : Logical Connection Point for {} {} is {}", nodeId,
package org.opendaylight.transportpce.common.mapping;
import com.google.common.util.concurrent.FluentFuture;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
degrees.add(ordmDegreeObject.get());
}
}
- LOG.info("Device {} has {} degree", degrees.size());
+ LOG.info("Device {} has {} degree", deviceId, degrees.size());
return degrees;
}
interfaceName = interfaceList.get(circuitPackName);
}
return new CpToDegreeBuilder().withKey(new CpToDegreeKey(circuitPackName)).setCircuitPackName(circuitPackName)
- .setDegreeNumber(new Long(degreeNumber)).setInterfaceName(interfaceName).build();
+ .setDegreeNumber(Long.valueOf(degreeNumber)).setInterfaceName(interfaceName).build();
}
private Mapping createMappingObject(String nodeId, Ports port, String circuitPackName,
//some LOG messages are too long
@SuppressWarnings("checkstyle:linelength")
+ @SuppressFBWarnings("DM_CONVERT_CASE")
private boolean createTtpPortMapping(String nodeId, Info deviceInfo, List<Mapping> portMapList) {
// Creating mapping data for degree TTP's
List<Degree> degrees = getDegrees(nodeId, deviceInfo);
&& Direction.Tx.getIntValue() == port2.getPortDirection().getIntValue()
&& port1.getPartnerPort() != null && port2.getPartnerPort() != null
&& port1.getPartnerPort().getCircuitPackName().equals(cp2Name)
- && port1.getPartnerPort().getPortName().equals(port2.getPortName().toString())
+ && port1.getPartnerPort().getPortName().equals(port2.getPortName())
&& port2.getPartnerPort().getCircuitPackName().equals(cp1Name)
&& port2.getPartnerPort().getPortName().equals(port1.getPortName()))
||
&& Direction.Tx.getIntValue() == port1.getPortDirection().getIntValue()
&& port1.getPartnerPort() != null && port2.getPartnerPort() != null
&& port1.getPartnerPort().getCircuitPackName().equals(cp2Name)
- && port1.getPartnerPort().getPortName().equals(port2.getPortName().toString())
+ && port1.getPartnerPort().getPortName().equals(port2.getPortName())
&& port2.getPartnerPort().getCircuitPackName().equals(cp1Name)
- && port2.getPartnerPort().getPortName().equals(port1.getPortName().toString()))) {
+ && port2.getPartnerPort().getPortName().equals(port1.getPortName()))) {
String logicalConnectionPoint1 = new StringBuilder("DEG").append(k).append("-TTP-")
.append(port1.getPortDirection().getName().toUpperCase()).toString();
LOG.info("{} : Logical Connection Point for {} {} is {}", nodeId,
LOG.info("getInterface for 2.2.1 device {}", nodeId);
return (Optional<T>) openRoadmInterfacesImpl221.getInterface(nodeId,interfaceName);
}
- return null;
+ return Optional.empty();
}
@Override
CircuitPacksBuilder cpBldr = new CircuitPacksBuilder(cp);
boolean change = false;
if (activate) {
- if (cpBldr.getEquipmentState() != null && !cpBldr.getEquipmentState().getName()
- .equals(States.NotReservedInuse)) {
+ if (cpBldr.getEquipmentState() != null
+ && !cpBldr.getEquipmentState().getName().equals(States.NotReservedInuse)) {
cpBldr.setEquipmentState(States.NotReservedInuse);
change = true;
}
- } else if ((cpBldr.getEquipmentState() != null && !cpBldr.getEquipmentState().getName()
- .equals(States.NotReservedAvailable))) {
+ } else if ((cpBldr.getEquipmentState() != null
+ && !cpBldr.getEquipmentState().getName().equals(States.NotReservedAvailable))) {
cpBldr.setEquipmentState(States.NotReservedAvailable);
change = true;
}
*/
package org.opendaylight.transportpce.networkmodel;
+//import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+//even with @SuppressFBwarnings generate a checkstyles error...
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
-
import javax.annotation.Nonnull;
-
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.DataObjectModification;
import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType;
}
@Override
+ //@SuppressFBwarnings("SF_SWITCH_FALLTHROUGH")
public void onDataTreeChanged(@Nonnull Collection<DataTreeModification<Node>> changes) {
LOG.info("onDataTreeChanged");
for (DataTreeModification<Node> change : changes) {
}
return TopologyUtils.deleteLink(nodeId.getValue() + "-" + srcDegId.toString(),
destNodeId.getValue() + "-" + destDegId.toString(),
- srcTpTx.toString(), destTpRx.toString(),networkTransactionService)
+ srcTpTx.toString(), destTpRx.toString(), networkTransactionService)
&& TopologyUtils.deleteLink(destNodeId.getValue() + "-" + destDegId.toString(),
nodeId.getValue() + "-" + srcDegId.toString(), destTpTx, srcTpRx,
networkTransactionService);
}
}
} catch (InterruptedException | ExecutionException ex) {
- LOG.warn("Exception thrown while reading Logical Connection Point value from {} {}", ex);
+ LOG.warn("Exception thrown while reading Logical Connection Point value: ", ex);
}
StringBuilder sb = new StringBuilder(notification.getResource().getDevice().getNodeId()).append(PIPE);
sb.append(buildCause(notification.getProbableCause()));
}
}
} catch (InterruptedException | ExecutionException ex) {
- LOG.warn("Exception thrown while reading Logical Connection Point value from {} {}", ex);
+ LOG.warn("Exception thrown while reading Logical Connection Point value", ex);
}
StringBuilder sb = new StringBuilder(notification.getResource().getDevice().getNodeId().getValue())
.append(PIPE);
} else if (OpenroadmTpType.XPONDERNETWORK.equals(tpType)) {
nbTps = node.getNbTpNetwork();
} else {
- LOG.warn("Wrong tp-type {}, cannot create tp {}", tpType.getName());
+ LOG.warn("Wrong tp-type {}, cannot create tp {}", tpType, tpType.getName());
}
for (int i = 1; i <= nbTps; i++) {
LOG.info("deleting link for {}-{}", srcNode, dstNode);
LinkId linkId = LinkIdUtil.buildLinkId(srcNode, srcTp, dstNode, destTp);
if (deleteLinkLinkId(linkId, networkTransactionService)) {
- LOG.debug("Link Id {} updated to have admin state down");
+ LOG.debug("Link Id {} updated to have admin state down", linkId);
return true;
} else {
LOG.debug("Link Id not found for Source {} and Dest {}", srcNode, dstNode);
LOG.info("deleting link for {}-{}", srcNode, dstNode);
LinkId linkId = LinkIdUtil.buildLinkId(srcNode, srcTp, dstNode, destTp);
if (deleteLinkLinkId(linkId, networkTransactionService)) {
- LOG.debug("Link Id {} updated to have admin state down");
+ LOG.debug("Link Id {} updated to have admin state down", linkId);
return true;
} else {
LOG.debug("Link Id not found for Source {} and Dest {}", srcNode, dstNode);
package org.opendaylight.transportpce.olm.power;
+//import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
* @return true/false based on status of operation.
*/
//TODO Need to Case Optical Power mode/NodeType in case of 2.2 devices
+ //@SuppressFBwarnings("DM_CONVERT_CASE")
public Boolean setPower(ServicePowerSetupInput input) {
LOG.info("Olm-setPower initiated");
for (int i = 0; i < input.getNodes().size(); i++) {
OpticalControlMode.Power, powerValue, connectionNumber);
LOG.info("Success Value is {}", setXconnPowerSuccessVal);
if (setXconnPowerSuccessVal) {
- LOG.info("Roadm-connection: {} updated ");
+ LOG.info("Roadm-connection: {} updated ", connectionNumber);
//The value recommended by the white paper is 20 seconds and not 60.
//TODO - commented code because one vendor is not supporting
//GainLoss with target-output-power
return false;
}
} catch (InterruptedException e) {
- LOG.error("Olm-setPower wait failed {}", e);
+ LOG.error("Olm-setPower wait failed :", e);
return false;
}
}
}
} catch (InterruptedException e) {
// TODO Auto-generated catch block
- LOG.error("Olm-powerTurnDown wait failed {}",e);
+ LOG.error("Olm-powerTurnDown wait failed: ",e);
return false;
}
}
LOG.info("Transponder Power update is committed");
return true;
} catch (InterruptedException | ExecutionException e) {
- LOG.error("Setting transponder power failed {}", e);
+ LOG.error("Setting transponder power failed: ", e);
return false;
}
LOG.info("Transponder Power update is committed");
return true;
} catch (InterruptedException | ExecutionException e) {
- LOG.error("Setting transponder power failed {}", e);
+ LOG.error("Setting transponder power failed: ", e);
}
return false;
}
}
} catch (OpenRoadmInterfaceException e) {
// TODO Auto-generated catch block
- LOG.error("OpenRoadmInterfaceException occured {}",e);
+ LOG.error("OpenRoadmInterfaceException occured: ",e);
} /**catch (InterruptedException e) {
// TODO Auto-generated catch block
} catch (ExecutionException e) {
LOG.info("Executing GetLinkSpanLoss");
BigDecimal spanLoss = new BigDecimal(0);
for (RoadmLinks link : roadmLinks) {
- String sourceNodeId = link.getSrcNodeId().toString();
+ String sourceNodeId = link.getSrcNodeId();
String sourceTpId = link.getSrcTpId();
- String destNodeId = link.getDestNodeId().toString();
+ String destNodeId = link.getDestNodeId();
String destTpId = link.getDestTpid();
OtsPmHolder srcOtsPmHoler = getPmMeasurements(sourceNodeId, sourceTpId, "OpticalPowerOutput");
OtsPmHolder destOtsPmHoler = getPmMeasurements(destNodeId, destTpId, "OpticalPowerInput");
try (ReadTransaction readOnlyTransaction = this.dataBroker.newReadOnlyTransaction()) {
realNode = readOnlyTransaction.read(LogicalDatastoreType.CONFIGURATION, mappedNodeII).get();
} catch (InterruptedException | ExecutionException e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Error on getRealNodeId {} :", mappedNodeId, e);
throw new IllegalStateException(e);
}
if (!realNode.isPresent() || (realNode.get().getSupportingNode() == null)) {
}
break;
default:
- LOG.info("in readDiversity unsupported divercity type", rt);
+ LOG.info("in readDiversity unsupported divercity type {}", rt);
}
} else {
return true;
}).map(aToZ -> {
Node node = ((Node) aToZ.getResource().getResource());
- return node.getNodeId().toString();
+ return node.getNodeId();
}).collect(Collectors.toList());
}
package org.opendaylight.transportpce.pce.gnpy;
-import com.google.common.base.Preconditions;
+//import com.google.common.base.Preconditions;
import com.google.gson.stream.JsonReader;
import java.io.ByteArrayInputStream;
public <T extends DataObject> Optional<T> getDataObject(@Nonnull NormalizedNode<?, ?> normalizedNode,
@Nonnull QName rootNode, BindingNormalizedNodeSerializer codecRegistry) {
if (normalizedNode != null) {
- LOG.debug("GNPy: The codecRegistry is ", codecRegistry.toString());
+ LOG.debug("GNPy: The codecRegistry is {}", codecRegistry.toString());
} else {
LOG.warn("GNPy: The codecRegistry is null");
}
- Preconditions.checkNotNull(normalizedNode);
+ //Preconditions.checkNotNull(normalizedNode);
if (normalizedNode instanceof ContainerNode) {
YangInstanceIdentifier.PathArgument directChildIdentifier = YangInstanceIdentifier.of(rootNode)
.getLastPathArgument();
throw new IllegalStateException(String.format("Could not get the direct child of %s", rootNode));
}
normalizedNode = directChild.get();
- LOG.debug("GNPy: the normalized node is ", normalizedNode.getNodeType());
+ LOG.debug("GNPy: the normalized node is {}", normalizedNode.getNodeType());
}
YangInstanceIdentifier rootNodeYangInstanceIdentifier = YangInstanceIdentifier.of(rootNode);
- LOG.debug("GNPy: the root Node Yang Instance Identifier is ", rootNodeYangInstanceIdentifier.toString());
+ LOG.debug("GNPy: the root Node Yang Instance Identifier is {}", rootNodeYangInstanceIdentifier.toString());
Map.Entry<?, ?> bindingNodeEntry = codecRegistry.fromNormalizedNode(rootNodeYangInstanceIdentifier,
normalizedNode);
if (bindingNodeEntry == null) {
}
for (Elements element : this.elements) {
- if (element.getUid().contains(ipAddress.getIpv4Address().getValue().toString())) {
+ if (element.getUid().contains(ipAddress.getIpv4Address().getValue())) {
if ((this.currentNodeIpAddress == null) || (this.currentNodeIpAddress != ipAddress)) {
this.currentNodeIpAddress = ipAddress;
RouteObjectIncludeExclude routeObjectIncludeExclude = addRouteObjectIncludeExclude(ipAddress, 1);
//Add a link to the route object
private void addLinkToRouteObject(String linkId) throws GnpyException {
if (linkId == null) {
- throw new GnpyException(String.format("In GnpyServiceImpl: the linkId %s does not exist",linkId));
+ throw new GnpyException(String.format("In GnpyServiceImpl: the linkId does not exist"));
}
//Only the ROADM-to-ROADM link are included in the route object
if (!mapLinkFiber.containsKey(linkId)) {
TeTpId teTpId = new TeTpId(teTpValue);
NumUnnumHop numUnnumHop = new org.opendaylight.yang.gen.v1.gnpy.path.rev190502.explicit.route.hop.type.num
.unnum.hop.NumUnnumHopBuilder()
- .setNodeId(teNodeId.getIpv4Address().getValue().toString())
+ .setNodeId(teNodeId.getIpv4Address().getValue())
.setLinkTpId(teTpId.getUint32().toString())
.setHopType(TeHopType.STRICT).build();
Type type1 = new NumUnnumHopBuilder().setNumUnnumHop(numUnnumHop).build();
.setDisjointness(new TePathDisjointness(true, true, false))
.setRequestIdNumber(requestIdNumber).build();
List<Synchronization> synchro = new ArrayList<>();
- Synchronization synchronization1 = new SynchronizationBuilder().setSynchronizationId(new Long(0)).setSvec(svec)
- .build();
+ Synchronization synchronization1 = new SynchronizationBuilder().setSynchronizationId(Long.valueOf(0))
+ .setSvec(svec).build();
synchro.add(synchronization1);
return (synchro);
}
if (commonNetworkNode1.getNodeType().getName().equals("ROADM")) {
if (!nodesList.contains(nodeRef)) {
Elements element = createElementsRoadm(LATITUDE, LONGITUTE, nodeRef,
- openRoadmNetNode1.getShelf(),TARGET_PCH_OUT_DB, ipAddress.getIpv4Address().getValue()
- .toString());
+ openRoadmNetNode1.getShelf(),TARGET_PCH_OUT_DB, ipAddress.getIpv4Address().getValue());
this.elements.add(element);
nodesList.add(nodeRef);
}
} else if (commonNetworkNode1.getNodeType().getName().equals("XPONDER")) {
if (!nodesList.contains(nodeRef)) {
Elements element = createElementsTransceiver(LATITUDE, LONGITUTE, nodeRef,
- openRoadmNetNode1.getShelf(),ipAddress.getIpv4Address().getValue().toString());
+ openRoadmNetNode1.getShelf(),ipAddress.getIpv4Address().getValue());
this.elements.add(element);
nodesList.add(nodeRef);
trxList.add(nodeRef);
Elements element = createElementsEdfa(LATITUDE, LONGITUTE, REGION, CITY,
ila.getGain().getValue(), ila.getTilt().getValue(),
ila.getOutVoaAtt().getValue(), "std_medium_gain",
- ipEdfa.getIpv4Address().getValue().toString());
+ ipEdfa.getIpv4Address().getValue());
this.elements.add(element);
return ipEdfa;
}
package org.opendaylight.transportpce.pce.gnpy;
import com.google.common.base.Function;
+//false positive in SpotBug -> cannot be used with FluentIterable...
import com.google.common.collect.FluentIterable;
import java.io.BufferedWriter;
Node1 node1 = node.augmentation(Node1.class);
if (node1 == null) {
LOG.error("getNodeType: no Node1 (type) Augmentation for node: [{}]. Node is ignored", node.getNodeId());
+ return false;
}
OpenroadmNodeType nodeType = node1.getNodeType();
for (int i = 0; i < this.omsAttributesSpan.getLinkConcatenation().size(); i++) {
//Length is expressed in meter and latency is expressed in ms according to OpenROADM MSA
tmp += this.omsAttributesSpan.getLinkConcatenation().get(i).getSRLGLength() / CELERITY;
- LOG.info("In PceLink: The latency of link {} == {}",link.getLinkId(),tmplatency);
+ LOG.info("In PceLink: The latency of link {} == {}",link.getLinkId(),tmp);
}
tmplatency = (long) Math.ceil(tmp);
} catch (NullPointerException e) {
LOG.info("initSrgTpList: adding SRG-PP tp '{}'", tp.getTpId().getValue());
this.availableSrgPp.put(tp.getTpId().getValue(), cntp1.getTpType());
} else {
- LOG.warn("initSrgTpList: SRG-PP tp = {} found is busy !!");
+ LOG.warn("initSrgTpList: SRG-PP tp = {} found is busy !!", tp.getTpId().getValue());
}
break;
default:
OpenroadmTpType srgType = null;
OpenroadmTpType cpType = this.availableSrgCp.get(tp);
if (cpType == null) {
- LOG.error("getRdmSrgClient: tp {} not existed in SRG CPterminationPoint list");
+ LOG.error("getRdmSrgClient: tp {} not existed in SRG CPterminationPoint list", tp);
return null;
}
switch (cpType) {
try {
notificationPublishService.putNotification(this.notification);
} catch (InterruptedException e) {
- LOG.info("notification offer rejected : ", e.getMessage());
+ LOG.info("notification offer rejected: ", e);
}
}
ServicePathInputBuilder servicePathInputBuilder = new ServicePathInputBuilder()
.setServiceName(serviceName)
.setOperation(ServicePathInput.Operation.Create)
- .setWaveNumber(new Long(pathDescription.getAToZDirection().getAToZWavelengthNumber()))
+ .setWaveNumber(Long.valueOf(pathDescription.getAToZDirection().getAToZWavelengthNumber()))
.setNodes(nodeLists.getList());
return new ServicePathInputData(servicePathInputBuilder.build(), nodeLists);
}
ServicePathInputBuilder servicePathInputBuilder = new ServicePathInputBuilder()
.setOperation(ServicePathInput.Operation.Create)
.setServiceName(serviceName)
- .setWaveNumber(new Long(pathDescription.getZToADirection().getZToAWavelengthNumber()))
+ .setWaveNumber(Long.valueOf(pathDescription.getZToADirection().getZToAWavelengthNumber()))
.setNodes(nodeLists.getList());
return new ServicePathInputData(servicePathInputBuilder.build(), nodeLists);
}
try {
notificationPublishService.putNotification(this.notification);
} catch (InterruptedException e) {
- LOG.info("notification offer rejected : ", e.getMessage());
+ LOG.info("notification offer rejected: ", e);
}
}
@Override
public ListenableFuture<ServiceImplementationRequestOutput>
serviceImplementation(ServiceImplementationRequestInput input) {
- LOG.info("Calling service impl request {} {}", input.getServiceName());
+ LOG.info("Calling service impl request {}", input.getServiceName());
return executor.submit(new Callable<ServiceImplementationRequestOutput>() {
@Override
@Override
public ListenableFuture<ServiceDeleteOutput> serviceDelete(ServiceDeleteInput input) {
String serviceName = input.getServiceName();
- LOG.info("Calling service delete request {} {}", input.getServiceName());
+ LOG.info("Calling service delete request {}", input.getServiceName());
return executor.submit(new Callable<ServiceDeleteOutput>() {
@Override
if (FAILED.equals(powerTurndownResult.getResult().getResult())) {
LOG.warn("Olmp power setup rollback for {} was not successful!", this.getId());
} else {
- LOG.info("Olm power setup rollback for {} was successful.");
+ LOG.info("Olm power setup rollback for {} was successful.", this.getId());
}
return null;
}
@Override
public ListenableFuture<RpcResult<ServiceDeleteOutput>> serviceDelete(ServiceDeleteInput input) {
String serviceName = input.getServiceName();
- LOG.info("Calling RPC service delete request {} {}", serviceName);
+ LOG.info("Calling RPC service delete request {}", serviceName);
ServiceDeleteOutput output = null;
try {
output = this.rendererServiceOperations.serviceDelete(input).get();
public ListenableFuture<RpcResult<ServiceImplementationRequestOutput>> serviceImplementationRequest(
ServiceImplementationRequestInput input) {
String serviceName = input.getServiceName();
- LOG.info("Calling RPC service impl request {} {}", serviceName);
+ LOG.info("Calling RPC service impl request {}", serviceName);
ServiceImplementationRequestOutput output = null;
try {
output = this.rendererServiceOperations.serviceImplementation(input).get();
LOG.info("putting notification : {}", notif);
notificationPublishService.putNotification(notif);
} catch (InterruptedException e) {
- LOG.info("notification offer rejected : ", e.getMessage());
+ LOG.info("notification offer rejected: ", e);
}
}
LOG.info("putting notification : {}", notif);
notificationPublishService.putNotification(notif);
} catch (InterruptedException e) {
- LOG.info("notification offer rejected : ", e.getMessage());
+ LOG.info("notification offer rejected: ", e);
}
}
String txPortName, String rxPortDeviceName, String rxPortName) {
ServiceAEnd serviceAEnd = new ServiceAEndBuilder().setClli(clli).setNodeId(new NodeIdType(nodeid)).setOpticType(
OpticTypes.Gray).setServiceFormat(
- ServiceFormat.Ethernet).setServiceRate(new Long(100))
+ ServiceFormat.Ethernet).setServiceRate(Long.valueOf(100))
.setTxDirection(
new TxDirectionBuilder()
.setPort(new PortBuilder().setPortDeviceName(txPortDeviceName).setPortName(txPortName)
String txPortName, String rxPortDeviceName, String rxPortName) {
ServiceZEnd serviceZEnd = new ServiceZEndBuilder().setClli(clli).setNodeId(new NodeIdType(nodeid)).setOpticType(
OpticTypes.Gray).setServiceFormat(
- ServiceFormat.Ethernet).setServiceRate(new Long(100))
+ ServiceFormat.Ethernet).setServiceRate(Long.valueOf(100))
.setTxDirection(
new TxDirectionBuilder()
.setPort(new PortBuilder().setPortDeviceName(txPortDeviceName).setPortName(txPortName)
} catch (NullPointerException e) {
LOG.error("one of input parameter is null ", e);
- OperationResult.failed("one of input parameter is null.");
+ return OperationResult.failed("one of input parameter is null.");
}
return OperationResult.ok("Validation successful.");
}