import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.Mapping;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.PowerDBm;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceKey;
import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.OTU4;
import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.OtuAttributes;
import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.otu.container.OtuBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.Mapping;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class OpenRoadmInterfaceFactory {
private final PortMapping portMapping;
private final OpenRoadmInterfaces openRoadmInterfaces;
+ private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmInterfaceFactory.class);
public OpenRoadmInterfaceFactory(PortMapping portMapping, OpenRoadmInterfaces openRoadmInterfaces) {
this.portMapping = portMapping;
* This methods creates an OCH interface on the given termination point on
* Roadm.
*
- * @param waveNumber
- * wavelength number of the OCH interface.
+ * @param nodeId node ID
+ * @param logicalConnPoint logical Connection Point
+ * @param waveNumber wavelength number of the OCH interface
*
* @return Name of the interface if successful, otherwise return null.
+ * @throws OpenRoadmInterfaceException OpenRoadmInterfaceException
*/
public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber)
/**
* This methods creates an ODU interface on the given termination point.
*
+ * @param nodeId node ID
+ * @param logicalConnPoint logical Connection Point
+ * @param supportingOtuInterface supporting OTU Interface
*
* @return Name of the interface if successful, otherwise return null.
+ * @throws OpenRoadmInterfaceException OpenRoadmInterfaceException
*/
public String createOpenRoadmOdu4Interface(String nodeId, String logicalConnPoint, String supportingOtuInterface)
/**
* This methods creates an OTU interface on the given termination point.
*
+ * @param nodeId node ID
+ * @param logicalConnPoint logical Connection Point
+ * @param supportOchInterface support OCH Interface
*
* @return Name of the interface if successful, otherwise return null.
* @throws OpenRoadmInterfaceException OpenRoadmInterfaceException
if (mapping.getSupportingOts() != null) {
omsInterfaceBldr.setSupportingInterface(mapping.getSupportingOts());
} else {
- throw new OpenRoadmInterfaceException(String.format("Unable to get ots interface from mapping % - %",
- nodeId, mapping.getLogicalConnectionPoint()));
+ LOG.error("Unable to get ots interface from mapping {} - {}", nodeId,
+ mapping.getLogicalConnectionPoint());
+ return null;
}
this.openRoadmInterfaces.postInterface(nodeId, omsInterfaceBldr);
this.portMapping.updateMapping(nodeId, mapping);