To fix most of javadoc compilation warnings.
JIRA: TRNSPRTPCE-841
Change-Id: Ie072b77ccad2abb3a9eb9e0ff69e6af3dc0f432e
Signed-off-by: Gilles Thouenon <gilles.thouenon@orange.com>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * This is the entry-point of TransportPCE. This class listen to the NETCONF Topology to detect new Netconf Node
+ * connection to the controller. It triggers the creation of an abstracted node in the portmapping and its
+ * representation in openroadm topologies.
+ */
public class NetConfTopologyListener implements DataTreeChangeListener<Node> {
private static final Logger LOG = LoggerFactory.getLogger(NetConfTopologyListener.class);
private final Map<String, NodeRegistration> registrations;
private final PortMapping portMapping;
+ /**
+ * Instantiate the NetConfTopologyListener.
+ * @param networkModelService Service that eases data handling in topology datastores
+ * @param dataBroker Provides access to the conceptual data tree store in order to register data change listeners
+ * @param deviceTransactionManager Manages data transactions with the netconf devices
+ * @param portMapping Store the abstraction view of the netconf device
+ */
public NetConfTopologyListener(
final NetworkModelService networkModelService,
final DataBroker dataBroker,
return false;
}
+ /**
+ * Specific constructor dedicated to JUnit tests.
+ * @param networkModelService Service that eases data handling in topology datastores
+ * @param dataBroker Provides access to the conceptual data tree store in order to register data change listeners
+ * @param deviceTransactionManager Manages data transactions with the netconf devices
+ * @param portMapping Store the abstraction view of the netconf device
+ * @param registrations Map with all listeners registered for a netconf device
+ */
@VisibleForTesting
public NetConfTopologyListener(
final NetworkModelService networkModelService,
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * This class is the starting point of the networkmodel module. It starts the different objects and initialize the
+ * different topology layer instances.
+ */
@Component
public class NetworkModelProvider {
private FrequenciesService frequenciesService;
private PortMappingListener portMappingListener;
+ /**
+ * Instantiate the NetworkModelProvider.
+ * @param networkTransactionService Service that eases the transaction operations with data-stores
+ * @param dataBroker Provides access to the conceptual data tree store in order to register data change listeners
+ * @param networkModelService Service that eases data handling in topology datastores
+ * @param deviceTransactionManager Manages data transactions with the netconf devices
+ * @param portMapping Store the abstraction view of the netconf device
+ * @param notificationService Notification broker which allows to subscribe for notifications
+ * @param frequenciesService Object that ease WDM spectrum handling
+ */
@Activate
public NetworkModelProvider(@Reference NetworkTransactionService networkTransactionService,
@Reference final DataBroker dataBroker,
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Utility class that allows to register TransportPCE internal RPC to complement the different topologies.
+ */
@Component
public class NetworkUtilsImpl {
private final DataBroker dataBroker;
private final Registration rpcReg;
+ /**
+ * Instantiate the NetworkUtilsImpl object.
+ * @param dataBroker Provides access to the conceptual data tree store.
+ * @param rpcProvider Service that allows registering Remote Procedure Call (RPC) implementations.
+ */
@Activate
public NetworkUtilsImpl(@Reference DataBroker dataBroker, @Reference RpcProviderService rpcProvider) {
this.dataBroker = dataBroker;
LOG.info("NetworkUtilsImpl instanciated");
}
-
+ /**
+ * Unregister RPC used in this network module when closing the network model service.
+ */
@Deactivate
public void close() {
rpcReg.close();
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Utility class that manages the WDM ROADM-to-ROADM links in the openroadm-topology.
+ */
public class R2RLinkDiscovery {
private static final Logger LOG = LoggerFactory.getLogger(R2RLinkDiscovery.class);
private final NetworkTransactionService networkTransactionService;
private final DeviceTransactionManager deviceTransactionManager;
+ /**
+ * Instantiate the R2RLinkDiscovery object.
+ * @param dataBroker Provides access to the conceptual data tree store
+ * @param deviceTransactionManager Manages data transactions with the netconf devices
+ * @param networkTransactionService Service that eases the transaction operations with data-stores
+ */
public R2RLinkDiscovery(final DataBroker dataBroker, DeviceTransactionManager deviceTransactionManager,
NetworkTransactionService networkTransactionService) {
this.dataBroker = dataBroker;
this.networkTransactionService = networkTransactionService;
}
+ /**
+ * Depending on the org-openroadm-device version, get from the device relevant information concerning the node
+ * neighbors.
+ * @param nodeId Node name
+ * @param nodeVersion org-openroadm-device version
+ * @return True if the node has at least one neighbor. False otherwise.
+ */
public boolean readLLDP(NodeId nodeId, String nodeVersion) {
switch (nodeVersion) {
case OPENROADM_DEVICE_VERSION_1_2_1:
return success;
}
+ /**
+ * Get the kind of WDM line interface of the node (Bidirectional or Unidirectional).
+ * @param degreeCounter Number of the degree
+ * @param nodeId Node name
+ * @return Direction
+ */
public Direction getDegreeDirection(Integer degreeCounter, NodeId nodeId) {
DataObjectIdentifier<Nodes> nodesIID = DataObjectIdentifier.builder(Network.class)
.child(Nodes.class, new NodesKey(nodeId.getValue()))
return Direction.NotApplicable;
}
+ /**
+ * Create a ROADM-to-ROADM link when a ROADM node has a neighbor declared in its configuration.
+ * @param nodeId Node name
+ * @param interfaceName Name of the WDM line interface
+ * @param remoteSystemName Name of the neighbor node
+ * @param remoteInterfaceName Name of the WDM line interface on the neighbor node
+ * @return True if the links are correctly created, False otherwise
+ */
public boolean createR2RLink(NodeId nodeId, String interfaceName, String remoteSystemName,
String remoteInterfaceName) {
// Find which degree is associated with ethernet interface
return true;
}
+ /**
+ * Delete a ROADM-to-ROADM link when a ROADM node is removed from the openroadm topology.
+ * @param nodeId Node name
+ * @param interfaceName Name of the WDM line interface
+ * @param remoteSystemName Name of the neighbor node
+ * @param remoteInterfaceName Name of the WDM line interface on the neighbor node
+ * @return True if the links are correctly created, False otherwise
+ */
public boolean deleteR2RLink(NodeId nodeId, String interfaceName, String remoteSystemName,
String remoteInterfaceName) {
// Find which degree is associated with ethernet interface
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * This class manages the registration of listener for the different netconf device node versions.
+ */
public class NodeRegistration {
private static final Logger LOG = LoggerFactory.getLogger(NodeRegistration.class);
private final String nodeId;
private final PortMapping portMapping;
private final List<Registration> listeners;
+ /**
+ * Instantiate the NodeRegistration object.
+ * @param nodeId Node name
+ * @param nodeVersion OpenROADM org-openroadm-device model version
+ * @param notificationService Notification broker which allows to subscribe for notifications
+ * @param dataBroker Provides access to the conceptual data tree store. Used here to instantiate listeners
+ * @param portMapping Store the abstraction view of the netconf OpenROADM-device
+ */
public NodeRegistration(String nodeId, String nodeVersion, NotificationService notificationService,
DataBroker dataBroker, PortMapping portMapping) {
this.nodeId = nodeId;
listeners = new ArrayList<Registration>();
}
+ /**
+ * Depending on the org-openroadm-device version, select the correct implementations that register the different
+ * device listeners.
+ */
public void registerListeners() {
switch (this.nodeVersion) {
case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
}
}
+ /**
+ * Unregister the different device listeners when the network service module stop.
+ */
public void unregisterListeners() {
LOG.info("Unregistering notification listeners for node: {}", this.nodeId);
for (Registration listenerRegistration : listeners) {
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev240315.mapping.Mapping;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.XpdrNodeTypes;
+/**
+ * Node model for an OTN node in the org-openroadm-otn-network-topology layer.
+ */
public class OtnTopoNode {
private String nodeId;
private String clli;
private List<Mapping> xpdrClMappings;
private List<Mapping> xpdrNetMappings;
+ /**
+ * Instantiate the OtnTopoNode.
+ * @param nodeid Node name
+ * @param clli CLLI
+ * @param xpdrNb XPDR number
+ * @param xpdrNodeTypes Type of XPDR (TPDR, MxPDR, Switch...)
+ * @param xpdrNetConnectionMap Connection map for network port
+ * @param xpdrCliConnectionMap Connection map for client port
+ * @param xpdrNetMaps List of mappings for network ports
+ * @param xpdrClMaps List of mapping for client ports
+ */
public OtnTopoNode(String nodeid, String clli, int xpdrNb, XpdrNodeTypes xpdrNodeTypes,
Map<String, String> xpdrNetConnectionMap, Map<String, String> xpdrCliConnectionMap, List<Mapping> xpdrNetMaps,
List<Mapping> xpdrClMaps) {
this.xpdrClMappings = xpdrClMaps;
}
+ /**
+ * Get the Node Id.
+ * @return node ID
+ */
public String getNodeId() {
return nodeId;
}
+ /**
+ * Get the XPDR type.
+ * @return XpdrNodeTypes
+ */
public XpdrNodeTypes getNodeType() {
return nodeType;
}
+ /**
+ * Get the number of Network TP of the XPDR device.
+ * @return Number
+ */
public int getNbTpNetwork() {
return xpdrNetConnectionMap.size();
}
+ /**
+ * Get the number for client TP of the XPDR device.
+ * @return Number
+ */
public int getNbTpClient() {
return xpdrCliConnectionMap.size();
}
+ /**
+ * Get the number of XPDR declared in the OpenROADM XPDR device.
+ * @return Number
+ */
public int getXpdrNb() {
return xpdrNb;
}
+ /**
+ * Get the CLLI configured on the OpenROADM device.
+ * @return String
+ */
public String getClli() {
return clli;
}
+ /**
+ * Get the connection map of the network ports of the device.
+ * @return a connection map
+ */
public Map<String, String> getXpdrNetConnectionMap() {
return xpdrNetConnectionMap;
}
+ /**
+ * Get the connection map of the client ports of the device.
+ * @return a connection map
+ */
public Map<String, String> getXpdrCliConnectionMap() {
return xpdrCliConnectionMap;
}
+ /**
+ * Get the list of mappings for the client port of the device.
+ * @return list of mappings
+ */
public List<Mapping> getXpdrClMappings() {
return xpdrClMappings;
}
+ /**
+ * Get the list of mappings for the network port of the device.
+ * @return list of mappings
+ */
public List<Mapping> getXpdrNetMappings() {
return xpdrNetMappings;
}
private final List<Link> links;
private final List<TerminationPoint> tps;
+ /**
+ * Instantiate the TopologyShard object.
+ * @param nodes List of Nodes to store
+ * @param links List of Links to store
+ */
public TopologyShard(List<Node> nodes, List<Link> links) {
this.nodes = nodes;
this.links = links;
this.tps = null;
}
+ /**
+ * Instantiate the TopologyShard object.
+ * @param nodes List of Nodes to store
+ * @param links List of Links to store
+ * @param tps List of Termination Points to store
+ */
public TopologyShard(List<Node> nodes, List<Link> links, List<TerminationPoint> tps) {
this.nodes = nodes;
this.links = links;
this.tps = tps;
}
+ /**
+ * Get the list of Nodes.
+ * @return List of Nodes
+ */
public List<Node> getNodes() {
return nodes;
}
+ /**
+ * Get the list of Links.
+ * @return List of Links
+ */
public List<Link> getLinks() {
return links;
}
+ /**
+ * Get the list of Termination Points.
+ * @return List of TerminationPoint
+ */
public List<TerminationPoint> getTps() {
return tps;
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Implementation of the org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev161014.AlarmNotification notification.
+ * This implementation is dedicated to yang model 1.2.1 revision.
+ */
public class AlarmNotificationListener {
private static final Logger LOG = LoggerFactory.getLogger(AlarmNotificationListener.class);
private static final String PIPE = "|";
private final DataBroker dataBroker;
+ /**
+ * Create instance of the listener.
+ * @param dataBroker Provides access to the conceptual data tree store used by the listener implementation.
+ */
public AlarmNotificationListener(DataBroker dataBroker) {
this.dataBroker = dataBroker;
}
+ /**
+ * Get instances of a CompositeListener that could be used to unregister listeners.
+ * @return a Composite listener containing listener implementations that will receive notifications
+ */
public CompositeListener getCompositeListener() {
return new CompositeListener(Set.of(
new CompositeListener.Component<>(AlarmNotification.class, this::onAlarmNotification)));
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Implementation of the org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev181019.AlarmNotification notification.
+ * This implementation is dedicated to yang model 2.2.1 revision.
+ */
public class AlarmNotificationListener221 {
private static final Logger LOG = LoggerFactory.getLogger(AlarmNotificationListener221.class);
private static final String PIPE = "|";
private final DataBroker dataBroker;
+ /**
+ * Create instance of the listener.
+ * @param dataBroker Provides access to the conceptual data tree store used by the listener implementation.
+ */
public AlarmNotificationListener221(DataBroker dataBroker) {
this.dataBroker = dataBroker;
}
+ /**
+ * Get instances of a CompositeListener that could be used to unregister listeners.
+ * @return a Composite listener containing listener implementations that will receive notifications
+ */
public CompositeListener getCompositeListener() {
return new CompositeListener(Set.of(
new CompositeListener.Component<>(AlarmNotification.class, this::onAlarmNotification)));
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Implementation of the org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.AlarmNotification notification.
+ * This implementation is dedicated to yang model 7.1 revision.
+ */
public class AlarmNotificationListener710 {
private static final Logger LOG = LoggerFactory.getLogger(AlarmNotificationListener710.class);
private static final String PIPE = "|";
private final DataBroker dataBroker;
+ /**
+ * Create instance of the listener.
+ * @param dataBroker Provides access to the conceptual data tree store used by the listener implementation.
+ */
public AlarmNotificationListener710(DataBroker dataBroker) {
this.dataBroker = dataBroker;
}
+ /**
+ * Get instances of a CompositeListener that could be used to unregister listeners.
+ * @return a Composite listener containing listener implementations that will receive notifications
+ */
public CompositeListener getCompositeListener() {
return new CompositeListener(Set.of(
new CompositeListener.Component<>(AlarmNotification.class, this::onAlarmNotification)));
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Implementation of the org-openroadm-de-operations notification.
+ * This implementation is dedicated to yang model 1.2.1 revision.
+ */
public class DeOperationsListener {
+ /**
+ * Default constructor.
+ */
+ public DeOperationsListener() {
+ }
+
private static final Logger LOG = LoggerFactory.getLogger(DeOperationsListener.class);
+ /**
+ * Get instances of a CompositeListener that could be used to unregister listeners.
+ * @return a Composite listener containing listener implementations that will receive notifications
+ */
public CompositeListener getCompositeListener() {
return new CompositeListener(Set.of(
new CompositeListener.Component<>(RestartNotification.class, this::onRestartNotification)));
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Implementation of the org-openroadm-de-operations notification.
+ * This implementation is dedicated to yang model 2.2.1 revision.
+ */
public class DeOperationsListener221 {
+ /**
+ * Default constructor.
+ */
+ public DeOperationsListener221() {
+ }
+
private static final Logger LOG = LoggerFactory.getLogger(DeOperationsListener221.class);
+ /**
+ * Get instances of a CompositeListener that could be used to unregister listeners.
+ * @return a Composite listener containing listener implementations that will receive notifications
+ */
public CompositeListener getCompositeListener() {
return new CompositeListener(Set.of(
new CompositeListener.Component<>(RestartNotification.class, this::onRestartNotification)));
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Implementation of the org-openroadm-de-operations notification.
+ * This implementation is dedicated to yang model 7.1 revision.
+ */
public class DeOperationsListener710 {
+ /**
+ * Default constructor.
+ */
+ public DeOperationsListener710() {
+ }
+
private static final Logger LOG = LoggerFactory.getLogger(DeOperationsListener710.class);
+ /**
+ * Get instances of a CompositeListener that could be used to unregister listeners.
+ * @return a Composite listener containing listener implementations that will receive notifications
+ */
public CompositeListener getCompositeListener() {
return new CompositeListener(Set.of(
new CompositeListener.Component<>(RestartNotification.class, this::onRestartNotification)));
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Implementation of the org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.ChangeNotification
+ * notification.
+ * This implementation is dedicated to yang model 1.2.1 revision.
+ */
public class DeviceListener121 {
private static final Logger LOG = LoggerFactory.getLogger(DeviceListener121.class);
private final String nodeId;
private final PortMapping portMapping;
+ /**
+ * Create instance of the device listener.
+ *
+ * @param nodeId Node name
+ * @param portMapping Node abstractions stored
+ */
public DeviceListener121(String nodeId, PortMapping portMapping) {
super();
this.nodeId = nodeId;
this.portMapping = portMapping;
}
+ /**
+ * Get instances of a CompositeListener that could be used to unregister listeners.
+ * @return a Composite listener containing listener implementations that will receive notifications
+ */
public CompositeListener getCompositeListener() {
return new CompositeListener(Set.of(
new CompositeListener.Component<>(ChangeNotification.class, this::onChangeNotification),
/**
* Callback for change-notification.
- *
* @param notification ChangeNotification object
*/
-
void onChangeNotification(ChangeNotification notification) {
if (notification.getEdit() == null) {
LOG.warn("unable to handle {} notificatin received - list of edit is null", ChangeNotification.QNAME);
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Implementation of the org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.ChangeNotification
+ * notification.
+ * This implementation is dedicated to yang model 2.2.1 revision.
+ */
public class DeviceListener221 {
private static final Logger LOG = LoggerFactory.getLogger(DeviceListener221.class);
private final String nodeId;
private final PortMapping portMapping;
+ /**
+ * Create instance of the device listener.
+ *
+ * @param nodeId Node name
+ * @param portMapping Node abstractions stored
+ */
public DeviceListener221(String nodeId, PortMapping portMapping) {
super();
this.nodeId = nodeId;
this.portMapping = portMapping;
}
+ /**
+ * Get instances of a CompositeListener that could be used to unregister listeners.
+ * @return a Composite listener containing listener implementations that will receive notifications
+ */
public CompositeListener getCompositeListener() {
return new CompositeListener(Set.of(
new CompositeListener.Component<>(ChangeNotification.class, this::onChangeNotification),
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Implementation of the org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.ChangeNotification
+ * notification.
+ * This implementation is dedicated to yang model 7.1 revision.
+ */
public class DeviceListener710 {
private static final Logger LOG = LoggerFactory.getLogger(DeviceListener710.class);
private final String nodeId;
private final PortMapping portMapping;
+ /**
+ * Create instance of the device listener.
+ *
+ * @param nodeId Node name
+ * @param portMapping Node abstractions stored
+ */
public DeviceListener710(String nodeId, PortMapping portMapping) {
super();
this.nodeId = nodeId;
this.portMapping = portMapping;
}
+ /**
+ * Get instances of a CompositeListener that could be used to unregister listeners.
+ * @return a Composite listener containing listener implementations that will receive notifications
+ */
public CompositeListener getCompositeListener() {
return new CompositeListener(Set.of(
new CompositeListener.Component<>(ChangeNotification.class, this::onChangeNotification),
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Implementation of the org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.LldpNbrInfoChange
+ * notification.
+ * This implementation is dedicated to yang model 1.2.1 revision.
+ */
public class LldpListener implements Listener<LldpNbrInfoChange> {
private static final Logger LOG = LoggerFactory.getLogger(LldpListener.class);
private final NodeId nodeId;
+ /**
+ * Create instance of the device listener.
+ *
+ * @param nodeId Node name
+ */
public LldpListener(final String nodeId) {
this.nodeId = new NodeId(nodeId);
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Implementation of the org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev181019.LldpNbrInfoChange
+ * notification.
+ * This implementation is dedicated to yang model 2.2.1 revision.
+ */
public class LldpListener221 implements Listener<LldpNbrInfoChange> {
private static final Logger LOG = LoggerFactory.getLogger(LldpListener221.class);
private final R2RLinkDiscovery linkDiscovery;
private final NodeId nodeId;
+ /**
+ * Create instance of the device listener.
+ *
+ * @param linkDiscovery Object representing the ROADM-to-ROADM WDM link
+ * @param nodeId Node name
+ */
public LldpListener221(final R2RLinkDiscovery linkDiscovery, final String nodeId) {
this.linkDiscovery = linkDiscovery;
this.nodeId = new NodeId(nodeId);
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Implementation of the org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev200529.LldpNbrInfoChange
+ * notification.
+ * This implementation is dedicated to yang model 7.1 revision.
+ */
public class LldpListener710 implements Listener<LldpNbrInfoChange> {
private static final Logger LOG = LoggerFactory.getLogger(LldpListener710.class);
private final R2RLinkDiscovery linkDiscovery;
private final NodeId nodeId;
+ /**
+ * Create instance of the device listener.
+ *
+ * @param linkDiscovery Object representing the ROADM-to-ROADM WDM link
+ * @param nodeId Node name
+ */
public LldpListener710(final R2RLinkDiscovery linkDiscovery, final String nodeId) {
this.linkDiscovery = linkDiscovery;
this.nodeId = new NodeId(nodeId);
import org.opendaylight.yangtools.binding.DataObjectStep;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+/**
+ * Implementation that listens to any data change on
+ * org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev240315.mapping.Mapping object.
+ */
public class PortMappingListener implements DataTreeChangeListener<Mapping> {
private final NetworkModelService networkModelService;
+ /**
+ * Instantiate the PortMappingListener.
+ * @param networkModelService Service that eases data handling in topology data-stores.
+ */
public PortMappingListener(NetworkModelService networkModelService) {
this.networkModelService = networkModelService;
}
}
}
+ /**
+ * Retrieve from the data change the node id that emits the device notification.
+ * @param dataTreeIdentifier Instance Identifiers of the mapping change.
+ * @return the node ID, parent of the data tree change.
+ */
protected String getNodeIdFromMappingDataTreeIdentifier(DataTreeIdentifier<Mapping> dataTreeIdentifier) {
LinkedList<DataObjectStep<?>> path = new LinkedList<>();
dataTreeIdentifier.path().getPathArguments().forEach(p -> path.add(p));
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Implementation that listens to any data change on
+ * org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.servicehandler.rev201125.ServiceRpcResultSh object.
+ */
public class ServiceHandlerListener {
private static final Logger LOG = LoggerFactory.getLogger(ServiceHandlerListener.class);
private final FrequenciesService service;
+ /**
+ * Instantiate the ServiceHandlerListener.
+ * @param service FrequenciesService that eases WDM spectrum handling.
+ */
public ServiceHandlerListener(FrequenciesService service) {
LOG.info("Init service handler listener for network");
this.service = service;
}
+ /**
+ * Get instances of a CompositeListener that could be used to unregister listeners.
+ * @return a Composite listener containing listener implementations that will receive notifications
+ */
public CompositeListener getCompositeListener() {
return new CompositeListener(Set.of(
new CompositeListener.Component<>(ServiceRpcResultSh.class, this::onServiceRpcResultSh)));
}
+ /**
+ * Callback on a notification reception.
+ * @param notification ServiceRpcResultSh object
+ */
public void onServiceRpcResultSh(ServiceRpcResultSh notification) {
if (notification.getStatus() != RpcStatusEx.Successful) {
LOG.info("RpcStatusEx of notification not equals successful. Nothing to do for notification {}",
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Implementation of the org.opendaylight.yang.gen.v1.http.org.openroadm.tca.rev161014.TcaNotification
+ * notification.
+ * This implementation is dedicated to yang model 1.2.1 revision.
+ */
public class TcaListener {
private static final Logger LOG = LoggerFactory.getLogger(TcaListener.class);
+ /**
+ * Get instances of a CompositeListener that could be used to unregister listeners.
+ * @return a Composite listener containing listener implementations that will receive notifications
+ */
public CompositeListener getCompositeListener() {
return new CompositeListener(Set.of(
new CompositeListener.Component<>(TcaNotification.class, this::onTcaNotification)));
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class TcaListener221 {
+/**
+ * Implementation of the org.opendaylight.yang.gen.v1.http.org.openroadm.tca.rev181019.TcaNotification
+ * notification.
+ * This implementation is dedicated to yang model 2.2.1 revision.
+ */
+public final class TcaListener221 {
private static final Logger LOG = LoggerFactory.getLogger(TcaListener221.class);
+ /**
+ * Get instances of a CompositeListener that could be used to unregister listeners.
+ * @return a Composite listener containing listener implementations that will receive notifications
+ */
public CompositeListener getCompositeListener() {
return new CompositeListener(Set.of(
new CompositeListener.Component<>(TcaNotification.class, this::onTcaNotification)));
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class TcaListener710 {
+/**
+ * Implementation of the org.opendaylight.yang.gen.v1.http.org.openroadm.tca.rev200327.TcaNotification
+ * notification.
+ * This implementation is dedicated to yang model 7.1 revision.
+ */
+public final class TcaListener710 {
private static final Logger LOG = LoggerFactory.getLogger(TcaListener710.class);
+ /**
+ * Get instances of a CompositeListener that could be used to unregister listeners.
+ * @return a Composite listener containing listener implementations that will receive notifications
+ */
public CompositeListener getCompositeListener() {
return new CompositeListener(Set.of(
new CompositeListener.Component<>(TcaNotification.class, this::onTcaNotification)));
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.AToZDirection;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.ZToADirection;
+/**
+ * Allows WDM frequency spectrum handling.
+ */
public interface FrequenciesService {
/**
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Class that implements the WDM frequency spectrum handling.
+ */
@Component
public class FrequenciesServiceImpl implements FrequenciesService {
private final DataBroker dataBroker;
private final AvailFreqMapsKey availFreqMapKey = new AvailFreqMapsKey(GridConstant.C_BAND);
+ /**
+ * Create instance of the FrequenciesService.
+ *
+ * @param dataBroker Provides access to the conceptual data tree store used by the implementation.
+ */
@Activate
public FrequenciesServiceImpl(@Reference DataBroker dataBroker) {
this.dataBroker = dataBroker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Implementation of the NetworkModelService to ease the data manipulation on OpenROADM topology models.
+ */
@Component(immediate = true)
public class NetworkModelServiceImpl implements NetworkModelService {
private Map<TopologyChangesKey, TopologyChanges> topologyChanges;
private TopologyUpdateResult notification = null;
+ /**
+ * Instantiate the NetworkModelServiceImpl.
+ * @param dataBroker Provides access to the conceptual data tree store. Used here to instantiate R2RLinkDiscovery
+ * @param deviceTransactionManager Manages data transactions with the netconf devices
+ * @param networkTransactionService Service that eases the transaction operations with data-stores
+ * @param portMapping Store the abstraction view of the netconf OpenROADM-device
+ * @param ocPortMapping Store the abstraction view of the netconf OpenConfig device
+ * @param notificationPublishService Notification broker which allows to submit a notifications
+ */
@Activate
public NetworkModelServiceImpl(@Reference DataBroker dataBroker,
@Reference DeviceTransactionManager deviceTransactionManager,
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Utility class to implement the org-openroadm-clli-network topology layer.
+ */
public final class ClliNetwork {
private static final Logger LOG = LoggerFactory.getLogger(ClliNetwork.class);
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.LinkId;
+/**
+ * Utility class that eases the generation of different ID and their handling.
+ */
public final class LinkIdUtil {
private static final String NETWORK = "-NETWORK";
private static final String OTN_LINK_ID_FORMAT = "%5$s-%1$s-%2$sto%3$s-%4$s";
private LinkIdUtil() {
- // utility class
}
/**
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
+/**
+ * Utility class to implement the org-openroadm-network topology layer.
+ */
public final class OpenRoadmNetwork {
private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmNetwork.class);
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Utility class to implement the org-openroadm-otn-network-topology layer.
+ */
public final class OpenRoadmOtnTopology {
private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmOtnTopology.class);
private OpenRoadmOtnTopology() {
}
+ /**
+ * Create Nodes and Links in the OTN topology depending on the type of OTN device.
+ * @param mappingNode Abstracted view of the node retrieved from the portmapping data-store
+ * @return Subset of the topology
+ */
public static TopologyShard createTopologyShard(Nodes mappingNode) {
List<Node> nodes = new ArrayList<>();
List<Link> links = new ArrayList<>();
return new TopologyShard(nodes, links);
}
+ /**
+ * Create OTN links and initialize their bandwidth parameters during the creation of a service.
+ * @param nodeA Node name at one link end
+ * @param tpA Terminatin point id on nodeA
+ * @param nodeZ Node name at the other link end
+ * @param tpZ Termination point id on nodeZ
+ * @param linkType To distinguish the ODU link creation from the OTU link creation
+ * @return topology with otn links updated
+ */
public static TopologyShard createOtnLinks(String nodeA, String tpA, String nodeZ, String tpZ,
OtnLinkType linkType) {
: null);
}
+ /**
+ * Create OTN links and initialize their bandwidth parameters during the creation of a service.
+ * @param notifLink List of links to create
+ * @param linkType To distinguish the ODU link creation from the OTU link creation
+ * @return topology with otn links updated
+ */
public static TopologyShard createOtnLinks(
org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.renderer.rpc.result.sp
.Link notifLink,
linkType));
}
+ /**
+ * Create OTN links and initialize their bandwidth parameters during the creation of a service.
+ * @param notifLink List of links to create
+ * @param supportedOtu4links List of OTU links to update when they exist
+ * @param supportedTPs List of termination points to update
+ * @param linkType To distinguish the ODU link creation from the OTU link creation
+ * @return topology with otn links updated
+ */
public static TopologyShard createOtnLinks(
org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.renderer.rpc.result.sp
.Link notifLink,
}
}
+ /**
+ * Update the available and used bandwidth parameters of OTN links during creation of a service.
+ * @param suppOtuLinks List of OTU links to create
+ * @param oldTps List of termination points to update
+ * @param linkType To distinguish the ODU link creation from the OTU link creation
+ * @return topology with otn links updated
+ */
public static TopologyShard createOtnLinks(List<Link> suppOtuLinks, List<TerminationPoint> oldTps,
OtnLinkType linkType) {
: new TopologyShard(null, null, null);
}
+ /**
+ * Update the available and used bandwidth parameters of an OTN link during creation and deletion of a service.
+ * @param suppOduLinks List of ODU links to update
+ * @param oldTps List of ODU termination points to update
+ * @param serviceRate Rate of the service
+ * @param tribPortNb Trib port number
+ * @param minTribSlotNb Min tributary slot number
+ * @param maxTribSlotNb Max tributary slot number
+ * @param isDeletion Set when this is a deletion action
+ * @return topology with otn links and TPs updated
+ */
public static TopologyShard updateOtnLinks(List<Link> suppOduLinks, List<TerminationPoint> oldTps,
Uint32 serviceRate, Short tribPortNb, Short minTribSlotNb, Short maxTribSlotNb, boolean isDeletion) {
}
}
+ /**
+ * Update the available and used bandwidth parameters of an OTN link during creation and deletion of a service.
+ * @param suppOtuLinks List of OTU links to update
+ * @param isDeletion Set when this is a deletion action
+ * @return topology with otn links updated
+ */
public static TopologyShard updateOtnLinks(List<Link> suppOtuLinks, boolean isDeletion) {
List<Link> links = new ArrayList<>();
}
}
+ /**
+ * Update the available and used bandwidth parameters of OTN links during deletion of a service.
+ * @param suppOtuLinks List of OTU links to update
+ * @param oldTps List of termination points to update
+ * @param linkType To distinguish the ODU link deletion from the OTU link deletion
+ * @return topology with otn links updated
+ */
public static TopologyShard deleteOtnLinks(List<Link> suppOtuLinks, List<TerminationPoint> oldTps,
OtnLinkType linkType) {
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Utility class to implement the org-openroadm-network-topology layer.
+ */
public final class OpenRoadmTopology {
private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmTopology.class);
private OpenRoadmTopology() {
}
+ /**
+ * Create Nodes and Links in the openroadm topology depending on the type of device.
+ * @param mappingNode Abstracted view of the node retrieved from the portmapping data-store
+ * @return Subset of the topology
+ */
public static TopologyShard createTopologyShard(Nodes mappingNode) {
return createTopologyShard(mappingNode, true);
}
+ /**
+ * Create a Nodes and Links in the openroadm topology depending on the type of device.
+ * @param mappingNode Abstracted view of the node retrieved from the portmapping data-store
+ * @param firstMount Allow to distinguish if this is a new node creation or a netconf session reinitialization
+ * @return Subset of the topology
+ */
public static TopologyShard createTopologyShard(Nodes mappingNode, boolean firstMount) {
switch (mappingNode.getNodeInfo().getNodeType()) {
case Rdm :
}
}
+ /**
+ * Create the Node and Link elements of the topology when the node is of ROADM type.
+ * @param mappingNode Abstracted view of the node retrieved from the portmapping data-store
+ * @param firstMount Allow to distinguish if this is a new node creation or a netconf session reinitialization
+ * @return topology with new Node and Links
+ */
public static TopologyShard createRdmTopologyShard(Nodes mappingNode, boolean firstMount) {
LOG.info("creating rdm node in openroadmtopology for node {}",
mappingNode.getNodeId());
return new TopologyShard(nodes, links);
}
+ /**
+ * Create the Node and Link elements of the topology when the node is of XPDR type.
+ * @param mappingNode Abstracted view of the node retrieved from the portmapping data-store
+ * @return topology with new Node and Links
+ */
public static TopologyShard createXpdrTopologyShard(Nodes mappingNode) {
List<Node> nodes = new ArrayList<>();
List<Mapping> networkMappings =
return links;
}
- // This method returns the linkBuilder object for given source and destination
+ /**
+ * Update the status of a link in the openroadm topology when we delete a service.
+ * @param srcNode Node name at one link end
+ * @param dstNode Node name at the other link end
+ * @param srcTp Terminatin point id on srcNode
+ * @param destTp Terminatin point id on dstNode
+ * @param networkTransactionService Service that eases the transaction operations with data-stores
+ * @return True if ok, False otherwise
+ */
public static boolean deleteLink(String srcNode, String dstNode, String srcTp, String destTp,
NetworkTransactionService networkTransactionService) {
LOG.info("deleting link for {}-{}", srcNode, dstNode);
}
}
- // This method returns the linkBuilder object for given source and destination
+ /**
+ * Update the status of a link in the openroadm topology when we delete a service.
+ * @param linkId Id of the link to update
+ * @param networkTransactionService Service that eases the transaction operations with data-stores
+ * @return True if ok, False otherwise
+ */
public static boolean deleteLinkLinkId(LinkId linkId , NetworkTransactionService networkTransactionService) {
LOG.info("deleting link for LinkId: {}", linkId.getValue());
try {
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Utility class to ease update of items in topology data-stores.
+ */
public final class TopologyUtils {
private static final Logger LOG = LoggerFactory.getLogger(TopologyUtils.class);
private TopologyUtils() {
}
- // This method returns the linkBuilder object for given source and destination
+ /**
+ * Create a {@link LinkBuilder} object for a given source and destination.
+ * @param srcNode source node id
+ * @param dstNode destination node id
+ * @param srcTp source termination point
+ * @param destTp destination termination point
+ * @param otnPrefix OTN link type prefix
+ * @return {@link LinkBuilder}
+ */
public static LinkBuilder createLink(String srcNode, String dstNode, String srcTp, String destTp,
String otnPrefix) {
return lnkBldr;
}
- // This method returns the linkBuilder object for given source and destination
+ /**
+ * Delete a link specified by a given source and destination.
+ * @param srcNode source node id string
+ * @param dstNode destination node id
+ * @param srcTp source termination point
+ * @param destTp destination termination point
+ * @param networkTransactionService Service that eases the transaction operations with data-stores
+ * @return True if OK, False otherwise.
+ */
public static boolean deleteLink(String srcNode, String dstNode, String srcTp, String destTp,
NetworkTransactionService networkTransactionService) {
LOG.info("deleting link for {}-{}", srcNode, dstNode);
}
}
- // This method returns the linkBuilder object for given source and destination
+ /**
+ * Delete a link specified by its linkId.
+ * @param linkId The link identifier
+ * @param networkTransactionService Service that eases the transaction operations with data-stores
+ * @return True if OK, False otherwise.
+ */
public static boolean deleteLinkLinkId(LinkId linkId , NetworkTransactionService networkTransactionService) {
LOG.info("deleting link for LinkId: {}", linkId.getValue());
try {
}
}
+ /**
+ * Set the {@link AdminStates} according to string representation.
+ * @param adminState value of the AdminStates
+ * @return {@link AdminStates}
+ */
public static AdminStates setNetworkAdminState(String adminState) {
if (adminState == null) {
return null;
}
}
+ /**
+ * Set the {@link State} according to string representation.
+ * @param operState Value of the operational state
+ * @return {@link State}
+ */
public static State setNetworkOperState(String operState) {
if (operState == null) {
return null;
}
}
+ /**
+ * Update topology components.
+ * @param abstractNodeid Node name
+ * @param mapping mapping
+ * @param nodes Map of topology nodes
+ * @param links Map of topology links
+ * @return Subset of the topology
+ */
public static TopologyShard updateTopologyShard(String abstractNodeid, Mapping mapping, Map<NodeKey, Node> nodes,
Map<LinkKey, Link> links) {
// update termination-point corresponding to the mapping
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Utility class that initializes the different topology layers.
+ */
public class TpceNetwork {
private static final Logger LOG = LoggerFactory.getLogger(TpceNetwork.class);
private NetworkTransactionService networkTransactionService;
+ /**
+ * Instantiate the TpceNetwork object.
+ * @param networkTransactionService Service that eases the transaction operations with data-stores
+ */
public TpceNetwork(NetworkTransactionService networkTransactionService) {
this.networkTransactionService = networkTransactionService;
}