<build>
<plugins>
<plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>3.0.1</version>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Include-Resource>{maven-resources},target/classes/LICENSE,META-INF/git.properties=-target/classes/META-INF/git.properties</Include-Resource>
- <_exportcontents>
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.transportpce.stubrenderer.rev170403.service.implementation.request.input,
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.rev170120.service.implementation.request.input,
- org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.internal.link,
- org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.internal.links,*
- </_exportcontents>
- </instructions>
- </configuration>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>3.0.1</version>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Include-Resource>{maven-resources},target/classes/LICENSE,META-INF/git.properties=-target/classes/META-INF/git.properties</Include-Resource>
+ <_exportcontents>
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.transportpce.stubrenderer.rev170403.service.implementation.request.input,
+ org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.rev170120.service.implementation.request.input,
+ org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.internal.link,
+ org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.internal.links,*
+ </_exportcontents>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <sourcepath>*/target/generated-sources/mdsal-binding/*</sourcepath>
+ <excludePackageNames>*</excludePackageNames>
+ </configuration>
</plugin>
</plugins>
</build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <sourcepath>*/target/generated-sources/mdsal-binding/*</sourcepath>
+ <excludePackageNames>*</excludePackageNames>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
</project>
}
rpc service-path{
input{
+ leaf service-name{
+ type string;
+ }
leaf wave-number{
type uint32;
}
+ leaf modulation-format {
+ type string;
+ }
leaf operation{
type enumeration{
enum "create"{
/**
* Define the Karaf command method signatures and the Javadoc for each.
* Below method is just an example
+ *
+ * @param testArgument
+ * testArgument
+ *
+ * @return
+ * returns nothing
*/
Object testCommand(Object testArgument);
}
<version>0.2.0-SNAPSHOT</version>
<packaging>bundle</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <sourcepath>*/target/generated-sources/mdsal-binding/*</sourcepath>
+ <excludePackageNames>*</excludePackageNames>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <sourcepath>*/target/generated-sources/mdsal-binding/*</sourcepath>
+ <excludePackageNames>*</excludePackageNames>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
+
<dependencies>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
import ietf-inet-types {
prefix inet;
}
- import org-openroadm-routing-constraints {
- prefix org-openroadm-routing-constraints;
- revision-date 2016-10-14;
+ import org-openroadm-routing-constraints {
+ prefix org-openroadm-routing-constraints;
}
import org-openroadm-topology {
prefix org-openroadm-topology;
}
- import org-openroadm-common-types {
- prefix org-openroadm-common-types;
- revision-date 2016-10-14;
+ import org-openroadm-common-types {
+ prefix org-openroadm-common-types;
}
import org-openroadm-resource-types {
prefix org-openroadm-resource-types;
enum "service-restoration-result" {
value 7;
}
- //Add Martial
- enum "service-feasibility-check-result" {
- value 8;
- }
}
}
--- /dev/null
+module org-openroadm-service {
+ namespace "http://org/openroadm/service";
+ prefix org-openroadm-service;
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+ import org-openroadm-routing-constraints {
+ prefix org-openroadm-routing-constraints;
+ }
+ import org-openroadm-common-types {
+ prefix org-openroadm-common-types;
+ }
+ import org-openroadm-resource-types {
+ prefix org-openroadm-resource-types;
+ }
+ import org-openroadm-common-service-types {
+ prefix org-openroadm-common-service-types;
+ }
+
+ organization
+ "Open ROADM MSA";
+ contact
+ "OpenROADM.org";
+ description
+ "YANG definitions of services.
+
+ Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+ AT&T Intellectual Property. All other rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation and/or
+ other materials provided with the distribution.
+ * Neither the Members of the Open ROADM MSA Agreement nor the names of its
+ contributors may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA AGREEMENT ''AS IS''
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA AGREEMENT BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE";
+
+ revision 2016-10-14 {
+ description
+ "Version 1.2";
+ }
+
+ rpc service-create {
+ input {
+ leaf service-name {
+ type string;
+ description
+ "Identifier for the service to be created in
+ the ROADM network, e.g., CLFI, CLCI, etc. This is reported against the service, but may not get reflected in the service in the network.";
+ mandatory true;
+ }
+ leaf common-id {
+ type string;
+ description
+ "To be used by the ROADM controller to identify the routing constraints received from planning application (PED).";
+ }
+ uses org-openroadm-common-service-types:sdnc-request-header;
+ leaf connection-type {
+ type org-openroadm-common-service-types:connection-type;
+ mandatory true;
+ }
+ container service-a-end {
+ uses org-openroadm-common-service-types:service-endpoint;
+ }
+ container service-z-end {
+ uses org-openroadm-common-service-types:service-endpoint;
+ }
+ uses org-openroadm-routing-constraints:routing-constraints;
+ uses org-openroadm-common-service-types:service-information;
+ }
+ output {
+ uses org-openroadm-common-service-types:configuration-response-common;
+ uses org-openroadm-common-service-types:response-parameters;
+ }
+ description
+ "Whether this request passed initial validation and was accepted for processing. Once the request completes processing, a
+ service-rpc-result Notification shall be sent.";
+ }
+ rpc service-feasibility-check {
+ input {
+ leaf common-id {
+ type string;
+ mandatory true;
+ description
+ "To be used by the ROADM controller to identify the routing
+ constraints received from planning application (PED).";
+ }
+ uses org-openroadm-common-service-types:sdnc-request-header;
+ leaf connection-type {
+ type org-openroadm-common-service-types:connection-type;
+ }
+ container service-a-end {
+ uses org-openroadm-common-service-types:service-endpoint;
+ }
+ container service-z-end {
+ uses org-openroadm-common-service-types:service-endpoint;
+ }
+ uses org-openroadm-routing-constraints:routing-constraints;
+ uses org-openroadm-common-service-types:service-information;
+ }
+ output {
+ uses org-openroadm-common-service-types:configuration-response-common;
+ uses org-openroadm-common-service-types:response-parameters;
+ container service-a-end {
+ uses org-openroadm-common-service-types:service-endpoint;
+ list equipment-required {
+ description
+ "List of required equipment, including equipment type and quantity";
+ key "eqipment-identifier";
+ leaf eqipment-identifier {
+ type string;
+ }
+ leaf equipment-type {
+ type string;
+ }
+ leaf equipment-quantity {
+ type uint32;
+ }
+ }
+ }
+ container service-z-end {
+ uses org-openroadm-common-service-types:service-endpoint;
+ list equipment-required {
+ description
+ "List of required equipment, including equipment type and quantity";
+ key "eqipment-identifier";
+ leaf eqipment-identifier {
+ type string;
+ }
+ leaf equipment-type {
+ type string;
+ }
+ leaf equipment-quantity {
+ type uint32;
+ }
+ }
+ }
+ list intermediate-sites {
+ key "clli";
+ uses org-openroadm-common-service-types:service-endpoint;
+ list equipment-required {
+ description
+ "List of required equipment, including equipment type and quantity";
+ key "eqipment-identifier";
+ leaf eqipment-identifier {
+ type string;
+ }
+ leaf equipment-type {
+ type string;
+ }
+ leaf equipment-quantity {
+ type uint32;
+ }
+ }
+ }
+ }
+ description
+ "Whether a service was possible to be created, and if so
+ the routing constraints match and the a and z end connection that have
+ to match";
+ }
+ rpc service-delete {
+ input {
+ uses org-openroadm-common-service-types:sdnc-request-header;
+ container service-delete-req-info {
+ leaf service-name {
+ type string;
+ description
+ "Identifier for the service to be deleted in
+ the ROADM network, e.g., CLFI, CLCI, etc.";
+ mandatory true;
+ }
+ leaf due-date {
+ type yang:date-and-time;
+ description
+ "date and time service to be turned down. If missing, now.";
+ }
+ leaf tail-retention {
+ type enumeration {
+ enum "yes" {
+ value 1;
+ description
+ "tails are left intact ";
+ }
+ enum "no" {
+ value 2;
+ description
+ "tails are deleted";
+ }
+ }
+ mandatory true;
+ }
+ }
+ }
+ output {
+ uses org-openroadm-common-service-types:configuration-response-common;
+ }
+ description
+ "Whether this request passed initial validation and was accepted for processing. Once the request completes processing, a
+ service-rpc-result Notification shall be sent. Once the service has been deleted, it no longer will appear in the service list";
+ }
+ rpc equipment-notification {
+ input {
+ uses org-openroadm-common-service-types:sdnc-request-header;
+ leaf equiptment-id {
+ type string;
+ mandatory true;
+ }
+ leaf equipment-name {
+ type string;
+ }
+ leaf equipemt-type {
+ type string;
+ mandatory true;
+ }
+ leaf equipment-vendor {
+ type string;
+ mandatory true;
+ }
+ leaf equipment-customer {
+ type string;
+ }
+ leaf equipment-clli {
+ type string;
+ mandatory true;
+ }
+ leaf equipment-ip {
+ type string;
+ }
+ leaf controller-id {
+ type string;
+ mandatory true;
+ }
+ }
+ output {
+ uses org-openroadm-common-service-types:configuration-response-common;
+ }
+ }
+ rpc temp-service-create {
+ input {
+ leaf common-id {
+ type string;
+ description
+ "To be used by the ROADM controller to identify the routing constraints received from planning application (PED).";
+ mandatory true;
+ }
+ uses org-openroadm-common-service-types:sdnc-request-header;
+ leaf connection-type {
+ type org-openroadm-common-service-types:connection-type;
+ mandatory true;
+ }
+ container service-a-end {
+ uses org-openroadm-common-service-types:service-endpoint;
+ }
+ container service-z-end {
+ uses org-openroadm-common-service-types:service-endpoint;
+ }
+ uses org-openroadm-routing-constraints:routing-constraints;
+ uses org-openroadm-common-service-types:service-information;
+ }
+ output {
+ uses org-openroadm-common-service-types:configuration-response-common;
+ uses org-openroadm-common-service-types:response-parameters;
+ }
+ }
+ rpc temp-service-delete {
+ input {
+ leaf common-id {
+ type string;
+ mandatory true;
+ }
+ }
+ output {
+ uses org-openroadm-common-service-types:configuration-response-common;
+ }
+ }
+ rpc service-roll {
+ input {
+ leaf service-name {
+ type string;
+ mandatory true;
+ description
+ "Identifier for the service to be rolled in
+ the ROADM network, e.g., CLFI, CLCI, etc.";
+ }
+ leaf due-date {
+ type yang:date-and-time;
+ description
+ "date and time service to be rolled";
+ }
+ }
+ output {
+ uses org-openroadm-common-types:rpc-response-status;
+ }
+ }
+ rpc service-reconfigure {
+ input {
+ leaf service-name {
+ type string;
+ mandatory true;
+ description
+ "Existing identifier for the service to be
+ reconfigured in the ROADM network, e.g., CLFI, CLCI, etc.";
+ }
+ leaf new-service-name {
+ type string;
+ description
+ "New identifier for the service to be
+ reconfigured in the ROADM network, e.g., CLFI, CLCI, etc.";
+ }
+ leaf common-id {
+ type string;
+ description
+ "To be used by the ROADM controller to identify the routing
+ constraints received from planning application (PED).";
+ }
+ leaf connection-type {
+ type org-openroadm-common-service-types:connection-type;
+ }
+ container service-a-end {
+ uses org-openroadm-common-service-types:service-endpoint;
+ }
+ container service-z-end {
+ uses org-openroadm-common-service-types:service-endpoint;
+ }
+ uses org-openroadm-routing-constraints:routing-constraints;
+ uses org-openroadm-common-service-types:service-information;
+ }
+ output {
+ uses org-openroadm-common-types:rpc-response-status;
+ }
+ description
+ "Whether this request passed initial validation and was accepted for processing. Once the request completes processing, a
+ service-rpc-result Notification shall be sent.";
+ }
+ rpc service-restoration {
+ input {
+ leaf service-name {
+ type string;
+ mandatory true;
+ description
+ "Identifier for the service to be restored in
+ the ROADM network, e.g., CLFI, CLCI, etc.";
+ }
+ leaf option {
+ type enumeration {
+ enum "permanent" {
+ value 1;
+ description
+ "A spare regen can be used to restore the
+ service permanently without reverting back to the
+ original regen";
+ }
+ enum "temporary" {
+ value 2;
+ description
+ "a spare regen can be used to restore the
+ service temporarily. The service needs to be reverted
+ back to the original regen transponder";
+ }
+ }
+ mandatory true;
+ }
+ }
+ output {
+ uses org-openroadm-common-types:rpc-response-status;
+ }
+ description
+ "Whether this request passed initial validation and was accepted for processing. Once the request completes processing, a
+ service-rpc-result Notification shall be sent.";
+ }
+ rpc service-reversion {
+ input {
+ leaf service-name {
+ type string;
+ mandatory true;
+ description
+ "Identifier for the service to be reverted
+ in the ROADM network, e.g., CLFI, CLCI, etc. ";
+ }
+ leaf due-date {
+ type yang:date-and-time;
+ description
+ "date and time service to be reverted";
+ }
+ }
+ output {
+ uses org-openroadm-common-types:rpc-response-status;
+ }
+ description
+ "Whether this request passed initial validation and was accepted for processing. Once the request completes processing, a
+ service-rpc-result Notification shall be sent.";
+ }
+ rpc service-reroute {
+ input {
+ leaf service-name {
+ type string;
+ mandatory true;
+ description
+ "Identifier for the service to be re-routed in
+ the ROADM network, e.g., CLFI, CLCI, etc.";
+ }
+ }
+ output {
+ uses org-openroadm-common-types:rpc-response-status;
+ uses org-openroadm-routing-constraints:routing-constraints;
+ }
+ description
+ "Whether this request was validated and processed correct. If sucessful, it return the proposed new route.
+ If acceptable, this request should be followed by a service-reroute-confirm to complete the reroute operation.";
+ }
+ rpc service-reroute-confirm {
+ input {
+ leaf service-name {
+ type string;
+ mandatory true;
+ description
+ "Identifier for the service to be re-routed in
+ the ROADM network, e.g., CLFI, CLCI, etc.";
+ }
+ uses org-openroadm-routing-constraints:routing-constraints;
+ }
+ output {
+ uses org-openroadm-common-types:rpc-response-status;
+ }
+ description
+ "Whether this request passed initial validation and was accepted for processing. Once the request completes processing, a
+ service-rpc-result Notification shall be sent.";
+ }
+ rpc network-re-optimization {
+ input {
+ leaf service-name {
+ type string;
+ description
+ "Identifier for the service in the ROADM network,
+ e.g., CLFI, CLCI, etc. whose path is to be checked by the RNC
+ for re-optimization";
+ }
+ leaf a-end {
+ type string;
+ description
+ "Services whose A-ends are terminated at the
+ specified office location are to be checked by the RNC for
+ re-optimization";
+ }
+ leaf z-end {
+ type string;
+ description
+ "Services whose Z-ends are terminated at the
+ specified office location are to be checked by the RNC for
+ re-optimization ";
+ }
+ leaf pass-through {
+ type string;
+ description
+ "Services that are pass-through (either via
+ regen or express) at the specified office location are to
+ be checked by the RNC for re-optimization";
+ }
+ leaf customer-code {
+ type string;
+ description
+ "Services that belong to the specified customer
+ are to be checked by the RNC for re-optimization ";
+ }
+ }
+ output {
+ uses org-openroadm-common-types:rpc-response-status;
+ leaf optimization-candidate {
+ type string;
+ }
+ }
+ }
+ container service-list {
+ description
+ "List of service. Can only be created, deleted, modified, etc. using special RPCs.";
+ list services {
+ key "service-name";
+ uses org-openroadm-common-service-types:service;
+ }
+ }
+ container temp-service-list {
+ description
+ "List of temporary services Can only be created, deleted, modified, etc. using special RPCs.";
+ list services {
+ key "common-id";
+ uses org-openroadm-common-service-types:service {
+ refine "service-name" {
+ mandatory false;
+ }
+ }
+ }
+ }
+ notification service-rpc-result {
+ description
+ "This Notification indicates result of service RPC";
+ leaf notification-type {
+ type org-openroadm-common-service-types:service-notification-types;
+ }
+ uses org-openroadm-common-types:rpc-response-status;
+ uses org-openroadm-common-service-types:service-notification-result;
+ }
+ notification service-traffic-flow {
+ description
+ "This Notification indicates that traffic is flowing again on the service after an administrative action has completed";
+ leaf service-name {
+ type string;
+ description
+ "Identifier for the service being reported on";
+ mandatory true;
+ }
+ leaf actual-date {
+ type yang:date-and-time;
+ description
+ "Actual date and time traffic started flowing";
+ }
+ }
+ notification service-notification {
+ description
+ "This Notification that a service has been added, modified or removed.
+ A resourceCreation notification shall contain the created service in its entirety.
+ A resourceMofified notification shall contain just the modified field, plus the service identifier
+ A resourceDeleted notification shall just contain the service identifier";
+ leaf notificationType {
+ type org-openroadm-resource-types:resource-notification-type;
+ description
+ "Whether this notification indicates a service creation, service modification or service deletion.";
+ }
+ uses org-openroadm-common-service-types:service;
+ }
+}
</modules>
<!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
+ <!--
+ Jenkins-releng tests reports more than 600 lines of javadoc warnings on ordmodels
+ and api folders generated-sources for unclear reasons.
+ This behavior was impossible to reproduce locally.
+ The javadoc plugin build section below removes most of those useless warnings.
+ ordmodels/pom.xml and api/pom.xml have been modified similarly with a build and
+ a reporting sections to remove the rest of the warnings.
+ Note that javadoc plugins maven implementation still suffers from several bugs.
+ Tests shows that many configurations options are not correctly supported.
+ (proxy, sourceFilesExclude, etc...).
+ -->
<build>
<plugins>
<plugin>
<skip>true</skip>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <sourcepath>*/target/generated-sources/mdsal-binding/*</sourcepath>
+ <excludePackageNames>*</excludePackageNames>
+ </configuration>
+ </plugin>
</plugins>
</build>
import java.util.Collection;
import java.util.List;
import java.util.Set;
-import java.util.concurrent.Future;
import java.util.stream.Collectors;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.RpcResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
alarmListener = new AlarmNotificationListener();
LOG.info("Registering notification listener on {} for node: {}", AlarmNotification.QNAME, nodeId);
// Register notification listener
- final ListenerRegistration<OrgOpenroadmAlarmListener>
- accessAlarmNotificationListenerRegistration =
- notificationService.get().registerNotificationListener(alarmListener);
+
final OrgOpenroadmDeOperationsListener deOperationsListener;
deOperationsListener = new DeOperationsListener();
LOG.info("Registering notification listener on OrgOpenroadmDeOperationsListener for node: {}", nodeId);
// Register notification listener
- final ListenerRegistration<OrgOpenroadmDeOperationsListener>
- accessDeOperationasNotificationListenerRegistration =
- notificationService.get().registerNotificationListener(deOperationsListener);
+
final OrgOpenroadmDeviceListener deviceListener;
deviceListener = new DeviceListener();
LOG.info("Registering notification listener on OrgOpenroadmDeviceListener for node: {}", nodeId);
// Register notification listener
- final ListenerRegistration<OrgOpenroadmDeviceListener>
- accessDeviceNotificationListenerRegistration = notificationService.get()
- .registerNotificationListener(deviceListener);
+
final OrgOpenroadmLldpListener lldpListener;
lldpListener = new LldpListener();
LOG.info("Registering notification listener on OrgOpenroadmLldpListener for node: {}", nodeId);
// Register notification listener
- final ListenerRegistration<OrgOpenroadmLldpListener> accessLldpNotificationListenerRegistration =
- notificationService.get().registerNotificationListener(lldpListener);
+
final OrgOpenroadmTcaListener tcaListener;
tcaListener = new TcaListener();
LOG.info("Registering notification listener on OrgOpenroadmTcaListener for node: {}", nodeId);
// Register notification listener
- final ListenerRegistration<OrgOpenroadmTcaListener> accessTcaNotificationListenerRegistration =
- notificationService.get().registerNotificationListener(tcaListener);
+
// Listening to NETCONF datastream
final String streamName = "NETCONF";
final CreateSubscriptionInputBuilder createSubscriptionInputBuilder = new CreateSubscriptionInputBuilder();
createSubscriptionInputBuilder.setStream(new StreamNameType(streamName));
LOG.info("Triggering notification stream {} for node {}", streamName, nodeId);
- final Future<RpcResult<Void>> subscription = rpcService.createSubscription(createSubscriptionInputBuilder
- .build());
+
}
public void close() {
/*
* TODO: check for required
* capabilities to listen for notifications
- * registerNotificationListener(rootNode.
- * getDataAfter(). getNodeId());
*/
+ registerNotificationListener(rootNode.getDataAfter(). getNodeId());
currentMountedDevice.add(nodeId);
new PortMapping(dataBroker, mountService, nodeId).createMappingData();
break;
* Unique Identifier for the node of interest.
* @param logicalConnPoint
* Name of the logical point
+ * @param db
+ * Databroker / MD-SAL data store
*
* @return Result Mapping object if success otherwise null.
*/
--- /dev/null
+/*
+ * Copyright © 2017 AT&T and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.transportpce.renderer.openroadminterface;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+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.ethernet.interfaces.rev161014.EthAttributes.AutoNegotiation;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev161014.EthAttributes.Duplex;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev161014.EthAttributes.Fec;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev161014.Interface1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev161014.Interface1Builder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev161014.ethernet.container.EthernetBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.EthernetCsmacd;
+
+public class OpenRoadmEthIterface extends OpenRoadmInterfaces {
+
+ public OpenRoadmEthIterface(DataBroker db, MountPointService mps, String nodeId, String logicalConnPoint,
+ String serviceName) {
+ super(db, mps, nodeId, logicalConnPoint, serviceName);
+
+ }
+
+ public String createInterface() {
+ InterfaceBuilder ethInterfaceBldr = getIntfBuilder(portMap);
+ ethInterfaceBldr.setType(EthernetCsmacd.class);
+ ethInterfaceBldr.setName(logicalConnPoint + "-ETHERNET");
+ ethInterfaceBldr.setKey(new InterfaceKey(logicalConnPoint + "-ETHERNET"));
+
+ // Ethernet interface specific data
+ EthernetBuilder ethIfBuilder = new EthernetBuilder();
+ ethIfBuilder.setAutoNegotiation(AutoNegotiation.Enabled);
+ ethIfBuilder.setDuplex(Duplex.Full);
+ ethIfBuilder.setFec(Fec.Off);
+ ethIfBuilder.setSpeed(new Long(100000));
+ ethIfBuilder.setMtu(new Long(9000));
+
+ // Create Interface1 type object required for adding as augmentation
+ Interface1Builder ethIf1Builder = new Interface1Builder();
+ ethInterfaceBldr.addAugmentation(Interface1.class, ethIf1Builder.setEthernet(ethIfBuilder.build()).build());
+
+ // Post interface on the device
+ if (postInterface(ethInterfaceBldr)) {
+ return ethInterfaceBldr.getName();
+ } else {
+ return null;
+ }
+
+ }
+
+}
protected final DataBroker db;
protected final DataBroker netconfNodeDataBroker;
protected final String nodeId;
+ protected final MountPointService mps;
protected final Mapping portMap;
protected final String logicalConnPoint;
+ private final String serviceName;
private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmInterfaces.class);
public OpenRoadmInterfaces(DataBroker db, MountPointService mps, String nodeId, String logicalConnPoint) {
this.db = db;
+ this.mps = mps;
this.logicalConnPoint = logicalConnPoint;
this.nodeId = nodeId;
- this.portMap = PortMapping.getMapping(nodeId, logicalConnPoint, db);
+ if (logicalConnPoint != null) {
+ this.portMap = PortMapping.getMapping(nodeId, logicalConnPoint, db);
+ } else {
+ this.portMap = null;
+ }
+ this.serviceName = null;
+ netconfNodeDataBroker = PortMapping.getDeviceDataBroker(nodeId, mps);
+ }
+
+ public OpenRoadmInterfaces(DataBroker db, MountPointService mps, String nodeId, String logicalConnPoint,
+ String serviceName) {
+ this.db = db;
+ this.mps = mps;
+ this.logicalConnPoint = logicalConnPoint;
+ this.nodeId = nodeId;
+ if (logicalConnPoint != null) {
+ this.portMap = PortMapping.getMapping(nodeId, logicalConnPoint, db);
+ } else {
+ this.portMap = null;
+ }
+ this.serviceName = serviceName;
netconfNodeDataBroker = PortMapping.getDeviceDataBroker(nodeId, mps);
}
/**
- * This methods creates a generic interface builder object to set the value
- * that are common irrespective of the interface type.
+ * This methods creates a generic interface builder object to set the value that
+ * are common irrespective of the interface type.
*
* @param portMap
- * Mapping object containing attributes required to create
- * interface on the device.
+ * Mapping object containing attributes required to create interface
+ * on the device.
*
* @return InterfaceBuilder object with the data.
*/
}
/**
- * This methods does an edit-config operation on the openROADM device in
- * order to create the given interface.
+ * This methods does an edit-config operation on the openROADM device in order
+ * to create the given interface.
*
* <p>
* Before posting the interface it checks if:
* @return Result of operation true/false based on success/failure.
*/
public boolean postInterface(InterfaceBuilder ifBuilder) {
-
String intf2Post = ifBuilder.getName();
Interface intf2PostCheck = getInterface(intf2Post);
- if (intf2PostCheck != null) {
- if (intf2PostCheck.getAdministrativeState() == AdminStates.InService) {
- LOG.info("Interface with same name in service already exists");
- return true;
- }
+ if (intf2PostCheck != null && intf2PostCheck.getAdministrativeState() == AdminStates.InService) {
+ LOG.info("Interface with same name in service already exists on node " + nodeId);
+ return true;
}
+
// Post interface with its specific augmentation to the device
if (netconfNodeDataBroker != null) {
- InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
- Interface.class, new InterfaceKey(ifBuilder.getName()));
+ InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+ .child(Interface.class, new InterfaceKey(ifBuilder.getName()));
final WriteTransaction writeTransaction = netconfNodeDataBroker.newWriteOnlyTransaction();
writeTransaction.put(LogicalDatastoreType.CONFIGURATION, interfacesIID, ifBuilder.build());
final CheckedFuture<Void, TransactionCommitFailedException> submit = writeTransaction.submit();
try {
submit.checkedGet();
- LOG.info("Successfully posted interface " + ifBuilder.getName());
+ LOG.info("Successfully posted interface " + ifBuilder.getName() + " on node " + nodeId);
return true;
} catch (TransactionCommitFailedException ex) {
- LOG.warn("Failed to post {} ", ifBuilder.getName(),ex);
+ LOG.warn("Failed to post {} ", ifBuilder.getName() + " on node " + nodeId, ex);
return false;
}
/**
* This private does a get on the interface subtree of the device with the
- * interface name as the key and return the class corresponding to the
- * interface type.
+ * interface name as the key and return the class corresponding to the interface
+ * type.
*
* @param interfaceName
* Name of the interface
public Interface getInterface(String interfaceName) {
ReadOnlyTransaction rtx = netconfNodeDataBroker.newReadOnlyTransaction();
- InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
- Interface.class, new InterfaceKey(interfaceName));
+ InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+ .child(Interface.class, new InterfaceKey(interfaceName));
try {
Optional<Interface> interfaceObject = rtx.read(LogicalDatastoreType.CONFIGURATION, interfacesIID).get();
if (interfaceObject.isPresent()) {
return interfaceObject.get();
} else {
- LOG.info("Interface subtree is not present for " + interfaceName);
+ LOG.info("Interface subtree is not present for " + interfaceName + " on node " + nodeId);
}
} catch (InterruptedException | ExecutionException ex) {
- LOG.info("Read failed on interface subtree for",ex);
+ LOG.info("Read failed on interface subtree for" + interfaceName + " on node " + nodeId, ex);
return null;
}
return null;
}
/**
- * This methods does an edit-config operation on the openROADM device in
- * order to delete the given interface.
+ * This methods does an edit-config operation on the openROADM device in order
+ * to delete the given interface.
*
* <p>
* Before deleting the method:
// post interface with updated admin state
if (postInterface(ifBuilder)) {
InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
- .child(Interface.class, new InterfaceKey(interfaceName));
+ .child(Interface.class, new InterfaceKey(interfaceName));
final WriteTransaction writeTransaction = netconfNodeDataBroker.newWriteOnlyTransaction();
writeTransaction.delete(LogicalDatastoreType.CONFIGURATION, interfacesIID);
final CheckedFuture<Void, TransactionCommitFailedException> submit = writeTransaction.submit();
try {
submit.checkedGet();
- LOG.info("Successfully deleted " + interfaceName);
+ LOG.info("Successfully deleted " + interfaceName + " on node " + nodeId);
return true;
} catch (TransactionCommitFailedException ex) {
- LOG.error("Failed to delete interface {} ", interfaceName, ex);
+ LOG.error("Failed to delete interface " + interfaceName + " on node " + nodeId);
return false;
}
} else {
- LOG.error("Error changing the state of interface " + interfaceName);
+ LOG.error("Error changing the state of interface " + interfaceName + " on node " + nodeId);
return false;
}
} else {
- LOG.info("Interface does not exist, cannot delete");
+ LOG.info("Interface does not exist, cannot delete on node " + nodeId);
return false;
}
} else {
- LOG.info("Device databroker not found");
+ LOG.info("Device databroker not found on node " + nodeId);
return false;
}
}
-}
\ No newline at end of file
+}
package org.opendaylight.transportpce.renderer.openroadminterface;
+import java.math.BigDecimal;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+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.interfaces.rev161014.OpticalChannel;
import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.Interface1;
import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.Interface1Builder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.OchAttributes.ModulationFormat;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.RateIdentity;
import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.och.container.OchBuilder;
public class OpenRoadmOchInterface extends OpenRoadmInterfaces {
- public OpenRoadmOchInterface(DataBroker db, MountPointService mps, String nodeId, String logicalConnPoint) {
- super(db, mps, nodeId, logicalConnPoint);
+ public OpenRoadmOchInterface(DataBroker db, MountPointService mps, String nodeId, String logicalConnPoint,
+ String serviceName) {
+ super(db, mps, nodeId, logicalConnPoint, serviceName);
}
/**
- * This methods creates an OCH interface on the given termination point.
+ * This methods creates an OCH interface on the given termination point on
+ * Roadm.
*
* @param waveNumber
* wavelength number of the OCH interface.
OchBuilder ocIfBuilder = new OchBuilder();
ocIfBuilder.setWavelengthNumber(waveNumber);
- //Add supporting OMS interface
- ochInterfaceBldr.setSupportingInterface(portMap.getSupportingOms());
+ // Add supporting OMS interface
+ if (portMap.getSupportingOms() != null) {
+ ochInterfaceBldr.setSupportingInterface(portMap.getSupportingOms());
+ }
+ // Create Interface1 type object required for adding as augmentation
+ Interface1Builder ochIf1Builder = new Interface1Builder();
+ ochInterfaceBldr.addAugmentation(Interface1.class, ochIf1Builder.setOch(ocIfBuilder.build()).build());
+
+ // Post interface on the device
+ if (postInterface(ochInterfaceBldr)) {
+ return ochInterfaceBldr.getName();
+ } else {
+ return null;
+ }
+ }
+
+ public String createInterface(Long waveNumber, Class<? extends RateIdentity> rate, ModulationFormat format) {
+
+ // Create generic interface
+ InterfaceBuilder ochInterfaceBldr = getIntfBuilder(portMap);
+ ochInterfaceBldr.setType(OpticalChannel.class);
+ ochInterfaceBldr.setName(logicalConnPoint + "-" + waveNumber);
+ ochInterfaceBldr.setKey(new InterfaceKey(logicalConnPoint + "-" + waveNumber));
+
+ // OCH interface specific data
+ OchBuilder ocIfBuilder = new OchBuilder();
+ ocIfBuilder.setWavelengthNumber(waveNumber);
+ ocIfBuilder.setModulationFormat(format);
+ ocIfBuilder.setRate(rate);
+ ocIfBuilder.setTransmitPower(new PowerDBm(new BigDecimal("-5")));
// Create Interface1 type object required for adding as augmentation
Interface1Builder ochIf1Builder = new Interface1Builder();
return null;
}
}
+
}
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+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.interfaces.rev161014.OtnOdu;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.Interface1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.Interface1Builder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.ODU4;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.OduAttributes.MonitoringMode;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.odu.container.OduBuilder;
public class OpenRoadmOdu4Interface extends OpenRoadmInterfaces {
- public OpenRoadmOdu4Interface(DataBroker db, MountPointService mps, String nodeId, String logicalConnPoint) {
- super(db, mps, nodeId, logicalConnPoint);
+ public OpenRoadmOdu4Interface(DataBroker db, MountPointService mps, String nodeId, String logicalConnPoint,
+ String serviceName) {
+ super(db, mps, nodeId, logicalConnPoint, serviceName);
}
/**
* This methods creates an ODU interface on the given termination point.
*
+ * @param supportingOtuInterface
+ * supporting Otu Interface
*
* @return Name of the interface if successful, otherwise return null.
*/
- public String createInterface() {
- // TODO:implement this method
- return null;
+ public String createInterface(String supportingOtuInterface) {
+
+ InterfaceBuilder oduInterfaceBldr = getIntfBuilder(portMap);
+ oduInterfaceBldr.setType(OtnOdu.class);
+ oduInterfaceBldr.setSupportingInterface(supportingOtuInterface);
+ oduInterfaceBldr.setName(logicalConnPoint + "-ODU");
+ oduInterfaceBldr.setKey(new InterfaceKey(logicalConnPoint + "-ODU"));
+
+ // ODU interface specific data
+ OduBuilder oduIfBuilder = new OduBuilder();
+ oduIfBuilder.setRate(ODU4.class);
+ oduIfBuilder.setMonitoringMode(MonitoringMode.Monitored);
+
+ // Create Interface1 type object required for adding as augmentation
+ Interface1Builder oduIf1Builder = new Interface1Builder();
+ oduInterfaceBldr.addAugmentation(Interface1.class, oduIf1Builder.setOdu(oduIfBuilder.build()).build());
+
+ // Post interface on the device
+ if (postInterface(oduInterfaceBldr)) {
+ return oduInterfaceBldr.getName();
+ } else {
+ return null;
+ }
}
}
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+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.interfaces.rev161014.OtnOtu;
+
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1Builder;
+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.Fec;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.otu.container.OtuBuilder;
public class OpenRoadmOtu4Interface extends OpenRoadmInterfaces {
- public OpenRoadmOtu4Interface(DataBroker db, MountPointService mps, String nodeId, String logicalConnPoint) {
- super(db, mps, nodeId, logicalConnPoint);
+ public OpenRoadmOtu4Interface(DataBroker db, MountPointService mps, String nodeId, String logicalConnPoint,
+ String serviceName) {
+ super(db, mps, nodeId, logicalConnPoint, serviceName);
}
/**
* This methods creates an OTU interface on the given termination point.
*
+ * @param supportOchInterface
+ * support Och Interface
*
* @return Name of the interface if successful, otherwise return null.
*/
- public String createInterface() {
- // TODO: Implement this method
- return null;
- }
+ public String createInterface(String supportOchInterface) {
+ // Create generic interface
+ InterfaceBuilder otuInterfaceBldr = getIntfBuilder(portMap);
+ otuInterfaceBldr.setType(OtnOtu.class);
+ otuInterfaceBldr.setSupportingInterface(supportOchInterface);
+ otuInterfaceBldr.setName(logicalConnPoint + "-OTU");
+ otuInterfaceBldr.setKey(new InterfaceKey(logicalConnPoint + "-OTU"));
+
+ // OTU interface specific data
+ OtuBuilder otuIfBuilder = new OtuBuilder();
+ otuIfBuilder.setFec(Fec.Scfec);
+ otuIfBuilder.setRate(OTU4.class);
+ // Create Interface1 type object required for adding as augmentation
+ Interface1Builder otuIf1Builder = new Interface1Builder();
+ otuInterfaceBldr.addAugmentation(Interface1.class, otuIf1Builder.setOtu(otuIfBuilder.build()).build());
+
+ // Post interface on the device
+ if (postInterface(otuInterfaceBldr)) {
+ return otuInterfaceBldr.getName();
+ } else {
+ return null;
+ }
+ }
}
--- /dev/null
+/*
+ * Copyright © 2017 AT&T and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.transportpce.renderer.openroadminterface;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.OchAttributes.ModulationFormat;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.RateIdentity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class OpenRoadmXponderInterface extends OpenRoadmInterfaces {
+
+ private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmXponderInterface.class);
+ private final String serviceName;
+
+ public OpenRoadmXponderInterface(DataBroker db, MountPointService mps, String nodeId, String logicalConnPoint,
+ String serviceName) {
+ super(db, mps, nodeId, logicalConnPoint,serviceName);
+ this.serviceName = serviceName;
+
+ }
+
+ public boolean createLineInterfaces(Long waveNumber, Class<? extends RateIdentity> rate, ModulationFormat format) {
+
+ String supportOchInterface = new OpenRoadmOchInterface(db, mps, nodeId, logicalConnPoint,serviceName)
+ .createInterface(waveNumber, rate, format);
+ String supportingOtuInterface;
+ String supportingOduInterface;
+
+ if (supportOchInterface != null) {
+ supportingOtuInterface = new OpenRoadmOtu4Interface(db, mps, nodeId, logicalConnPoint,serviceName)
+ .createInterface(supportOchInterface);
+ } else {
+ LOG.error("Unable to create OCH interface on the transponder");
+ return false;
+ }
+ if (supportingOtuInterface != null) {
+ supportingOduInterface = new OpenRoadmOdu4Interface(db, mps, nodeId, logicalConnPoint,serviceName)
+ .createInterface(supportingOtuInterface);
+ } else {
+ LOG.error("Unable to create OTU interface on the transponder");
+ return false;
+ }
+ if (supportingOduInterface != null) {
+ return true;
+ } else {
+ LOG.error("Unable to create ODU interface on the transponder");
+ return false;
+ }
+ }
+
+ public boolean createClientInterfaces() {
+
+ if (new OpenRoadmEthIterface(db, mps, nodeId, logicalConnPoint,serviceName).createInterface() != null) {
+ return true;
+ }
+ return false;
+ }
+}
* This method return the RoadmConnection subtree for a given connection
* number.
*
- * @param connectionNumber
- * Name of the cross connect.
- *
* @return Roadm connection subtree from the device.
*/
- public RoadmConnections getCrossConnect(String connectionNumber) {
- if (connectionNumber == null && this.connectionNumber != null) {
- connectionNumber = this.connectionNumber;
- }
- if (deviceDb != null) {
+ public RoadmConnections getCrossConnect() {
+
+ if (deviceDb != null && connectionNumber != null) {
ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
Optional<RoadmConnections> roadmConnectionsObject;
try {
}
}
- /**
- * This method does a delete(edit-config) on roadm connection subtree for a
- * given connection number.
- *
- * @param connectionNumber
- * Name of the cross connect.
- * @return true/false based on status of operation.
- */
- public boolean deleteCrossConnect(String connectionNumber) {
- if (connectionNumber == null && this.connectionNumber != null) {
- connectionNumber = this.connectionNumber;
- }
- return deleteCrossConnect();
- }
/**
* This method does a delete(edit-config) on roadm connection subtree for a
public boolean deleteCrossConnect() {
//Check if cross connect exists before delete
- if (getCrossConnect(connectionNumber) == null) {
+ if (getCrossConnect() == null) {
LOG.info("Cross connect does not exist, halting delete");
return false;
}
}
}
- /**
- * This method does an edit-config on roadm connection subtree for a given
- * connection number in order to set power level for use by the optical
- * power control.
- *
- * @param mode
- * Optical control modelcan be off, power or gainLoss.
- * @param value
- * Power value in DBm.
- * @param connectionNumber
- * Name of the cross connect.
- * @return true/false based on status of operation.
- */
- public boolean setPowerLevel(OpticalControlMode mode, PowerDBm value, String connectionNumber) {
- if (connectionNumber == null && this.connectionNumber != null) {
- connectionNumber = this.connectionNumber;
- }
- return setPowerLevel(mode, value);
- }
+
/**
* This method does an edit-config on roadm connection subtree for a given
*/
public boolean setPowerLevel(OpticalControlMode mode, PowerDBm value) {
- RoadmConnections rdmConn = getCrossConnect(connectionNumber);
+ RoadmConnections rdmConn = getCrossConnect();
if (rdmConn != null) {
RoadmConnectionsBuilder rdmConnBldr = new RoadmConnectionsBuilder(rdmConn);
rdmConnBldr.setOpticalControlMode(mode);
import org.opendaylight.transportpce.renderer.mapping.PortMapping;
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaces;
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmOchInterface;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmXponderInterface;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.OchAttributes.ModulationFormat;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.R100G;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.RendererService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathOutput;
*/
public ServicePathOutputBuilder setupServicePath(ServicePathInput input) {
+ String serviceName = input.getServiceName();
List<Nodes> nodes = input.getNodes();
ServicePathOutputBuilder setServBldr = new ServicePathOutputBuilder();
LOG.info(currentMountedDevice.toString());
+ int crossConnectFlag;
for (Nodes n : nodes) {
LOG.info("Starting provisioning for node : " + n.getNodeId());
+ crossConnectFlag = 0;
String nodeId = n.getNodeId();
// if the node is currently mounted then proceed
if (currentMountedDevice.contains(n.getNodeId())) {
String destTp = n.getDestTp();
Long waveNumber = input.getWaveNumber();
- String srcIf = new OpenRoadmOchInterface(db, mps, nodeId, srcTp).createInterface(waveNumber);
- // if source interface creation was successful then proceed
- // otherwise return.
- if (srcIf == null) {
- LOG.warn("Unable to create OCH interface on " + nodeId + " at " + srcTp);
- return setServBldr.setResult("Unable to create OCH interface on " + nodeId + " at " + srcTp);
+ if (destTp.contains("NETWORK")) {
+ crossConnectFlag++;
+ if (!new OpenRoadmXponderInterface(db, mps, nodeId, destTp, serviceName)
+ .createLineInterfaces(waveNumber, R100G.class, ModulationFormat.Qpsk)) {
+
+ return setServBldr.setResult("Unable to LINE interface on " + nodeId + " at " + destTp);
+ }
+ }
+ if (srcTp.contains("CLIENT")) {
+ crossConnectFlag++;
+ if (!new OpenRoadmXponderInterface(db, mps, nodeId, srcTp, serviceName).createClientInterfaces()) {
+ return setServBldr.setResult("Unable to Client interface on " + nodeId + " at " + srcTp);
+ }
}
- // if destination interface creation was then proceed otherwise
- // return.
- String dstIf = new OpenRoadmOchInterface(db, mps, nodeId, destTp).createInterface(waveNumber);
- if (dstIf == null) {
- LOG.warn("Unable to create OCH interface on " + nodeId + " at " + destTp);
- return setServBldr.setResult("Unable to create OCH interface on " + nodeId + " at " + destTp);
+ String srcIf;
+ String dstIf;
+ if (srcTp.contains("TTP") || srcTp.contains("PP")) {
+ srcIf = new OpenRoadmOchInterface(db, mps, nodeId, srcTp, serviceName).createInterface(waveNumber);
+ // if source interface creation was successful then proceed
+ // otherwise return.
+ if (srcIf == null) {
+ LOG.warn("Unable to create OCH interface on " + nodeId + " at " + srcTp);
+ return setServBldr.setResult("Unable to create OCH interface on " + nodeId + " at " + srcTp);
+ }
}
- LOG.info("Creating cross connect between source :" + srcTp + " destination " + destTp + " for node " + n
- .getNodeId());
- DataBroker netconfNodeDataBroker = PortMapping.getDeviceDataBroker(nodeId, mps);
- CrossConnect roadmConnections = new CrossConnect(netconfNodeDataBroker);
- if (roadmConnections.postCrossConnect(waveNumber, srcTp, destTp) == true) {
- nodesProvisioned.add(nodeId);
- roadmConnections.getConnectionPortTrail(nodeId, mps, waveNumber, srcTp, destTp);
-
- } else {
- return setServBldr.setResult("Unable to post Roadm-connection for node " + nodeId);
+ if (destTp.contains("TTP") || destTp.contains("PP")) {
+ dstIf = new OpenRoadmOchInterface(db, mps, nodeId, destTp, serviceName).createInterface(waveNumber);
+ // if destination interface creation was successful then proceed
+ // otherwise return.
+ if (dstIf == null) {
+ LOG.warn("Unable to create OCH interface on " + nodeId + " at " + destTp);
+ return setServBldr.setResult("Unable to create OCH interface on " + nodeId + " at " + destTp);
+ }
+ }
+ if (crossConnectFlag < 1) {
+ LOG.info("Creating cross connect between source :" + srcTp + " destination " + destTp + " for node "
+ + n.getNodeId());
+ DataBroker netconfNodeDataBroker = PortMapping.getDeviceDataBroker(nodeId, mps);
+ String crossConnectName = srcTp + "-" + destTp + "-" + waveNumber;
+ CrossConnect roadmConnections = new CrossConnect(netconfNodeDataBroker);
+ if (roadmConnections.postCrossConnect(waveNumber, srcTp, destTp)) {
+ nodesProvisioned.add(nodeId);
+ roadmConnections.getConnectionPortTrail(nodeId, mps, waveNumber, srcTp, destTp);
+ } else {
+ return setServBldr.setResult("Unable to post Roadm-connection for node " + nodeId);
+ }
}
} else {
LOG.warn(nodeId + " is not mounted on the controller");
return setServBldr.setResult("Roadm-connection successfully created for nodes " + nodesProvisioned.toString());
}
+
/**
* This method removes wavelength path based on following steps: For each
* node:
// if the node is currently mounted then proceed.
if (currentMountedDevice.contains(nodeId)) {
+
+ if (destTp.contains("NETWORK")) {
+ if (new OpenRoadmInterfaces(db, mps, nodeId, destTp)
+ .deleteInterface(destTp + "-ODU") == false) {
+ LOG.error("Failed to delete interface " + destTp + "-ODU");
+ }
+ if (new OpenRoadmInterfaces(db, mps, nodeId, destTp)
+ .deleteInterface(destTp + "-OTU") == false) {
+ LOG.error("Failed to delete interface " + destTp + "-OTU");
+ }
+ if (new OpenRoadmInterfaces(db, mps, nodeId, destTp)
+ .deleteInterface(destTp + "-" + waveNumber) == false) {
+ LOG.error("Failed to delete interface " + destTp + "-" + waveNumber);
+ }
+ }
+ if (srcTp.contains("CLIENT")) {
+ // Deleting interface on source termination point
+ if (new OpenRoadmInterfaces(db, mps, nodeId, srcTp)
+ .deleteInterface(srcTp + "-ETHERNET") == false) {
+ LOG.error("Failed to delete Ethernet interface on " + srcTp);
+ }
+ continue;
+ }
String connectionNumber = srcTp + "-" + destTp + "-" + waveNumber;
CrossConnect roadmConnection = new CrossConnect(PortMapping.getDeviceDataBroker(nodeId, mps),
- connectionNumber);
+ connectionNumber);
if (!roadmConnection.deleteCrossConnect()) {
LOG.error("Failed to delete {} ", srcTp + "-" + destTp + "-" + waveNumber);
}
// Deleting interface on source termination point
- if (new OpenRoadmInterfaces(db, mps, nodeId, srcTp).deleteInterface(srcTp + "-" + waveNumber
- .toString()) == false) {
+ if (!new OpenRoadmInterfaces(db, mps, nodeId, srcTp)
+ .deleteInterface(srcTp + "-" + waveNumber.toString())) {
LOG.error("Failed to delete interface " + srcTp + "-" + waveNumber.toString());
}
// Deleting interface on destination termination point
- if (new OpenRoadmInterfaces(db, mps, nodeId, srcTp).deleteInterface(destTp + "-" + waveNumber
- .toString()) == false) {
- LOG.error("Failed to delete interface " + srcTp + "-" + waveNumber.toString());
+ if (!new OpenRoadmInterfaces(db, mps, nodeId, destTp)
+ .deleteInterface(destTp + "-" + waveNumber.toString())) {
+ LOG.error("Failed to delete interface " + destTp + "-" + waveNumber.toString());
}
} else {
LOG.warn(nodeId + " is not mounted on the controller");
}
return delServBldr.setResult("Request processed");
}
-}
\ No newline at end of file
+}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/* Class to check coherency between hard & sof constraints.
+/**
+ * Class to check coherency between hard and soft constraints.
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
*
*/
this.soft = soft;
}
- /*function to check coherency between hard & soft constraints.
+ /**
+ * function to check coherency between hard and soft constraints.
* @return <code> true </code> if coherent
* <code> false </code> else
*/
import com.google.common.util.concurrent.FutureCallback;
import org.slf4j.Logger;
-/*
- * Class to log future logging from datastore actions (write & modify & delete..).
+/**
+ * Class to log future logging from datastore actions (write, modify and delete..).
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
*/
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/*
- * class for Mapping and Sending PCE requests : - path-computation-request -
- * cancel-resource-reserve.
+/**
+ * Class for Mapping and Sending PCE requests :
+ * - path-computation-request
+ * - cancelCresource-reserve.
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
*
*/
private String error;
private final ListeningExecutorService executor = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(5));
- /*
+ /**
* MappingAndSendingPCRequest Class constructor for RPC serviceReconfigure.
*
* @param rpcRegistry
setError("");
}
- /*
+ /**
* MappingAndSendingPCRequest Class constructor for RPC
* serviceFeasibilityCheck.
*
setError("");
}
- /*
+ /**
* MappingAndSendingPCRequest Class constructor for RPC serviceCreate.
*
* @param rpcRegistry
setError("");
}
- /*
+ /**
* MappingAndSendingPCRequest Class constructor for modify Service in ODL
* Datastore.
*
setError("");
}
- /*
+ /**
* Build pathComputationRequestInput or cancelResourceReserveInput with
* input parameters (serviceReconfigureInput or serviceFeasibilityCheckInput.
*
.setServiceHandlerHeader(serviceHandlerHeader.build()).build();
}
- /* Send cancelResourceReserve request to PCE.
+ /**
+ * Send cancelResourceReserve request to PCE.
*
* @return CancelResourceReserveOutput data response from PCE
*/
this.error = error;
}
- /*Send pathComputationRequest request to PCE.
+ /**
+ * Send pathComputationRequest request to PCE.
*
* @return PathComputationRequestOutput data response from PCE
*/
-/*
+/**
* Class for Mapping and Sending
* Service Implemention requests :
* - service implementation
private final ListeningExecutorService executor = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(5));
- /*
+ /**
* MappingAndSendingSIRequest class constructor
* for RPC serviceCreate.
*
.build();
}
- /*
+ /**
* MappingAndSendingSIRequest class constructor
* for RPC serviceReconfigure.
*
}
- /*
+ /**
* MappingAndSendingSIRequest class constructor
* for RPC serviceDelete.
*
LOG.info("ServiceImplementationRequestInput : " + serviceImplementationRequestInput.toString());
}
- /*
+ /**
* Create RxDirection with Port
* information.
*
return result;
}
- /*
+ /**
* Send serviceImplementation request to Render.
*
* @return ServiceImplementationRequestOutput data response from Renderer
}
- /*
+ /**
* Send serviceDelete request to Render.
*
* @return ServiceDeleteOutput data response from Renderer
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/*
+/**
* Class for mapping
* Hard/soft constraint from Service 1.2
* to servicePath 1.4.
private org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
.routing.constraints.rev170426.routing.constraints.sp.SoftConstraints servicePathSoftConstraints;
-
- /*
+ /**
* MappingConstraints class constructor
* for hard/soft from service 1.2.
*
setServiceSoftConstraints(soft);
}
- /*
+ /**
* MappingConstraints class constructor
* for hard/soft from servicePath 1.4.
*
setServicePathSoftConstraints(soft);
}
- /*
+ /**
* map hard/soft constraints from Service 1.2
* to ServicePath 1.4.
*/
import java.util.Map;
-/*
+/**
* Enum class to identify ServiceAEnd / serviceZEnd.
*
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
VALUE_MAP = b.build();
}
- /*
+ /**
* Get integer value.
*
* @return integer value.
return value;
}
- /*
+ /**
* Get Endpoint value.
*
* @param valueArg
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/*
+/**
* Class for checking service sdnc-request-header compliancy.
*
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
/* Response message from procedure. */
private String message;
- /*
+ /**
* ServicehandlerCompliancyCheck class constructor.
*
* @param sdncRequestHeader
this.setMessage("");
}
- /*
+ /**
* ServicehandlerCompliancyCheck class constructor.
*
* @param sdncRequestHeader
this.setMessage("");
}
- /*
+ /**
* ServicehandlerCompliancyCheck class constructor.
*
* @param serviceName
this.setMessage("");
}
- /*
+ /**
* ServicehandlerCompliancyCheck class constructor.
*
* @param serviceName
this.setMessage("");
}
- /*
+ /**
* Check if a String is not null and not equal to void.
*
* @param value
}
- /*
+ /**
* Check Compliancy of Service request.
*
* @param contype
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/*
+/**
* Class for checking missing info on Tx/Rx for A/Z end.
*
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
/* type serviceEndpoint : serviceAEnd / serviceZEnd. */
private String service = null;
- /*
+ /**
* ServicehandlerTxRxCheck class constructor.
*
* @param endPoint
}
}
- /*
+ /**
* Check if a String is not null and not equal to ''.
*
* @param value
}
- /*
+ /**
* check if Port info is compliant.
*
* @param port
}
- /*
+ /**
* Check if lgx info is compliant.
*
* @param lgx
return result;
}
- /*
+ /**
* Check if Tx/Rx Direction complaincy info.
*
* @param txDirection
return result;
}
- /*
+ /**
* Check Compliancy of Service TxRx info.
*
* @return true if String ok false if not
import org.slf4j.LoggerFactory;
-/*
- * Class to implement ServicehandlerService & ServicehandlerListener.
+/**
+ * Class to implement ServicehandlerService and ServicehandlerListener.
*
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
*
LOG.info("checking Service Compliancy ...");
/*
- * Upon receipt of service-create RPC, service header and sdnc-request
- * header compliancy are verified.
+ * Upon receipt of service
+ * -create RPC, service header and sdnc
+ * -request header compliancy are verified.
*/
compliancyCheck = new ServicehandlerCompliancyCheck(input.getSdncRequestHeader(), input.getServiceName(),
input.getConnectionType(), RpcActions.ServiceCreate);
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/*
+/**
* Class to register
* Servicehandler Service and Notification.
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
this.notificationPublishService = notificationPublishService;
}
- /*
+ /**
* Method called when the blueprint container is created.
*/
public void init() {
rpcRegistration = rpcRegistry.addRpcImplementation(ServicehandlerService.class, consumer);
}
- /*
+ /**
* Method called when the blueprint container is destroyed.
*/
public void close() {
import org.slf4j.LoggerFactory;
-/*
+/**
* Class to check RPCs Compliancy.
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
*
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/*
+/**
* Class for Sending
* PCE requests :
* - path-computation-request
import org.slf4j.LoggerFactory;
-/*
+/**
* Class to implement
* StubpceService
* StubpceListener.
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/*
+/**
* Class to register
- * Stubpce Service & Notification.
+ * Stubpce Service and Notification.
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
*
*/
this.notificationPublishService = notificationPublishService;
}
- /*
+ /**
* Method called when the blueprint container is created.
*/
public void init() {
rpcRegistration = rpcRegistry.addRpcImplementation(StubpceService.class, consumer);
}
- /*
+ /**
* Method called when the blueprint container is destroyed.
*/
public void close() {
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/*
- *Class for Sending
- * Renderer requests :
+/**
+ * Class for Sending Renderer requests :
* - Service-implementation-request
* - Service-delete-request.
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
import org.slf4j.LoggerFactory;
-/*
+/**
* Class to implement StubrendererService.
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
*
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/*
- *Class to register Stubrenderer Service & Notification.
+/**
+ * Class to register Stubrenderer Service and Notification.
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
*
*/
this.notificationPublishService = notificationPublishService;
}
- /*
+ /**
* Method called when the blueprint container is created.
*/
public void init() {
rpcRegistration = rpcRegistry.addRpcImplementation(StubrendererService.class, consumer);
}
- /*
+ /**
* Method called when the blueprint container is destroyed.
*/
public void close() {