public class OpenRoadmInterface121 {
- private static final String MAPPING_MSG_ERROR =
- "Unable to get mapping from PortMapping for node % and logical connection port %s";
private final PortMapping portMapping;
private final OpenRoadmInterfaces openRoadmInterfaces;
private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmInterface121.class);
throws OpenRoadmInterfaceException {
Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
- throw new OpenRoadmInterfaceException(String.format(MAPPING_MSG_ERROR, nodeId, logicalConnPoint));
+ throw new OpenRoadmInterfaceException(
+ OpenRoadmInterfaceException.mapping_msg_err(nodeId, logicalConnPoint));
}
InterfaceBuilder ethInterfaceBldr =
createGenericInterfaceBuilder(portMap, EthernetCsmacd.VALUE, logicalConnPoint + "-ETHERNET")
throws OpenRoadmInterfaceException {
Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
- throw new OpenRoadmInterfaceException(String.format(MAPPING_MSG_ERROR, nodeId, logicalConnPoint));
+ throw new OpenRoadmInterfaceException(
+ OpenRoadmInterfaceException.mapping_msg_err(nodeId, logicalConnPoint));
}
// Create generic interface
InterfaceBuilder otuInterfaceBldr =
createGenericInterfaceBuilder(portMap, OtnOtu.VALUE, logicalConnPoint + "-OTU")
.setSupportingInterface(supportOchInterface)
.addAugmentation(
- // TODO look at imports of different versions of class
new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1Builder()
.setOtu(
// OTU interface specific data
throws OpenRoadmInterfaceException {
Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
- throw new OpenRoadmInterfaceException(String.format(MAPPING_MSG_ERROR, nodeId, logicalConnPoint));
+ throw new OpenRoadmInterfaceException(
+ OpenRoadmInterfaceException.mapping_msg_err(nodeId, logicalConnPoint));
}
InterfaceBuilder oduInterfaceBldr =
createGenericInterfaceBuilder(portMap, OtnOdu.VALUE, logicalConnPoint + "-ODU");
}
oduInterfaceBldr.addAugmentation(
// Create Interface1 type object required for adding as augmentation
- // TODO look at imports of different versions of class
new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.Interface1Builder()
.setOdu(
// ODU interface specific data
throws OpenRoadmInterfaceException {
Mapping portMap = portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
- throw new OpenRoadmInterfaceException(String.format(
- "Unable to get mapping from PortMapping for node %s and logical connection port %s",
- nodeId, logicalConnPoint));
+ throw new OpenRoadmInterfaceException(
+ OpenRoadmInterfaceException.mapping_msg_err(nodeId, logicalConnPoint));
}
// Create generic interface
InterfaceBuilder ochInterfaceBldr =
}
ochInterfaceBldr.addAugmentation(
// Create Interface1 type object required for adding as augmentation
- // TODO look at imports of different versions of class
new org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.Interface1Builder()
.setOch(
// OCH interface specific data
SpectrumInformation spectrumInformation) throws OpenRoadmInterfaceException {
Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
- throw new OpenRoadmInterfaceException(String.format(
- "Unable to get mapping from PortMapping for node %s and logical connection port %s",
- nodeId, logicalConnPoint));
+ throw new OpenRoadmInterfaceException(
+ OpenRoadmInterfaceException.mapping_msg_err(nodeId, logicalConnPoint));
}
ModulationFormat modulationFormat =
OchAttributes.ModulationFormat.forName(spectrumInformation.getModulationFormat());
spectrumInformation.getIdentifierFromParams(logicalConnPoint))
.addAugmentation(
// Create Interface1 type object required for adding as augmentation
- // TODO look at imports of different versions of class
new org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014
.Interface1Builder()
.setOch(