2 * Copyright © 2017 AT&T and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.transportpce.renderer.openroadminterface;
11 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
12 import org.opendaylight.controller.md.sal.binding.api.MountPointService;
13 import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.OchAttributes.ModulationFormat;
14 import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.RateIdentity;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
18 public class OpenRoadmXponderInterface extends OpenRoadmInterfaces {
20 private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmXponderInterface.class);
21 private final String serviceName;
23 public OpenRoadmXponderInterface(DataBroker db, MountPointService mps, String nodeId, String logicalConnPoint,
25 super(db, mps, nodeId, logicalConnPoint,serviceName);
26 this.serviceName = serviceName;
30 public boolean createLineInterfaces(Long waveNumber, Class<? extends RateIdentity> rate, ModulationFormat format) {
32 String supportOchInterface = new OpenRoadmOchInterface(db, mps, nodeId, logicalConnPoint,serviceName)
33 .createInterface(waveNumber, rate, format);
34 String supportingOtuInterface;
35 String supportingOduInterface;
37 if (supportOchInterface != null) {
38 supportingOtuInterface = new OpenRoadmOtu4Interface(db, mps, nodeId, logicalConnPoint,serviceName)
39 .createInterface(supportOchInterface);
41 LOG.error("Unable to create OCH interface on the transponder");
44 if (supportingOtuInterface != null) {
45 supportingOduInterface = new OpenRoadmOdu4Interface(db, mps, nodeId, logicalConnPoint,serviceName)
46 .createInterface(supportingOtuInterface);
48 LOG.error("Unable to create OTU interface on the transponder");
51 if (supportingOduInterface != null) {
54 LOG.error("Unable to create ODU interface on the transponder");
59 public boolean createClientInterfaces() {
61 if (new OpenRoadmEthIterface(db, mps, nodeId, logicalConnPoint,serviceName).createInterface() != null) {