<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-api</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-artifacts</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<dependencyManagement>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-common</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>7.0.3</version>
+ <version>7.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-dmaap-client</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<description>client to send message to Dmaap message router</description>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>features-transportpce</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>feature</packaging>
<name>OpenDaylight :: TransportPCE :: Features</name>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>odl-transportpce-dmaap-client</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>feature</packaging>
<name>OpenDaylight :: transportpce :: dmaap-client</name>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>odl-transportpce-inventory</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>feature</packaging>
<name>OpenDaylight :: transportpce :: Inventory</name>
<properties>
<mdsal.version>13.0.1</mdsal.version>
- <netconf.version>7.0.3</netconf.version>
+ <netconf.version>7.0.4</netconf.version>
<transportpce.models.version>20.0.0-SNAPSHOT</transportpce.models.version>
<transportpce.db.host>localhost:3306</transportpce.db.host>
<transportpce.db.database>transportpce</transportpce.db.database>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>odl-transportpce-nbinotifications</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>feature</packaging>
<name>OpenDaylight :: transportpce :: nbinotifications</name>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>odl-transportpce-tapi</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>feature</packaging>
<name>OpenDaylight :: transportpce :: tapi</name>
<properties>
<mdsal.version>13.0.1</mdsal.version>
- <netconf.version>7.0.3</netconf.version>
+ <netconf.version>7.0.4</netconf.version>
<transportpce.models.version>20.0.0-SNAPSHOT</transportpce.models.version>
<skip.karaf.featureTest>false</skip.karaf.featureTest>
</properties>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>odl-transportpce</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>feature</packaging>
<name>OpenDaylight :: transportpce</name>
<properties>
- <netconf.version>7.0.3</netconf.version>
+ <netconf.version>7.0.4</netconf.version>
<transportpce.models.version>20.0.0-SNAPSHOT</transportpce.models.version>
<configfile.directory>etc/opendaylight/karaf</configfile.directory>
<skip.karaf.featureTest>false</skip.karaf.featureTest>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>features-aggregator</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
<packaging>pom</packaging>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-inventory</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>7.0.3</version>
+ <version>7.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-karaf</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
<groupId>io.lighty.controllers</groupId>
<artifactId>tpce</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<application.main.class>io.lighty.controllers.tpce.Main</application.main.class>
<application.attach.zip>true</application.attach.zip>
<maven.deploy.skip>true</maven.deploy.skip>
- <transportpce.version>9.0.0-SNAPSHOT</transportpce.version>
+ <transportpce.version>10.0.0-SNAPSHOT</transportpce.version>
<transportpce.models.version>20.0.0-SNAPSHOT</transportpce.models.version>
</properties>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-nbinotifications</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-networkmodel</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>7.0.3</version>
+ <version>7.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-olm</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-pce</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-aggregator</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<name>transportpce</name>
<packaging>pom</packaging>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-renderer</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-servicehandler</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-tapi</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>7.0.3</version>
+ <version>7.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
-import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.transportpce.common.InstanceIdentifiers;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.node.TerminationPoint;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev221121.AdministrativeState;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev221121.Context;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev221121.LayerProtocolName;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev221121.LifecycleState;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev221121.OperationalState;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.node.NodeRuleGroupKey;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.node.OwnedNodeEdgePoint;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.node.OwnedNodeEdgePointKey;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.node.rule.group.NodeEdgePointBuilder;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.node.rule.group.Rule;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.node.rule.group.RuleBuilder;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.node.rule.group.RuleKey;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.LinkKey;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.NodeBuilder;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.NodeKey;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.context.Topology;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.context.TopologyBuilder;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.context.TopologyKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
import org.opendaylight.yangtools.yang.common.ErrorType;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
@Override
public ListenableFuture<RpcResult<GetTopologyDetailsOutput>> invoke(GetTopologyDetailsInput input) {
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.context.Topology topology;
- Uuid topologyUuidFull = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER.getBytes(
- Charset.forName("UTF-8"))).toString());
- if (input.getTopologyId().equals(topologyUuidFull)) {
- Context context = this.tapiContext.getTapiContext();
- Map<TopologyKey,
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.context.Topology>
- topologyMap = context.augmentation(Context1.class).getTopologyContext().getTopology();
+ var topoId = input.getTopologyId();
+ Uuid topologyUuidFull = new Uuid(UUID.nameUUIDFromBytes(
+ TapiStringConstants.T0_FULL_MULTILAYER.getBytes(Charset.forName("UTF-8")))
+ .toString());
+ if (topologyUuidFull.equals(topoId)) {
+ Map<TopologyKey, Topology> topologyMap =
+ this.tapiContext.getTapiContext().augmentation(Context1.class).getTopologyContext().getTopology();
if (topologyMap == null || !topologyMap.containsKey(new TopologyKey(topologyUuidFull))) {
- LOG.error("Topology {} not found in datastore", input.getTopologyId());
+ LOG.error("Topology {} not found in datastore", topoId);
return RpcResultBuilder.<GetTopologyDetailsOutput>failed()
.withError(ErrorType.RPC, "Invalid Topology name")
.buildFuture();
}
- topology = topologyMap.get(new TopologyKey(input.getTopologyId()));
- return RpcResultBuilder.success(new GetTopologyDetailsOutputBuilder()
- .setTopology(this.topologyUtils.transformTopology(topology))
- .build())
+ return RpcResultBuilder
+ .success(
+ new GetTopologyDetailsOutputBuilder()
+ .setTopology(
+ this.topologyUtils.transformTopology(
+ topologyMap.get(new TopologyKey(topoId))))
+ .build())
.buildFuture();
}
- Uuid topologyUuidTapiAbs = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_TAPI_MULTILAYER.getBytes(
- Charset.forName("UTF-8"))).toString());
- if (input.getTopologyId().equals(topologyUuidTapiAbs)) {
+ if (new Uuid(UUID.nameUUIDFromBytes(
+ TapiStringConstants.T0_TAPI_MULTILAYER.getBytes(Charset.forName("UTF-8")))
+ .toString())
+ .equals(topoId)) {
try {
- LOG.info("Building TAPI Topology abstraction for {}", input.getTopologyId());
- topology = createAbsTopologyFromTapiTopo();
- return RpcResultBuilder.success(new GetTopologyDetailsOutputBuilder()
- .setTopology(this.topologyUtils.transformTopology(topology)).build())
+ LOG.info("Building TAPI Topology abstraction for {}", topoId);
+ return RpcResultBuilder
+ .success(
+ new GetTopologyDetailsOutputBuilder()
+ .setTopology(this.topologyUtils.transformTopology(createAbsTopologyFromTapiTopo()))
+ .build())
.buildFuture();
} catch (TapiTopologyException e) {
LOG.error("error building TAPI topology");
.buildFuture();
}
}
- Uuid topologyUuid100G = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.TPDR_100G.getBytes(
- Charset.forName("UTF-8"))).toString());
- Uuid topologyUuidAbs = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_MULTILAYER.getBytes(
- Charset.forName("UTF-8"))).toString());
- if (topologyUuid100G.equals(input.getTopologyId()) || topologyUuidAbs.equals(input.getTopologyId())) {
- try {
- LOG.info("Building TAPI Topology abstraction for {}", input.getTopologyId());
- topology = createAbstractedOtnTopology();
- if (input.getTopologyId().equals(topologyUuidAbs)) {
- return RpcResultBuilder.success(new GetTopologyDetailsOutputBuilder()
- .setTopology(this.topologyUtils.transformTopology(topology)).build())
- .buildFuture();
- }
- topology = createAbstracted100GTpdrTopology(topology);
- return RpcResultBuilder.success(new GetTopologyDetailsOutputBuilder()
- .setTopology(this.topologyUtils.transformTopology(topology)).build())
+ try {
+ if (new Uuid(UUID.nameUUIDFromBytes(
+ TapiStringConstants.T0_MULTILAYER.getBytes(Charset.forName("UTF-8")))
+ .toString())
+ .equals(topoId)) {
+ LOG.info("Building TAPI Topology abstraction for {}", topoId);
+ return RpcResultBuilder
+ .success(
+ new GetTopologyDetailsOutputBuilder()
+ .setTopology(this.topologyUtils.transformTopology(createAbstractedOtnTopology()))
+ .build())
.buildFuture();
- } catch (TapiTopologyException e) {
- LOG.error("error building TAPI topology");
- return RpcResultBuilder.<GetTopologyDetailsOutput>failed()
- .withError(ErrorType.RPC, "Error building topology")
+ }
+ if (new Uuid(UUID.nameUUIDFromBytes(
+ TapiStringConstants.TPDR_100G.getBytes(Charset.forName("UTF-8")))
+ .toString())
+ .equals(topoId)) {
+ LOG.info("Building TAPI Topology abstraction for {}", topoId);
+ return RpcResultBuilder
+ .success(
+ new GetTopologyDetailsOutputBuilder()
+ .setTopology(
+ this.topologyUtils.transformTopology(
+ createAbstracted100GTpdrTopology(createAbstractedOtnTopology())))
+ .build())
.buildFuture();
}
+ return RpcResultBuilder.<GetTopologyDetailsOutput>failed()
+ .withError(ErrorType.RPC, "Invalid Topology name")
+ .buildFuture();
+ } catch (TapiTopologyException e) {
+ LOG.error("error building TAPI topology");
+ return RpcResultBuilder.<GetTopologyDetailsOutput>failed()
+ .withError(ErrorType.RPC, "Error building topology")
+ .buildFuture();
}
- return RpcResultBuilder.<GetTopologyDetailsOutput>failed()
- .withError(ErrorType.RPC, "Invalid Topology name")
- .buildFuture();
}
- public org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.context.Topology
- createAbstracted100GTpdrTopology(org.opendaylight.yang.gen.v1.urn
- .onf.otcc.yang.tapi.topology.rev221121.topology.context.Topology topology) {
- List<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.Node> dsrNodes = topology
- .nonnullNode().values().stream()
- .filter(node -> node.getLayerProtocolName().contains(LayerProtocolName.DSR))
- .collect(Collectors.toList());
+ public Topology createAbstracted100GTpdrTopology(Topology topology) {
List<OwnedNodeEdgePoint> nep100GTpdrList = new ArrayList<>();
- for (org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.Node node2 : dsrNodes) {
+ for (org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.Node node2 :
+ topology.nonnullNode().values().stream()
+ .filter(node -> node.getLayerProtocolName().contains(LayerProtocolName.DSR))
+ .collect(Collectors.toList())) {
List<OwnedNodeEdgePoint> nepList = node2.getOwnedNodeEdgePoint().values().stream()
.filter(nep -> nep.getName().containsKey(new NameKey("100G-tpdr")))
.collect(Collectors.toList());
nep100GTpdrList.addAll(nepList);
}
- Name topoName = new NameBuilder().setValue(TapiStringConstants.TPDR_100G).setValueName("TAPI Topology Name")
+ Name topoName = new NameBuilder()
+ .setValue(TapiStringConstants.TPDR_100G)
+ .setValueName("TAPI Topology Name")
.build();
- Uuid topoUuid = new Uuid(
- UUID.nameUUIDFromBytes(TapiStringConstants.TPDR_100G.getBytes(Charset.forName("UTF-8"))).toString());
+ Uuid topoUuid = new Uuid(UUID.nameUUIDFromBytes(
+ TapiStringConstants.TPDR_100G.getBytes(Charset.forName("UTF-8")))
+ .toString());
org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.Node node =
- createTapiNode(nep100GTpdrList, topoUuid);
- return new org.opendaylight.yang.gen.v1.urn
- .onf.otcc.yang.tapi.topology.rev221121.topology.context.TopologyBuilder()
- .setName(Map.of(topoName.key(), topoName)).setUuid(topoUuid).setNode(Map.of(node.key(), node))
- .setLayerProtocolName(Set.of(LayerProtocolName.DSR, LayerProtocolName.ETH)).build();
+ createTapiNode(nep100GTpdrList, topoUuid);
+ return new TopologyBuilder()
+ .setName(Map.of(topoName.key(), topoName))
+ .setUuid(topoUuid)
+ .setNode(Map.of(node.key(), node))
+ .setLayerProtocolName(Set.of(LayerProtocolName.DSR, LayerProtocolName.ETH))
+ .build();
}
- public org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.context.Topology
- createAbstractedOtnTopology() throws TapiTopologyException {
+ public Topology createAbstractedOtnTopology() throws TapiTopologyException {
// read openroadm-topology
Network openroadmTopo = readTopology(InstanceIdentifiers.OVERLAY_NETWORK_II);
List<Link> linkList = new ArrayList<>();
= new HashMap<>();
Map<LinkKey, org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.Link> tapiLinkList
= new HashMap<>();
- Uuid topoUuid = new Uuid(UUID
- .nameUUIDFromBytes(TapiStringConstants.T0_MULTILAYER.getBytes(Charset.forName("UTF-8"))).toString());
+ Uuid topoUuid = new Uuid(UUID.nameUUIDFromBytes(
+ TapiStringConstants.T0_MULTILAYER.getBytes(Charset.forName("UTF-8")))
+ .toString());
ConvertORTopoToTapiTopo tapiAbstractFactory = new ConvertORTopoToTapiTopo(topoUuid, this.tapiLink);
ConvertORToTapiTopology tapiFactory = new ConvertORToTapiTopology(topoUuid);
Iterator<Entry<String, List<String>>> it = networkPortMap.entrySet().iterator();
LOG.warn("Unable to abstract an ROADM infrasctructure from openroadm-topology");
}
if (otnTopo.augmentation(Network1.class) != null) {
- Map<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
- .ietf.network.topology.rev180226.networks.network.LinkKey, Link> otnLinkMap =
- otnTopo.augmentation(Network1.class).getLink();
- tapiAbstractFactory.convertLinks(otnLinkMap);
+ tapiAbstractFactory.convertLinks(otnTopo.augmentation(Network1.class).getLink());
tapiLinkList.putAll(tapiAbstractFactory.getTapiLinks());
}
- Name name = new NameBuilder().setValue(TapiStringConstants.T0_MULTILAYER).setValueName("TAPI Topology Name")
- .build();
- LOG.info("TOPOABSTRACTED : the list of node is as follows {}", tapiNodeList.toString());
+ Name name = new NameBuilder().setValue(
+ TapiStringConstants.T0_MULTILAYER).setValueName("TAPI Topology Name")
+ .build();
+ LOG.info("TOPOABSTRACTED : the list of node is as follows {}", tapiNodeList);
this.tapiSips.putAll(tapiAbstractFactory.getTapiSips());
- return new org.opendaylight.yang.gen.v1.urn
- .onf.otcc.yang.tapi.topology.rev221121.topology.context.TopologyBuilder()
- .setName(Map.of(name.key(), name)).setUuid(topoUuid).setNode(tapiNodeList)
+ return new TopologyBuilder()
+ .setName(Map.of(name.key(), name))
+ .setUuid(topoUuid)
+ .setNode(tapiNodeList)
.setLayerProtocolName(Set.of(LayerProtocolName.PHOTONICMEDIA, LayerProtocolName.DIGITALOTN))
.setLink(tapiLinkList)
.build();
}
- public org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.context.Topology
- createAbsTopologyFromTapiTopo() throws TapiTopologyException {
- Uuid refTopoUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER
- .getBytes(Charset.forName("UTF-8"))).toString());
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.context.Topology tapiFullTopo =
+ public Topology createAbsTopologyFromTapiTopo() throws TapiTopologyException {
+ Uuid refTopoUuid = new Uuid(UUID.nameUUIDFromBytes(
+ TapiStringConstants.T0_FULL_MULTILAYER.getBytes(Charset.forName("UTF-8")))
+ .toString());
+ Topology tapiFullTopo =
this.tapiContext
.getTopologyContext().entrySet().stream().filter(topo -> topo.getKey().getUuid().equals(refTopoUuid))
.findAny().orElseThrow().getValue();
absTapiTopo.convertRoadmInfrastructure();
Map<NodeKey, org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.Node>
- tapiNodeList = new HashMap<>();
- Map<LinkKey, org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.Link>
- tapiLinkList = new HashMap<>();
- tapiNodeList.putAll(absTapiTopo.getTapiNodes());
- tapiLinkList.putAll(absTapiTopo.getTapiLinks());
+ tapiNodeList = new HashMap<>(absTapiTopo.getTapiNodes());
+ LOG.info("ABSTRACTED TAPI TOPOLOGY : the list of node is as follows {}", tapiNodeList);
Name name = new NameBuilder()
.setValue(TapiStringConstants.T0_MULTILAYER)
.setValueName("TAPI Topology Name")
.build();
- Uuid topoUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_TAPI_MULTILAYER
- .getBytes(Charset.forName("UTF-8"))).toString());
- LOG.info("ABSTRACTED TAPI TOPOLOGY : the list of node is as follows {}", tapiNodeList);
- return new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.context
- .TopologyBuilder()
+ return new TopologyBuilder()
.setName(Map.of(name.key(), name))
- .setUuid(topoUuid)
+ .setUuid(
+ new Uuid(UUID.nameUUIDFromBytes(
+ TapiStringConstants.T0_TAPI_MULTILAYER.getBytes(Charset.forName("UTF-8")))
+ .toString()))
.setNode(tapiNodeList)
.setLayerProtocolName(Set.of(LayerProtocolName.PHOTONICMEDIA, LayerProtocolName.DIGITALOTN))
- .setLink(tapiLinkList)
+ .setLink(new HashMap<>(absTapiTopo.getTapiLinks()))
.build();
}
onepMap.put(ownedNodeEdgePoint.key(), ownedNodeEdgePoint);
}
Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes(name.getValue().getBytes(Charset.forName("UTF-8"))).toString());
- return new NodeBuilder().setUuid(nodeUuid).setName(Map.of(name.key(), name))
+ return new NodeBuilder()
+ .setUuid(nodeUuid)
+ .setName(Map.of(name.key(), name))
.setLayerProtocolName(Set.of(LayerProtocolName.ETH))
- .setAdministrativeState(AdministrativeState.UNLOCKED).setOperationalState(OperationalState.ENABLED)
- .setLifecycleState(LifecycleState.INSTALLED).setOwnedNodeEdgePoint(onepMap)
- .setNodeRuleGroup(createNodeRuleGroupFor100gTpdrNode(topoUuid, nodeUuid, nepList)).build();
+ .setAdministrativeState(AdministrativeState.UNLOCKED)
+ .setOperationalState(OperationalState.ENABLED)
+ .setLifecycleState(LifecycleState.INSTALLED)
+ .setOwnedNodeEdgePoint(onepMap)
+ .setNodeRuleGroup(createNodeRuleGroupFor100gTpdrNode(topoUuid, nodeUuid, nepList))
+ .build();
}
- private boolean checkTp(String nodeIdTopo, String nodeIdPortMap, TerminationPoint tp, List<Link> xpdOut,
- List<Link> xpdIn) {
- String networkLcp;
- if (tp.augmentation(TerminationPoint1.class).getTpType().equals(OpenroadmTpType.XPONDERCLIENT)) {
- networkLcp = tp.augmentation(
+ private boolean checkTp(
+ String nodeIdTopo, String nodeIdPortMap, TerminationPoint tp, List<Link> xpdOut, List<Link> xpdIn) {
+ String networkLcp =
+ tp.augmentation(TerminationPoint1.class).getTpType().equals(OpenroadmTpType.XPONDERCLIENT)
+ ? tp.augmentation(
org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.TerminationPoint1.class)
- .getAssociatedConnectionMapTp().iterator().next().getValue();
- } else {
- networkLcp = tp.getTpId().getValue();
+ .getAssociatedConnectionMapTp().iterator().next().getValue()
+ : tp.getTpId().getValue();
+ ListenableFuture<Optional<Mapping>> mappingOpt =
+ networkTransactionService.read(
+ LogicalDatastoreType.CONFIGURATION,
+ InstanceIdentifier.create(
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev231221.Network.class)
+ .child(Nodes.class, new NodesKey(nodeIdPortMap))
+ .child(Mapping.class, new MappingKey(networkLcp)));
+ if (!mappingOpt.isDone()) {
+ LOG.error("Impossible to get mapping of associated network port {} of tp {}",
+ networkLcp, tp.getTpId().getValue());
+ return false;
}
- @NonNull
- KeyedInstanceIdentifier<Mapping, MappingKey> pmIID = InstanceIdentifier.create(
- org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev231221.Network.class)
- .child(Nodes.class, new NodesKey(nodeIdPortMap)).child(Mapping.class, new MappingKey(networkLcp));
- ListenableFuture<Optional<Mapping>> mappingOpt = networkTransactionService
- .read(LogicalDatastoreType.CONFIGURATION, pmIID);
- Mapping mapping = null;
- if (mappingOpt.isDone()) {
- try {
- mapping = mappingOpt.get().orElseThrow();
- } catch (InterruptedException | ExecutionException e) {
- LOG.error("Error getting mapping for {}", networkLcp, e);
- return false;
- }
- } else {
- LOG.error("Impossible to get mapping of associated network port {} of tp {}", networkLcp,
- tp.getTpId().getValue());
+ Mapping mapping;
+ try {
+ mapping = mappingOpt.get().orElseThrow();
+ } catch (InterruptedException | ExecutionException e) {
+ LOG.error("Error getting mapping for {}", networkLcp, e);
return false;
}
- String networkPortDirection = mapping.getPortDirection();
long count = 0;
- switch (networkPortDirection) {
+ switch (mapping.getPortDirection()) {
case "bidirectional":
count += xpdOut.stream().filter(lk -> lk.getSource().getSourceNode().getValue().equals(nodeIdTopo)
&& lk.getSource().getSourceTp().getValue().equals(networkLcp)).count();
count += xpdIn.stream().filter(lk -> lk.getDestination().getDestNode().getValue().equals(nodeIdTopo)
&& lk.getDestination().getDestTp().getValue().equals(networkLcp)).count();
- return (count == 2);
+ return count == 2;
case "tx":
case "rx":
@Nullable
count += xpdOut.stream().filter(lk -> lk.getSource().getSourceNode().getValue().equals(nodeIdTopo)
&& lk.getSource().getSourceTp().getValue().equals(partnerLcp)).count();
}
- return (count == 2);
+ return count == 2;
default:
LOG.error("Invalid port direction for {}", networkLcp);
return false;
}
}
- private Map<NodeRuleGroupKey, NodeRuleGroup> createNodeRuleGroupFor100gTpdrNode(Uuid topoUuid, Uuid nodeUuid,
- Collection<OwnedNodeEdgePoint> onepl) {
-
+ private Map<NodeRuleGroupKey, NodeRuleGroup> createNodeRuleGroupFor100gTpdrNode(
+ Uuid topoUuid, Uuid nodeUuid, Collection<OwnedNodeEdgePoint> onepl) {
Map<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.node.rule.group.NodeEdgePointKey,
org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.node.rule.group.NodeEdgePoint> nepMap
= new HashMap<>();
for (OwnedNodeEdgePoint onep : onepl) {
- var nep = new org.opendaylight.yang.gen.v1.urn
- .onf.otcc.yang.tapi.topology.rev221121.node.rule.group.NodeEdgePointBuilder()
+ var nep = new NodeEdgePointBuilder()
.setTopologyUuid(topoUuid)
.setNodeUuid(nodeUuid)
.setNodeEdgePointUuid(onep.key().getUuid())
.build();
nepMap.put(nep.key(), nep);
}
- Map<NodeRuleGroupKey, NodeRuleGroup> nodeRuleGroupMap = new HashMap<>();
- Map<RuleKey, Rule> ruleList = new HashMap<>();
- Set<RuleType> ruleTypes = new HashSet<>();
- ruleTypes.add(RuleType.FORWARDING);
- Rule rule = new RuleBuilder().setLocalId("forward").setForwardingRule(FORWARDINGRULEMAYFORWARDACROSSGROUP.VALUE)
- .setRuleType(ruleTypes).build();
- ruleList.put(rule.key(), rule);
- NodeRuleGroup nodeRuleGroup = new NodeRuleGroupBuilder().setUuid(new Uuid(
- UUID.nameUUIDFromBytes(("rdm infra node rule group").getBytes(Charset.forName("UTF-8"))).toString()))
- .setRule(ruleList).setNodeEdgePoint(nepMap).build();
- nodeRuleGroupMap.put(nodeRuleGroup.key(), nodeRuleGroup);
- return nodeRuleGroupMap;
+ Rule rule = new RuleBuilder()
+ .setLocalId("forward")
+ .setForwardingRule(FORWARDINGRULEMAYFORWARDACROSSGROUP.VALUE)
+ .setRuleType(new HashSet<RuleType>(Set.of(RuleType.FORWARDING)))
+ .build();
+ NodeRuleGroup nodeRuleGroup = new NodeRuleGroupBuilder()
+ .setUuid(new Uuid(UUID.nameUUIDFromBytes(
+ ("rdm infra node rule group").getBytes(Charset.forName("UTF-8")))
+ .toString()))
+ .setRule(new HashMap<RuleKey, Rule>(Map.of(rule.key(), rule)))
+ .setNodeEdgePoint(nepMap)
+ .build();
+ return new HashMap<NodeRuleGroupKey, NodeRuleGroup>(Map.of(nodeRuleGroup.key(), nodeRuleGroup));
}
}
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.photonic.media.rev221121.PHOTONICLAYERQUALIFIEROMS;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.photonic.media.rev221121.PHOTONICLAYERQUALIFIEROTS;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.photonic.media.rev221121.PHOTONICLAYERQUALIFIEROTSiMC;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.node.InterRuleGroup;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.node.InterRuleGroupKey;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.node.NodeRuleGroup;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.node.NodeRuleGroupKey;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.node.OwnedNodeEdgePoint;
List<String> linksToNotConvert = new ArrayList<>();
LOG.info("creation of {} roadm to roadm links", rdmTordmLinkList.size() / 2);
for (var link : rdmTordmLinkList) {
- if (!linksToNotConvert.contains(link.getLinkId().getValue())) {
- var oppositeLink = rdmTordmLinkList.stream()
- .filter(l -> l.getLinkId().equals(link.augmentation(Link1.class).getOppositeLink()))
- .findAny().orElse(null);
- AdminStates oppLnkAdmState = null;
- State oppLnkOpState = null;
- if (oppositeLink != null) {
- oppLnkAdmState = oppositeLink.augmentation(Link1.class).getAdministrativeState();
- oppLnkOpState = oppositeLink.augmentation(Link1.class).getOperationalState();
- }
-
- Link tapLink = this.tapiLink.createTapiLink(
- String.join("-",
- link.getSource().getSourceNode().getValue().split("-")[0],
- link.getSource().getSourceNode().getValue().split("-")[1]),
- link.getSource().getSourceTp().getValue(),
- String.join("-",
- link.getDestination().getDestNode().getValue().split("-")[0],
- link.getDestination().getDestNode().getValue().split("-")[1]),
- link.getDestination().getDestTp().getValue(), TapiStringConstants.OMS_RDM_RDM_LINK,
- TapiStringConstants.PHTNC_MEDIA, TapiStringConstants.PHTNC_MEDIA,
- TapiStringConstants.PHTNC_MEDIA_OTS, TapiStringConstants.PHTNC_MEDIA_OTS,
- //adminState,
- link.augmentation(Link1.class).getAdministrativeState() == null || oppLnkAdmState == null
- ? null
- : this.tapiLink.setTapiAdminState(
- link.augmentation(Link1.class).getAdministrativeState(), oppLnkAdmState).getName(),
- //operState,
- link.augmentation(Link1.class).getOperationalState() == null || oppLnkOpState == null
- ? null
- : this.tapiLink.setTapiOperationalState(
- link.augmentation(Link1.class).getOperationalState(), oppLnkOpState).getName(),
- Set.of(LayerProtocolName.PHOTONICMEDIA), Set.of(LayerProtocolName.PHOTONICMEDIA.getName()),
- this.tapiTopoUuid);
- linksToNotConvert.add(link.augmentation(Link1.class).getOppositeLink().getValue());
- tapiLinks.put(tapLink.key(), tapLink);
+ if (linksToNotConvert.contains(link.getLinkId().getValue())) {
+ continue;
}
+ var lnk1 = link.augmentation(Link1.class);
+ var lnk1OppLnk = lnk1.getOppositeLink();
+ var oppositeLink = rdmTordmLinkList.stream()
+ .filter(l -> l.getLinkId().equals(lnk1OppLnk))
+ .findAny().orElse(null);
+ AdminStates oppLnkAdmState = null;
+ State oppLnkOpState = null;
+ if (oppositeLink != null) {
+ oppLnkAdmState = oppositeLink.augmentation(Link1.class).getAdministrativeState();
+ oppLnkOpState = oppositeLink.augmentation(Link1.class).getOperationalState();
+ }
+ var linkSrc = link.getSource();
+ String linkSrcNodeValue = linkSrc.getSourceNode().getValue();
+ var linkDst = link.getDestination();
+ String linkDstNodeValue = linkDst.getDestNode().getValue();
+ var lnkAdmState = lnk1.getAdministrativeState();
+ var lnkOpState = lnk1.getOperationalState();
+ Link tapLink = this.tapiLink.createTapiLink(
+ String.join("-", linkSrcNodeValue.split("-")[0], linkSrcNodeValue.split("-")[1]),
+ linkSrc.getSourceTp().getValue(),
+ String.join("-", linkDstNodeValue.split("-")[0], linkDstNodeValue.split("-")[1]),
+ linkDst.getDestTp().getValue(),
+ TapiStringConstants.OMS_RDM_RDM_LINK,
+ TapiStringConstants.PHTNC_MEDIA,
+ TapiStringConstants.PHTNC_MEDIA,
+ TapiStringConstants.PHTNC_MEDIA_OTS,
+ TapiStringConstants.PHTNC_MEDIA_OTS,
+ //adminState,
+ lnkAdmState == null || oppLnkAdmState == null
+ ? null : this.tapiLink.setTapiAdminState(lnkAdmState, oppLnkAdmState).getName(),
+ //operState,
+ lnkOpState == null || oppLnkOpState == null
+ ? null : this.tapiLink.setTapiOperationalState(lnkOpState, oppLnkOpState).getName(),
+ Set.of(LayerProtocolName.PHOTONICMEDIA),
+ Set.of(LayerProtocolName.PHOTONICMEDIA.getName()),
+ this.tapiTopoUuid);
+ linksToNotConvert.add(lnk1OppLnk.getValue());
+ tapiLinks.put(tapLink.key(), tapLink);
}
}
int numSips = 0;
List<Node> nodeList = new ArrayList<Node>(openroadmTopo.getNode().values());
for (Node node:nodeList) {
+ String nodeId = node.getNodeId().getValue();
if (node.getSupportingNode().values().stream()
.noneMatch(sp -> sp.getNodeRef().getValue().equals(this.ietfNodeId))) {
- LOG.debug("Abstracted node {} is not part of {}", node.getNodeId().getValue(), this.ietfNodeId);
+ LOG.debug("Abstracted node {} is not part of {}", nodeId, this.ietfNodeId);
continue;
}
- if (node.augmentation(Node1.class) == null
- && node.augmentation(
- org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226
- .Node1.class) == null) {
- LOG.warn("Abstracted node {} doesnt have type of node or is not disaggregated",
- node.getNodeId().getValue());
+ var node1 = node.augmentation(
+ org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1.class);
+ if (node.augmentation(Node1.class) == null && node1 == null) {
+ LOG.warn("Abstracted node {} doesnt have type of node or is not disaggregated", nodeId);
continue;
}
OpenroadmNodeType nodeType = node.augmentation(
org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.Node1.class)
.getNodeType();
- var node1 = node.augmentation(
- org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1.class);
- LOG.info("TPs of node: {}", node1.getTerminationPoint().values());
+ var node1TpValues = node1.getTerminationPoint().values();
+ LOG.info("TPs of node: {}", node1TpValues);
switch (nodeType.getIntValue()) {
case 11:
LOG.info("Degree node");
// Get only external TPs of the degree
- List<TerminationPoint> degPortList = node1.getTerminationPoint().values().stream()
+ List<TerminationPoint> degPortList = node1TpValues.stream()
.filter(tp -> tp.augmentation(TerminationPoint1.class).getTpType().getIntValue()
== OpenroadmTpType.DEGREETXRXTTP.getIntValue()
|| tp.augmentation(TerminationPoint1.class).getTpType().getIntValue()
== OpenroadmTpType.DEGREETXTTP.getIntValue())
.collect(Collectors.toList());
// Convert TP List in NEPs and put it in onepl
- LOG.info("Degree port List: {}", degPortList.toString());
+ LOG.info("Degree port List: {}", degPortList);
// TODO: deg port could be sip. e.g. MDONS
- oneplist.putAll(populateNepsForRdmNode(node.getNodeId().getValue(), degPortList, false,
- TapiStringConstants.PHTNC_MEDIA_OTS));
- oneplist.putAll(populateNepsForRdmNode(node.getNodeId().getValue(), degPortList, false,
- TapiStringConstants.PHTNC_MEDIA_OMS));
+ oneplist.putAll(populateNepsForRdmNode(
+ nodeId, degPortList, false, TapiStringConstants.PHTNC_MEDIA_OTS));
+ oneplist.putAll(populateNepsForRdmNode(
+ nodeId, degPortList, false, TapiStringConstants.PHTNC_MEDIA_OMS));
numNeps += degPortList.size() * 2;
break;
case 12:
LOG.info("SRG node");
// Get only external TPs of the srg
- List<TerminationPoint> srgPortList = node1.getTerminationPoint().values().stream()
+ List<TerminationPoint> srgPortList = node1TpValues.stream()
.filter(tp -> tp.augmentation(TerminationPoint1.class).getTpType().getIntValue()
== OpenroadmTpType.SRGTXRXPP.getIntValue()
|| tp.augmentation(TerminationPoint1.class).getTpType().getIntValue()
.collect(Collectors.toList());
// Convert TP List in NEPs and put it in onepl
LOG.info("Srg port List: {}", srgPortList);
- oneplist.putAll(populateNepsForRdmNode(node.getNodeId().getValue(), srgPortList, true,
- TapiStringConstants.PHTNC_MEDIA_OTS));
+ oneplist.putAll(populateNepsForRdmNode(
+ nodeId, srgPortList, true, TapiStringConstants.PHTNC_MEDIA_OTS));
numNeps += srgPortList.size();
numSips += srgPortList.size();
break;
}
// create tapi Node
// UUID
- String nodeIdPhMed = String.join("+", roadm.getNodeId().getValue(), TapiStringConstants.PHTNC_MEDIA);
+ String nodeIdPhMed = String.join("+", this.ietfNodeId, TapiStringConstants.PHTNC_MEDIA);
Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes(nodeIdPhMed.getBytes(Charset.forName("UTF-8"))).toString());
- LOG.info("Creation of PHOTONIC node for {}, of Uuid {}", roadm.getNodeId().getValue(), nodeUuid);
+ LOG.info("Creation of PHOTONIC node for {}, of Uuid {}", this.ietfNodeId, nodeUuid);
// Names
Name nodeNames = new NameBuilder().setValueName("roadm node name").setValue(nodeIdPhMed).build();
Name nameNodeType = new NameBuilder().setValueName("Node Type").setValue(this.ietfNodeType.getName()).build();
- // Protocol Layer
- Set<LayerProtocolName> layerProtocols = Set.of(LayerProtocolName.PHOTONICMEDIA);
// Build tapi node
LOG.debug("CONVERTTOFULL SRG OTSNode of retrieved OnepMap {} ",
- oneplist.entrySet().stream().filter(e -> e.getValue()
- .getSupportedCepLayerProtocolQualifierInstances()
- .contains(new SupportedCepLayerProtocolQualifierInstancesBuilder()
- .setNumberOfCepInstances(Uint64.valueOf(1))
- .setLayerProtocolQualifier(PHOTONICLAYERQUALIFIEROTS.VALUE)
- .build()))
- .collect(Collectors.toList()).toString());
+ oneplist.entrySet().stream()
+ .filter(e -> e.getValue().getSupportedCepLayerProtocolQualifierInstances()
+ .contains(
+ new SupportedCepLayerProtocolQualifierInstancesBuilder()
+ .setNumberOfCepInstances(Uint64.valueOf(1))
+ .setLayerProtocolQualifier(PHOTONICLAYERQUALIFIEROTS.VALUE)
+ .build()))
+ .collect(Collectors.toList()));
//org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.Node
- var roadmNode = createRoadmTapiNode(nodeUuid,
- Map.of(nodeNames.key(), nodeNames, nameNodeType.key(), nameNodeType), layerProtocols, oneplist, "Full");
+ var roadmNode = createRoadmTapiNode(
+ nodeUuid,
+ Map.of(nodeNames.key(), nodeNames, nameNodeType.key(), nameNodeType),
+ // Protocol Layer
+ Set.of(LayerProtocolName.PHOTONICMEDIA),
+ oneplist,
+ "Full");
// TODO add states corresponding to device config
- LOG.info("ROADM node {} should have {} NEPs and {} SIPs", roadm.getNodeId().getValue(), numNeps, numSips);
+ LOG.info("ROADM node {} should have {} NEPs and {} SIPs", this.ietfNodeId, numNeps, numSips);
LOG.info("ROADM node {} has {} NEPs and {} SIPs",
- roadm.getNodeId().getValue(),
+ this.ietfNodeId,
roadmNode.nonnullOwnedNodeEdgePoint().values().size(),
roadmNode.nonnullOwnedNodeEdgePoint().values().stream()
- .filter(nep -> nep.getMappedServiceInterfacePoint() != null).count());
+ .filter(nep -> nep.getMappedServiceInterfacePoint() != null)
+ .count());
tapiNodes.put(roadmNode.key(), roadmNode);
}
for (Node node:nodeList) {
var node1 = node.augmentation(
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1.class);
+ String nodeId = node.getNodeId().getValue();
if (node.augmentation(Node1.class) == null && node1 == null) {
- LOG.warn("Abstracted node {} doesnt have type of node or is not disaggregated",
- node.getNodeId().getValue());
+ LOG.warn("Abstracted node {} doesnt have type of node or is not disaggregated", nodeId);
continue;
}
OpenroadmNodeType nodeType = node.augmentation(
// Only consider ROADMS SRG Nodes
continue;
}
- LOG.debug("Handling SRG node in Topology abstraction {}", node.getNodeId().toString());
+ LOG.debug("Handling SRG node in Topology abstraction {}", nodeId);
// Get only external TPs of the srg
List<TerminationPoint> srgPortList = node1.getTerminationPoint().values().stream()
.filter(tp -> tp.augmentation(TerminationPoint1.class).getTpType().getIntValue()
.collect(Collectors.toList());
// Convert TP List in NEPs and put it in onepl
LOG.debug("Srg port List: {}", srgPortList);
- oneMap.putAll(populateNepsForRdmNode(node.getNodeId().getValue(), srgPortList, true,
- TapiStringConstants.PHTNC_MEDIA_OTS));
+ oneMap.putAll(populateNepsForRdmNode(nodeId, srgPortList, true, TapiStringConstants.PHTNC_MEDIA_OTS));
numNeps += srgPortList.size();
numSips += srgPortList.size();
}
// create a unique ROADM tapi Node
LOG.info("abstraction of the ROADM infrastructure towards a photonic node");
Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes(
- TapiStringConstants.RDM_INFRA.getBytes(Charset.forName("UTF-8"))).toString());
+ TapiStringConstants.RDM_INFRA.getBytes(Charset.forName("UTF-8")))
+ .toString());
Name nodeName =
new NameBuilder().setValueName("roadm node name").setValue(TapiStringConstants.RDM_INFRA).build();
Name nameNodeType =
new NameBuilder().setValueName("Node Type").setValue(OpenroadmNodeType.ROADM.getName()).build();
-
- // Protocol Layer
- Set<LayerProtocolName> layerProtocols = Set.of(LayerProtocolName.PHOTONICMEDIA);
// Build tapi node
org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.Node roadmNode =
- createRoadmTapiNode(nodeUuid, Map.of(nodeName.key(), nodeName, nameNodeType.key(), nameNodeType),
- layerProtocols, oneMap, "Abstracted");
+ createRoadmTapiNode(
+ nodeUuid,
+ Map.of(nodeName.key(), nodeName, nameNodeType.key(), nameNodeType),
+ Set.of(LayerProtocolName.PHOTONICMEDIA),
+ oneMap,
+ "Abstracted");
// TODO add states corresponding to device config
LOG.info("ROADM node {} should have {} NEPs and {} SIPs", TapiStringConstants.RDM_INFRA, numNeps, numSips);
- LOG.info("ROADM node {} has {} NEPs and {} SIPs", TapiStringConstants.RDM_INFRA,
+ LOG.info("ROADM node {} has {} NEPs and {} SIPs",
+ TapiStringConstants.RDM_INFRA,
roadmNode.nonnullOwnedNodeEdgePoint().values().size(),
roadmNode.nonnullOwnedNodeEdgePoint().values().stream()
- .filter(nep -> nep.getMappedServiceInterfacePoint() != null).count());
-
+ .filter(nep -> nep.getMappedServiceInterfacePoint() != null)
+ .count());
tapiNodes.put(roadmNode.key(), roadmNode);
}
- private org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.Node
- createRoadmTapiNode(Uuid nodeUuid, Map<NameKey, Name> nameMap, Set<LayerProtocolName> layerProtocols,
- Map<OwnedNodeEdgePointKey, OwnedNodeEdgePoint> onepMap, String topoMode) {
+ private org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.topology.Node createRoadmTapiNode(
+ Uuid nodeUuid, Map<NameKey, Name> nameMap, Set<LayerProtocolName> layerProtocols,
+ Map<OwnedNodeEdgePointKey, OwnedNodeEdgePoint> onepMap, String topoMode) {
// Empty random creation of mandatory fields for avoiding errors....
- CostCharacteristic costCharacteristic = new CostCharacteristicBuilder()
- .setCostAlgorithm("Restricted Shortest Path - RSP")
- .setCostName("HOP_COUNT")
- .setCostValue(TapiStringConstants.COST_HOP_VALUE)
- .build();
- LatencyCharacteristic latencyCharacteristic = new LatencyCharacteristicBuilder()
- .setFixedLatencyCharacteristic(TapiStringConstants.FIXED_LATENCY_VALUE)
- .setQueuingLatencyCharacteristic(TapiStringConstants.QUEING_LATENCY_VALUE)
- .setJitterCharacteristic(TapiStringConstants.JITTER_VALUE)
- .setWanderCharacteristic(TapiStringConstants.WANDER_VALUE)
- .setTrafficPropertyName("FIXED_LATENCY")
- .build();
- RiskCharacteristic riskCharacteristic = new RiskCharacteristicBuilder()
- .setRiskCharacteristicName("risk characteristic")
- .setRiskIdentifierList(Set.of("risk identifier1", "risk identifier2"))
- .build();
+ CostCharacteristic costCharacteristic =
+ new CostCharacteristicBuilder()
+ .setCostAlgorithm("Restricted Shortest Path - RSP")
+ .setCostName("HOP_COUNT")
+ .setCostValue(TapiStringConstants.COST_HOP_VALUE)
+ .build();
+ LatencyCharacteristic latencyCharacteristic =
+ new LatencyCharacteristicBuilder()
+ .setFixedLatencyCharacteristic(TapiStringConstants.FIXED_LATENCY_VALUE)
+ .setQueuingLatencyCharacteristic(TapiStringConstants.QUEING_LATENCY_VALUE)
+ .setJitterCharacteristic(TapiStringConstants.JITTER_VALUE)
+ .setWanderCharacteristic(TapiStringConstants.WANDER_VALUE)
+ .setTrafficPropertyName("FIXED_LATENCY")
+ .build();
+ RiskCharacteristic riskCharacteristic =
+ new RiskCharacteristicBuilder()
+ .setRiskCharacteristicName("risk characteristic")
+ .setRiskIdentifierList(Set.of("risk identifier1", "risk identifier2"))
+ .build();
var tapiFactory = new ConvertORToTapiTopology(this.tapiTopoUuid);
String choosenMode = topoMode.equals("Full") ? "Full" : "Abstracted";
Map<NodeRuleGroupKey, NodeRuleGroup> nodeRuleGroupMap =
tapiFactory.createAllNodeRuleGroupForRdmNode(choosenMode, nodeUuid, this.ietfNodeId, onepMap.values());
- Map<InterRuleGroupKey, InterRuleGroup> interRuleGroupMap =
- tapiFactory.createInterRuleGroupForRdmNode(choosenMode, nodeUuid, this.ietfNodeId,
- nodeRuleGroupMap.entrySet().stream().map(e -> e.getKey()).collect(Collectors.toList()));
return new NodeBuilder()
.setUuid(nodeUuid)
.setName(nameMap)
.setLifecycleState(LifecycleState.INSTALLED)
.setOwnedNodeEdgePoint(onepMap)
.setNodeRuleGroup(nodeRuleGroupMap)
- .setInterRuleGroup(interRuleGroupMap)
+ .setInterRuleGroup(
+ tapiFactory.createInterRuleGroupForRdmNode(
+ choosenMode, nodeUuid, this.ietfNodeId,
+ nodeRuleGroupMap.entrySet().stream().map(e -> e.getKey()).collect(Collectors.toList())))
.setCostCharacteristic(Map.of(costCharacteristic.key(), costCharacteristic))
.setLatencyCharacteristic(Map.of(latencyCharacteristic.key(), latencyCharacteristic))
.setRiskParameterPac(
.build();
}
- public Map<OwnedNodeEdgePointKey, OwnedNodeEdgePoint> populateNepsForRdmNode(String nodeId,
- List<TerminationPoint> tpList, boolean withSip, String nepPhotonicSublayer) {
+ public Map<OwnedNodeEdgePointKey, OwnedNodeEdgePoint> populateNepsForRdmNode(
+ String nodeId, List<TerminationPoint> tpList, boolean withSip, String nepPhotonicSublayer) {
// create neps for MC and and Photonic Media OTS/OMS
Map<OwnedNodeEdgePointKey, OwnedNodeEdgePoint> onepMap = new HashMap<>();
for (TerminationPoint tp:tpList) {
+ String tpId = tp.getTpId().getValue();
// Admin and oper state common for all tps
OpenroadmTpType tpType = tp.augmentation(TerminationPoint1.class).getTpType();
// PHOTONIC MEDIA nep
- LOG.debug("PHOTO NEP = {}", String.join("+", this.ietfNodeId, nepPhotonicSublayer,
- tp.getTpId().getValue()));
+ LOG.debug("PHOTO NEP = {}",
+ String.join("+", this.ietfNodeId, nepPhotonicSublayer, tpId));
SupportedCepLayerProtocolQualifierInstancesBuilder sclpqiBd =
new SupportedCepLayerProtocolQualifierInstancesBuilder()
.setNumberOfCepInstances(Uint64.valueOf(1));
+ GridConstant.GRANULARITY * GridConstant.EFFECTIVE_BITS * 1E06);
} else {
LOG.debug("EnteringLOOPcreateOTSiMC & MC with usedFreqMap non empty {} NEP {} for Node {}",
- usedFreqMap.toString(), String.join("+", this.ietfNodeId, nepPhotonicSublayer,
- tp.getTpId().getValue()), nodeId);
- onepMap.putAll(populateNepsForRdmNode(nodeId, new ArrayList<>(List.of(tp)),
- true, TapiStringConstants.MC));
- onepMap.putAll(populateNepsForRdmNode(nodeId, new ArrayList<>(List.of(tp)),
- true, TapiStringConstants.OTSI_MC));
+ usedFreqMap,
+ String.join("+", this.ietfNodeId, nepPhotonicSublayer, tpId),
+ nodeId);
+ onepMap.putAll(populateNepsForRdmNode(
+ nodeId, new ArrayList<>(List.of(tp)), true, TapiStringConstants.MC));
+ onepMap.putAll(populateNepsForRdmNode(
+ nodeId, new ArrayList<>(List.of(tp)), true, TapiStringConstants.OTSI_MC));
}
break;
case DEGREERXTTP:
break;
}
LOG.debug("calling add Photonic NEP spec for Roadm");
- onepBd = tapiFactory.addPhotSpecToRoadmOnep(nodeId, usedFreqMap, availableFreqMap, onepBd,
- nepPhotonicSublayer);
+ onepBd = tapiFactory.addPhotSpecToRoadmOnep(
+ nodeId, usedFreqMap, availableFreqMap, onepBd, nepPhotonicSublayer);
}
AdminStates admin = tp.augmentation(TerminationPoint1.class).getAdministrativeState();
State oper = tp.augmentation(TerminationPoint1.class).getOperationalState();
Name nepName = new NameBuilder()
.setValueName(nepPhotonicSublayer + "NodeEdgePoint")
- .setValue(String.join("+", this.ietfNodeId, nepPhotonicSublayer, tp.getTpId().getValue()))
+ .setValue(String.join("+", this.ietfNodeId, nepPhotonicSublayer, tpId))
.build();
OwnedNodeEdgePoint onep = onepBd
- .setUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+", this.ietfNodeId,
- nepPhotonicSublayer, tp.getTpId().getValue()))
- .getBytes(Charset.forName("UTF-8"))).toString()))
+ .setUuid(new Uuid(UUID.nameUUIDFromBytes(
+ (String.join("+", this.ietfNodeId, nepPhotonicSublayer, tpId))
+ .getBytes(Charset.forName("UTF-8")))
+ .toString()))
.setLayerProtocolName(LayerProtocolName.PHOTONICMEDIA)
.setName(Map.of(nepName.key(), nepName))
.setSupportedCepLayerProtocolQualifierInstances(
LOG.info("creation of {} xpdr to roadm links", xpdrRdmLinkList.size() / 2);
LOG.debug("Link list = {}", xpdrRdmLinkList);
for (var link:xpdrRdmLinkList) {
- if (!linksToNotConvert.contains(link.getLinkId().getValue())) {
- var oppositeLink = xpdrRdmLinkList.stream()
- .filter(l -> l.getLinkId().equals(link.augmentation(Link1.class).getOppositeLink())).findAny()
- .orElse(null);
- AdminStates oppLnkAdmState = null;
- State oppLnkOpState = null;
- if (oppositeLink != null) {
- oppLnkAdmState = oppositeLink.augmentation(Link1.class).getAdministrativeState();
- oppLnkOpState = oppositeLink.augmentation(Link1.class).getOperationalState();
- }
- String sourceNode =
- link.getSource().getSourceNode().getValue().contains("ROADM")
- ? getIdBasedOnModelVersion(link.getSource().getSourceNode().getValue())
- : link.getSource().getSourceNode().getValue();
- String destNode =
- link.getDestination().getDestNode().getValue().contains("ROADM")
- ? getIdBasedOnModelVersion(link.getDestination().getDestNode().getValue())
- : link.getDestination().getDestNode().getValue();
- Link tapLink = this.tapiLink.createTapiLink(
- sourceNode, link.getSource().getSourceTp().getValue(),
- destNode, link.getDestination().getDestTp().getValue(),
- TapiStringConstants.OMS_XPDR_RDM_LINK,
- sourceNode.contains("ROADM") ? TapiStringConstants.PHTNC_MEDIA : TapiStringConstants.XPDR,
- destNode.contains("ROADM") ? TapiStringConstants.PHTNC_MEDIA : TapiStringConstants.XPDR,
- TapiStringConstants.PHTNC_MEDIA_OTS, TapiStringConstants.PHTNC_MEDIA_OTS,
- //adminState,
- link.augmentation(Link1.class).getAdministrativeState() == null || oppLnkAdmState == null
- ? null
- : this.tapiLink.setTapiAdminState(
- link.augmentation(Link1.class).getAdministrativeState(), oppLnkAdmState).getName(),
- //operState,
- link.augmentation(Link1.class).getOperationalState() == null || oppLnkOpState == null
- ? null
- : this.tapiLink.setTapiOperationalState(
- link.augmentation(Link1.class).getOperationalState(), oppLnkOpState).getName(),
- Set.of(LayerProtocolName.PHOTONICMEDIA), Set.of(LayerProtocolName.PHOTONICMEDIA.getName()),
- this.tapiTopoUuid);
- linksToNotConvert.add(link.augmentation(Link1.class).getOppositeLink().getValue());
- this.tapiLinks.put(tapLink.key(), tapLink);
+ if (linksToNotConvert.contains(link.getLinkId().getValue())) {
+ continue;
+ }
+ var oppositeLink = xpdrRdmLinkList.stream()
+ .filter(l -> l.getLinkId().equals(link.augmentation(Link1.class).getOppositeLink()))
+ .findAny().orElse(null);
+ AdminStates oppLnkAdmState = null;
+ State oppLnkOpState = null;
+ if (oppositeLink != null) {
+ oppLnkAdmState = oppositeLink.augmentation(Link1.class).getAdministrativeState();
+ oppLnkOpState = oppositeLink.augmentation(Link1.class).getOperationalState();
}
+ String sourceNode =
+ link.getSource().getSourceNode().getValue().contains("ROADM")
+ ? getIdBasedOnModelVersion(link.getSource().getSourceNode().getValue())
+ : link.getSource().getSourceNode().getValue();
+ String destNode =
+ link.getDestination().getDestNode().getValue().contains("ROADM")
+ ? getIdBasedOnModelVersion(link.getDestination().getDestNode().getValue())
+ : link.getDestination().getDestNode().getValue();
+ Link tapLink = this.tapiLink.createTapiLink(
+ sourceNode, link.getSource().getSourceTp().getValue(),
+ destNode, link.getDestination().getDestTp().getValue(),
+ TapiStringConstants.OMS_XPDR_RDM_LINK,
+ sourceNode.contains("ROADM") ? TapiStringConstants.PHTNC_MEDIA : TapiStringConstants.XPDR,
+ destNode.contains("ROADM") ? TapiStringConstants.PHTNC_MEDIA : TapiStringConstants.XPDR,
+ TapiStringConstants.PHTNC_MEDIA_OTS, TapiStringConstants.PHTNC_MEDIA_OTS,
+ //adminState,
+ link.augmentation(Link1.class).getAdministrativeState() == null || oppLnkAdmState == null
+ ? null
+ : this.tapiLink.setTapiAdminState(
+ link.augmentation(Link1.class).getAdministrativeState(), oppLnkAdmState).getName(),
+ //operState,
+ link.augmentation(Link1.class).getOperationalState() == null || oppLnkOpState == null
+ ? null
+ : this.tapiLink.setTapiOperationalState(
+ link.augmentation(Link1.class).getOperationalState(), oppLnkOpState).getName(),
+ Set.of(LayerProtocolName.PHOTONICMEDIA), Set.of(LayerProtocolName.PHOTONICMEDIA.getName()),
+ this.tapiTopoUuid);
+ linksToNotConvert.add(link.augmentation(Link1.class).getOppositeLink().getValue());
+ this.tapiLinks.put(tapLink.key(), tapLink);
}
}
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>test-common</artifactId>
- <version>9.0.0-SNAPSHOT</version>
+ <version>10.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>7.0.3</version>
+ <version>7.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>