Merge changes I453a92fd,I68ba6341
authorGuillaume Lambert <guillaume.lambert@orange.com>
Fri, 1 Mar 2024 07:34:36 +0000 (07:34 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 1 Mar 2024 07:34:36 +0000 (07:34 +0000)
* changes:
  Allow the client to specify ROADM service SRG port
  Address yang name change for transportpce-pce

13 files changed:
pce/src/main/java/org/opendaylight/transportpce/pce/PceSendingPceRPCs.java
pce/src/main/java/org/opendaylight/transportpce/pce/constraints/OperatorConstraints.java [new file with mode: 0644]
pce/src/main/java/org/opendaylight/transportpce/pce/graph/PceGraph.java
pce/src/main/java/org/opendaylight/transportpce/pce/graph/PostAlgoPathValidator.java
pce/src/test/java/org/opendaylight/transportpce/pce/PceSendingPceRPCsTest.java
pce/src/test/java/org/opendaylight/transportpce/pce/constraints/OperatorConstraintsTest.java [new file with mode: 0644]
pce/src/test/java/org/opendaylight/transportpce/pce/graph/PceGraphTest.java
pce/src/test/java/org/opendaylight/transportpce/pce/utils/PceTestData.java
pce/src/test/resources/spectrum-filling-rule1.json [new file with mode: 0644]
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/service/PCEServiceWrapper.java
tests/sample_configs/openroadm/7.1/oper-ROADMA.xml
tests/sample_configs/openroadm/7.1/oper-ROADMB.xml
tests/sample_configs/openroadm/7.1/oper-ROADMC.xml

index f89cff96c2fb16b8e2c1808285d23831091119e0..08b46d744edc30a86cd5ff183a7b0ea1cb0421c2 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.transportpce.pce;
 import org.opendaylight.transportpce.common.ResponseCodes;
 import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.transportpce.common.network.NetworkTransactionService;
+import org.opendaylight.transportpce.pce.constraints.OperatorConstraints;
 import org.opendaylight.transportpce.pce.constraints.PceConstraints;
 import org.opendaylight.transportpce.pce.constraints.PceConstraintsCalc;
 import org.opendaylight.transportpce.pce.gnpy.GnpyException;
@@ -121,10 +122,11 @@ public class PceSendingPceRPCs {
             LOG.error("In pathComputationWithConstraints, nwAnalizer: result = {}", rc);
             return;
         }
+        OperatorConstraints opConstraints = new OperatorConstraints(networkTransaction);
         LOG.info("PceGraph ...");
         PceGraph graph = new PceGraph(nwAnalizer.getaendPceNode(), nwAnalizer.getzendPceNode(),
                 nwAnalizer.getAllPceNodes(), nwAnalizer.getAllPceLinks(), hardConstraints,
-                rc, serviceType, networkTransaction, mode);
+                rc, serviceType, networkTransaction, mode, opConstraints.getBitMapConstraint(input.getCustomerName()));
         graph.calcPath();
         rc = graph.getReturnStructure();
         if (!rc.getStatus()) {
diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/constraints/OperatorConstraints.java b/pce/src/main/java/org/opendaylight/transportpce/pce/constraints/OperatorConstraints.java
new file mode 100644 (file)
index 0000000..7e0048f
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * Copyright © 2024 Orange, Inc. 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.pce.constraints;
+
+import java.util.BitSet;
+import java.util.Map;
+import java.util.concurrent.ExecutionException;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.transportpce.common.fixedflex.GridConstant;
+import org.opendaylight.transportpce.common.fixedflex.GridUtils;
+import org.opendaylight.transportpce.common.network.NetworkTransactionService;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.optical.channel.types.rev230526.FrequencyTHz;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.controller.customization.rev230526.controller.parameters.SpectrumFilling;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.controller.customization.rev230526.controller.parameters.spectrum.filling.SpectrumFillingRules;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.controller.customization.rev230526.controller.parameters.spectrum.filling.SpectrumFillingRulesKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ControllerBehaviourSettings;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/*
+ * Class to handle Operator Constraints associated with Specific Engineering rules
+ * as they are defined in the controller-behaviour-settings container of the service
+ * Data-Store.
+ *
+ */
+
+public class OperatorConstraints {
+
+    /* Logging. */
+    private static final Logger LOG = LoggerFactory.getLogger(OperatorConstraints.class);
+    private static final String SPECTRUM_LOG_MSG =
+        "Specific Spectrum filling Rules have been defined for {} the spectrum range {} - {}";
+    private NetworkTransactionService networkTransaction;
+
+    public OperatorConstraints(NetworkTransactionService networkTransaction) {
+
+        this.networkTransaction = networkTransaction;
+
+    }
+
+    public BitSet getBitMapConstraint(String customerName) {
+        BitSet referenceBitSet = new BitSet(GridConstant.EFFECTIVE_BITS);
+        referenceBitSet.set(0, GridConstant.EFFECTIVE_BITS, true);
+        InstanceIdentifier<SpectrumFilling> sfIID =
+            InstanceIdentifier
+                .builder(ControllerBehaviourSettings.class)
+                .child(SpectrumFilling.class)
+                .build();
+
+        try {
+            if (networkTransaction.read(LogicalDatastoreType.CONFIGURATION, sfIID).get().isPresent()) {
+                SpectrumFilling spectrumConstraint = networkTransaction
+                    .read(LogicalDatastoreType.CONFIGURATION, sfIID)
+                    .get().orElseThrow();
+                if (spectrumConstraint.getSpectrumFillingRules().isEmpty()) {
+                    return referenceBitSet;
+                }
+                if (customerName == null) {
+                    for (Map.Entry<SpectrumFillingRulesKey, SpectrumFillingRules> rule:
+                            spectrumConstraint.getSpectrumFillingRules().entrySet()) {
+                        var spectrumRangeOfAppl = rule.getValue().getSpectrumRangeOfAppliance();
+                        var dedicatedCustomer = spectrumRangeOfAppl.getDedicatedCustomer();
+                        if (dedicatedCustomer == null || dedicatedCustomer.isEmpty()) {
+                            continue;
+                        }
+                        // Spectrum portion is dedicated to some customers that do not include this one
+                        FrequencyTHz startFreq = spectrumRangeOfAppl.getStartEdgeFrequency();
+                        FrequencyTHz stopFreq = spectrumRangeOfAppl.getStopEdgeFrequency();
+                        referenceBitSet.set(
+                            GridUtils.getIndexFromFrequency(startFreq.getValue()),
+                            GridUtils.getIndexFromFrequency(stopFreq.getValue()),
+                            false);
+                        LOG.info(SPECTRUM_LOG_MSG,
+                            "other customers, preventing the customer from using", startFreq, stopFreq);
+                    }
+                    return referenceBitSet;
+                }
+
+                for (Map.Entry<SpectrumFillingRulesKey, SpectrumFillingRules> rule:
+                        spectrumConstraint.getSpectrumFillingRules().entrySet()) {
+                    var spectrumRangeOfAppl = rule.getValue().getSpectrumRangeOfAppliance();
+                    FrequencyTHz startFreq = spectrumRangeOfAppl.getStartEdgeFrequency();
+                    FrequencyTHz stopFreq = spectrumRangeOfAppl.getStopEdgeFrequency();
+                    var nonAuthorizedCustomer = spectrumRangeOfAppl.getNonAuthorizedCustomer();
+                    if (nonAuthorizedCustomer != null && nonAuthorizedCustomer.contains(customerName)) {
+                        //Customer shall not be put in this spectrum portion
+                        referenceBitSet.set(
+                            GridUtils.getIndexFromFrequency(startFreq.getValue()),
+                            GridUtils.getIndexFromFrequency(stopFreq.getValue()),
+                            false);
+                        LOG.info(SPECTRUM_LOG_MSG,
+                            "customer " + customerName + ", exluding it from", startFreq, stopFreq);
+                        continue;
+                    }
+                    var dedicatedCustomer = spectrumRangeOfAppl.getDedicatedCustomer();
+                    if (dedicatedCustomer == null || dedicatedCustomer.isEmpty()) {
+                        continue;
+                    }
+                    if (dedicatedCustomer.contains(customerName)) {
+                        // Spectrum portion is dedicated to customers including this one
+                        referenceBitSet.set(
+                            GridUtils.getIndexFromFrequency(startFreq.getValue()),
+                            GridUtils.getIndexFromFrequency(stopFreq.getValue()),
+                            true);
+                        LOG.info(SPECTRUM_LOG_MSG,
+                            "customer " + customerName + ", to dedicate", startFreq, stopFreq + " to it");
+                        continue;
+                    }
+                    // Spectrum portion is dedicated to some customers that do not include this one
+                    referenceBitSet.set(
+                        GridUtils.getIndexFromFrequency(startFreq.getValue()),
+                        GridUtils.getIndexFromFrequency(stopFreq.getValue()),
+                        false);
+                    LOG.info(SPECTRUM_LOG_MSG,
+                        "other customers, preventing the customer from using", startFreq, stopFreq);
+                }
+                return referenceBitSet;
+            }
+        } catch (InterruptedException | ExecutionException e1) {
+            LOG.error("Exception caught handling Spectrum filling Rules ", e1.getCause());
+        }
+        LOG.info("Did not succeed finding any Specific Spectrum filling Rules defined in Configuration Datastore");
+        return referenceBitSet;
+    }
+}
index b5d77ac89a51f75c7faaa23e9a7812abfb8f2208..994d3256fcbdce825275437c91d2357e60b176f2 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.transportpce.pce.graph;
 
 import java.util.ArrayList;
+import java.util.BitSet;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -54,6 +55,7 @@ public class PceGraph {
     private Double margin = null;
     PceConstraints pceHardConstraints;
     private PceConstraintMode pceConstraintMode;
+    private BitSet spectrumConstraint;
 
     // results
     private PceResult pceResult = null;
@@ -68,7 +70,7 @@ public class PceGraph {
 
     public PceGraph(PceNode aendNode, PceNode zendNode, Map<NodeId, PceNode> allPceNodes,
             Map<LinkId, PceLink> allPceLinks, PceConstraints pceHardConstraints,PceResult pceResult, String serviceType,
-            NetworkTransactionService networkTransactionService, PceConstraintMode mode) {
+            NetworkTransactionService networkTransactionService, PceConstraintMode mode, BitSet spectrumConstraint) {
         super();
         this.apceNode = aendNode;
         this.zpceNode = zendNode;
@@ -79,6 +81,7 @@ public class PceGraph {
         this.serviceType = serviceType;
         this.networkTransactionService = networkTransactionService;
         this.pceConstraintMode = mode;
+        this.spectrumConstraint = spectrumConstraint;
 
         LOG.info("In GraphCalculator: A and Z = {} / {} ", aendNode, zendNode);
         LOG.debug("In GraphCalculator: allPceNodes size {}, nodes {} ", allPceNodes.size(), allPceNodes);
@@ -102,7 +105,7 @@ public class PceGraph {
         for (Entry<Integer, GraphPath<String, PceGraphEdge>> entry : allWPaths.entrySet()) {
             GraphPath<String, PceGraphEdge> path = entry.getValue();
             LOG.info("validating path n° {} - {}", entry.getKey(), path.getVertexList());
-            PostAlgoPathValidator papv = new PostAlgoPathValidator(networkTransactionService);
+            PostAlgoPathValidator papv = new PostAlgoPathValidator(networkTransactionService, spectrumConstraint);
             pceResult = papv.checkPath(
                     path, allPceNodes, allPceLinks, pceResult, pceHardConstraints, serviceType, pceConstraintMode);
             this.margin = papv.getTpceCalculatedMargin();
index 56186777dce03378ff5167ec5273091a8de82ed0..53353aeae0415acfb29aa9867e4f4d2de734be67 100644 (file)
@@ -61,9 +61,11 @@ public class PostAlgoPathValidator {
 
     private Double tpceCalculatedMargin = 0.0;
     private final NetworkTransactionService networkTransactionService;
+    private final BitSet spectrumConstraint;
 
-    public PostAlgoPathValidator(NetworkTransactionService networkTransactionService) {
+    public PostAlgoPathValidator(NetworkTransactionService networkTransactionService, BitSet spectrumConstraint) {
         this.networkTransactionService = networkTransactionService;
+        this.spectrumConstraint = spectrumConstraint;
     }
 
     @SuppressWarnings("fallthrough")
@@ -1048,6 +1050,10 @@ public class PostAlgoPathValidator {
                 pceNode.getNodeId(), pceNodeVersion, sltWdthGran, ctralFreqGran);
             isFlexGrid = false;
         }
+        if (spectrumConstraint != null) {
+            result.and(spectrumConstraint);
+        }
+
         LOG.debug("Bitset result {}", result);
         return computeBestSpectrumAssignment(result, spectralWidthSlotNumber, isFlexGrid);
     }
index 3ade493bb58e3774a66aa8a663f4e163df04671f..bcc21d6f370f1c48f835bc26acc199c05c1ae80c 100644 (file)
@@ -7,13 +7,13 @@
  */
 package org.opendaylight.transportpce.pce;
 
-
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.lenient;
 import static org.mockito.Mockito.when;
 
+import java.util.concurrent.ExecutionException;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
@@ -27,7 +27,6 @@ import org.opendaylight.transportpce.pce.gnpy.JerseyServer;
 import org.opendaylight.transportpce.pce.gnpy.consumer.GnpyConsumer;
 import org.opendaylight.transportpce.pce.gnpy.consumer.GnpyConsumerImpl;
 import org.opendaylight.transportpce.pce.utils.PceTestData;
-import org.opendaylight.transportpce.pce.utils.PceTestUtils;
 import org.opendaylight.transportpce.test.AbstractTest;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev231221.mapping.Mapping;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev231221.mapping.MappingBuilder;
@@ -38,6 +37,7 @@ import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmappi
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev231221.network.nodes.NodeInfoBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.NodeTypes;
 
+
 @ExtendWith(MockitoExtension.class)
 public class PceSendingPceRPCsTest extends AbstractTest {
 
@@ -54,10 +54,9 @@ public class PceSendingPceRPCsTest extends AbstractTest {
 
 
     @BeforeEach
-    void setUp() {
+    void setUp() throws InterruptedException, ExecutionException {
         this.dataBroker = getNewDataBroker();
         networkTransaction = new NetworkTransactionImpl(this.dataBroker);
-        PceTestUtils.writeNetworkInDataStore(this.dataBroker);
         gnpyConsumer = new GnpyConsumerImpl(
             "http://localhost:9998", "mylogin", "mypassword", getDataStoreContextUtil().getBindingDOMCodecServices());
         pceSendingPceRPCs = new PceSendingPceRPCs(
@@ -94,6 +93,7 @@ public class PceSendingPceRPCsTest extends AbstractTest {
         assertNull(pceSendingPceRPCs.getMessage());
     }
 
+
     @Test
     void responseCodeTest() {
         assertNull(pceSendingPceRPCs.getResponseCode());
diff --git a/pce/src/test/java/org/opendaylight/transportpce/pce/constraints/OperatorConstraintsTest.java b/pce/src/test/java/org/opendaylight/transportpce/pce/constraints/OperatorConstraintsTest.java
new file mode 100644 (file)
index 0000000..4fbab35
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright © 2024 Orange Labs, Inc. 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.pce.constraints;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
+
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.nio.charset.StandardCharsets;
+import java.util.BitSet;
+import java.util.concurrent.ExecutionException;
+import org.eclipse.jdt.annotation.NonNull;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.binding.dom.codec.spi.BindingDOMCodecServices;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.transportpce.common.fixedflex.GridConstant;
+import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
+import org.opendaylight.transportpce.pce.graph.PceGraphTest;
+import org.opendaylight.transportpce.pce.utils.PceTestUtils;
+import org.opendaylight.transportpce.test.AbstractTest;
+import org.opendaylight.transportpce.test.converter.DataObjectConverter;
+import org.opendaylight.transportpce.test.converter.JSONDataObjectConverter;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.controller.customization.rev230526.controller.parameters
+//.SpectrumFilling;
+//import org.opendaylight.yang.gen.v1.http.org.openroadm.controller.customization.rev230526.controller.parameters
+//.spectrum.filling.SpectrumFillingRules;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ControllerBehaviourSettings;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+@ExtendWith(MockitoExtension.class)
+public class OperatorConstraintsTest extends AbstractTest {
+
+    private static final Logger LOG = LoggerFactory.getLogger(PceGraphTest.class);
+    private NetworkTransactionImpl networkTransaction;
+    private static final String SPEC_FILLING_FILE = "src/test/resources/spectrum-filling-rule1.json";
+//    private static SpectrumFillingRules sfRule;
+    private static ControllerBehaviourSettings cbSettings;
+    private OperatorConstraints opConstraints;
+    @Mock
+    private BindingDOMCodecServices bindingDOMCodecServices;
+    private DataBroker dataBroker;
+
+    @BeforeEach
+    void setUp() throws InterruptedException, ExecutionException {
+        this.dataBroker = getNewDataBroker();
+        networkTransaction = new NetworkTransactionImpl(this.dataBroker);
+        opConstraints = new OperatorConstraints(networkTransaction);
+        PceTestUtils.writeNetworkInDataStore(this.dataBroker);
+        DataObjectConverter dataObjectConverter = JSONDataObjectConverter
+            .createWithDataStoreUtil(getDataStoreContextUtil());
+        // The Spectrum filling rules associated with CustomerProfileLamda1 is populated from a file in the Data Store
+        try (Reader reader = new FileReader(SPEC_FILLING_FILE, StandardCharsets.UTF_8)) {
+            NormalizedNode normalizedNode = dataObjectConverter.transformIntoNormalizedNode(reader).orElseThrow();
+            cbSettings = (ControllerBehaviourSettings) getDataStoreContextUtil()
+                .getBindingDOMCodecServices()
+                .fromNormalizedNode(
+                    YangInstanceIdentifier.of(ControllerBehaviourSettings.QNAME), normalizedNode)
+                .getValue();
+            InstanceIdentifier<ControllerBehaviourSettings> sfIID =
+                InstanceIdentifier
+                    .builder(ControllerBehaviourSettings.class)
+//                    .child(SpectrumFilling.class)
+//                    .child(SpectrumFillingRules.class)
+                    .build();
+            @NonNull
+            WriteTransaction newWriteOnlyTransaction = dataBroker.newWriteOnlyTransaction();
+            newWriteOnlyTransaction.put(LogicalDatastoreType.CONFIGURATION, sfIID, cbSettings);
+            newWriteOnlyTransaction.commit().get();
+        } catch (IOException e) {
+            LOG.error("Cannot load Spectrum-Filling-Rules in Service DS ", e);
+            fail("Cannot load Spectrum-Filling-Rules");
+        }
+    }
+
+
+    @Test
+    void checkSpecttrumFilling() {
+        BitSet referenceBitSet = new BitSet(GridConstant.EFFECTIVE_BITS);
+        referenceBitSet.set(0, GridConstant.EFFECTIVE_BITS, false);
+        referenceBitSet.set(0, 8, true);
+        assertEquals(referenceBitSet, opConstraints.getBitMapConstraint("CustomerProfileLamda1"));
+        referenceBitSet.set(8, GridConstant.EFFECTIVE_BITS, true);
+        referenceBitSet.set(0, 8, false);
+        assertEquals(referenceBitSet, opConstraints.getBitMapConstraint("otherCustomer"));
+    }
+
+}
index cbf5ba570e8fcaf20034a45b49eaafc39d8f0db0..d85efa20c81a25fc668a1960331c71a0b90382f7 100644 (file)
@@ -249,7 +249,7 @@ public class PceGraphTest extends AbstractTest {
         pceCalc.retrievePceNetwork();
         pceGraph = new PceGraph(pceCalc.getaendPceNode(), pceCalc.getzendPceNode(),
             pceCalc.getAllPceNodes(), pceCalc.getAllPceLinks(), pceHardConstraints,
-            rc, StringConstants.SERVICE_TYPE_100GE_T, netTransServ, PceConstraintMode.Loose);
+            rc, StringConstants.SERVICE_TYPE_100GE_T, netTransServ, PceConstraintMode.Loose, null);
         assertEquals(pceGraph.calcPath(), true);
         assertEquals(Optional.ofNullable(pceGraph.getmargin()), Optional.ofNullable(3.0919881995992924));
     }
@@ -262,7 +262,7 @@ public class PceGraphTest extends AbstractTest {
         pceCalc.retrievePceNetwork();
         pceGraph = new PceGraph(pceCalc.getaendPceNode(), pceCalc.getzendPceNode(),
             pceCalc.getAllPceNodes(), pceCalc.getAllPceLinks(), pceHardConstraints,
-            rc, StringConstants.SERVICE_TYPE_OTUC2, netTransServ, PceConstraintMode.Loose);
+            rc, StringConstants.SERVICE_TYPE_OTUC2, netTransServ, PceConstraintMode.Loose, null);
         assertEquals(pceGraph.calcPath(), true);
         assertEquals(Optional.ofNullable(pceGraph.getmargin()), Optional.ofNullable(1.1559963686478447));
     }
@@ -275,7 +275,7 @@ public class PceGraphTest extends AbstractTest {
         pceCalc.retrievePceNetwork();
         pceGraph = new PceGraph(pceCalc.getaendPceNode(), pceCalc.getzendPceNode(),
             pceCalc.getAllPceNodes(), pceCalc.getAllPceLinks(), pceHardConstraints,
-            rc, StringConstants.SERVICE_TYPE_OTUC3, netTransServ, PceConstraintMode.Loose);
+            rc, StringConstants.SERVICE_TYPE_OTUC3, netTransServ, PceConstraintMode.Loose, null);
         assertEquals(pceGraph.calcPath(), true);
         assertEquals(Optional.ofNullable(pceGraph.getmargin()), Optional.ofNullable(0.3351048800367167));
     }
@@ -288,7 +288,7 @@ public class PceGraphTest extends AbstractTest {
         pceCalc.retrievePceNetwork();
         pceGraph = new PceGraph(pceCalc.getaendPceNode(), pceCalc.getzendPceNode(),
             pceCalc.getAllPceNodes(), pceCalc.getAllPceLinks(), pceHardConstraints,
-            rc, StringConstants.SERVICE_TYPE_400GE, netTransServ, PceConstraintMode.Loose);
+            rc, StringConstants.SERVICE_TYPE_400GE, netTransServ, PceConstraintMode.Loose, null);
         assertEquals(pceGraph.calcPath(), false);
         assertEquals(Optional.ofNullable(pceGraph.getmargin()), Optional.ofNullable(0.0));
     }
@@ -301,7 +301,7 @@ public class PceGraphTest extends AbstractTest {
         pceCalc.retrievePceNetwork();
         pceGraph = new PceGraph(pceCalc.getaendPceNode(), pceCalc.getzendPceNode(),
             pceCalc.getAllPceNodes(), pceCalc.getAllPceLinks(), pceHardConstraints,
-            rc, StringConstants.SERVICE_TYPE_400GE, netTransServ, PceConstraintMode.Loose);
+            rc, StringConstants.SERVICE_TYPE_400GE, netTransServ, PceConstraintMode.Loose, null);
         assertEquals(pceGraph.calcPath(), true);
         assertEquals(Optional.ofNullable(pceGraph.getmargin()), Optional.ofNullable(1.4432381874659086));
     }
@@ -314,7 +314,7 @@ public class PceGraphTest extends AbstractTest {
         pceCalc.retrievePceNetwork();
         pceGraph = new PceGraph(pceCalc.getaendPceNode(), pceCalc.getzendPceNode(),
             pceCalc.getAllPceNodes(), pceCalc.getAllPceLinks(), pceHardConstraints,
-            rc, StringConstants.SERVICE_TYPE_OTUC4, netTransServ, PceConstraintMode.Loose);
+            rc, StringConstants.SERVICE_TYPE_OTUC4, netTransServ, PceConstraintMode.Loose, null);
         assertEquals(pceGraph.calcPath(), true);
         assertEquals(Optional.ofNullable(pceGraph.getmargin()), Optional.ofNullable(1.4432381874659086));
     }
@@ -327,7 +327,7 @@ public class PceGraphTest extends AbstractTest {
         pceCalc.retrievePceNetwork();
         pceGraph = new PceGraph(pceCalc.getaendPceNode(), pceCalc.getzendPceNode(),
             pceCalc.getAllPceNodes(), pceCalc.getAllPceLinks(), pceHardConstraints,
-            rc, StringConstants.SERVICE_TYPE_OTUC4, netTransServ, PceConstraintMode.Loose);
+            rc, StringConstants.SERVICE_TYPE_OTUC4, netTransServ, PceConstraintMode.Loose, null);
         assertEquals(pceGraph.calcPath(), true);
         assertEquals(Optional.ofNullable(pceGraph.getmargin()), Optional.ofNullable(0.0));
     }
@@ -340,7 +340,7 @@ public class PceGraphTest extends AbstractTest {
         pceCalc.retrievePceNetwork();
         pceGraph = new PceGraph(pceCalc.getaendPceNode(), pceCalc.getzendPceNode(),
             pceCalc.getAllPceNodes(), pceCalc.getAllPceLinks(), pceHardConstraints,
-            rc, StringConstants.SERVICE_TYPE_100GE_T, netTransServ, PceConstraintMode.Loose);
+            rc, StringConstants.SERVICE_TYPE_100GE_T, netTransServ, PceConstraintMode.Loose, null);
         assertEquals(pceGraph.calcPath(), true);
         assertEquals(Optional.ofNullable(pceGraph.getmargin()), Optional.ofNullable(3.0919881995992924));
     }
@@ -354,7 +354,7 @@ public class PceGraphTest extends AbstractTest {
         pceHardConstraints.setPceMetrics(PceMetric.PropagationDelay);
         pceGraph = new PceGraph(pceCalc.getaendPceNode(), pceCalc.getzendPceNode(),
             pceCalc.getAllPceNodes(), pceCalc.getAllPceLinks(), pceHardConstraints,
-            rc, StringConstants.SERVICE_TYPE_100GE_T, netTransServ, PceConstraintMode.Loose);
+            rc, StringConstants.SERVICE_TYPE_100GE_T, netTransServ, PceConstraintMode.Loose, null);
         pceGraph.setConstrains(pceHardConstraints);
 
         assertEquals(pceGraph.calcPath(), true);
@@ -417,7 +417,7 @@ public class PceGraphTest extends AbstractTest {
             new NodeId("optical"), pceOtnNode,
             new NodeId("optical2"), pceOtnNode2);
         return new PceGraph(pceOtnNode, pceOtnNode2, allPceNodes, allPceLinks, pceHardConstraints,
-                new PceResult(), type, null, PceConstraintMode.Loose);
+                new PceResult(), type, null, PceConstraintMode.Loose, null);
     }
 
     private void saveOpenRoadmNetwork(Network network, String networkId)
index 35056af2e94731a395b2867a5deefd6ba0cc5354..c394a928ae2618faa05fab8a118b816a7a23deb7 100644 (file)
@@ -238,8 +238,8 @@ public final class PceTestData {
                 .setCustomerCode(Set.of("Some customer-code"))
                 .setCoRouting(new CoRoutingBuilder()
                     .setServiceIdentifierList(Map.of(
-                        new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209.constraints.co
-                                .routing.ServiceIdentifierListKey("Some existing-service"),
+                        new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209
+                                .constraints.co.routing.ServiceIdentifierListKey("Some existing-service"),
                         new ServiceIdentifierListBuilder().setServiceIdentifier("Some existing-service").build()))
                     .build())
                 .build())
@@ -247,8 +247,8 @@ public final class PceTestData {
                 .setCustomerCode(Set.of("Some customer-code"))
                 .setCoRouting(new CoRoutingBuilder()
                     .setServiceIdentifierList(Map.of(
-                        new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209.constraints.co
-                                .routing.ServiceIdentifierListKey("Some existing-service"),
+                        new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209
+                                .constraints.co.routing.ServiceIdentifierListKey("Some existing-service"),
                         new ServiceIdentifierListBuilder().setServiceIdentifier("Some existing-service").build()))
                     .build())
                 .build())
@@ -323,8 +323,8 @@ public final class PceTestData {
                 .setCustomerCode(Set.of("Some customer-code"))
                 .setCoRouting(new CoRoutingBuilder()
                     .setServiceIdentifierList(Map.of(
-                        new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209.constraints.co
-                                .routing.ServiceIdentifierListKey("Some existing-service"),
+                        new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209
+                                .constraints.co.routing.ServiceIdentifierListKey("Some existing-service"),
                         new ServiceIdentifierListBuilder().setServiceIdentifier("Some existing-service").build()))
                     .build())
                 .build())
@@ -332,8 +332,8 @@ public final class PceTestData {
                 .setCustomerCode(Set.of("Some customer-code"))
                 .setCoRouting(new CoRoutingBuilder()
                     .setServiceIdentifierList(Map.of(
-                        new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209.constraints.co
-                                .routing.ServiceIdentifierListKey("Some existing-service"),
+                        new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209
+                                .constraints.co.routing.ServiceIdentifierListKey("Some existing-service"),
                         new ServiceIdentifierListBuilder().setServiceIdentifier("Some existing-service").build()))
                     .build())
                 .build())
@@ -348,86 +348,84 @@ public final class PceTestData {
                         .build())
                 .setServiceAEnd(new org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev240205
                         .path.computation.reroute.request.input.ServiceAEndBuilder()
-                        .setServiceFormat(ServiceFormat.Ethernet)
-                        .setServiceRate(Uint32.valueOf(100))
-                        .setClli("clli11")
-                        .setNodeId("XPONDER-2-2")
-                        .setTxDirection(new TxDirectionBuilder()
-                                .setPort(new PortBuilder()
-                                        .setPortDeviceName("Some port-device-name")
-                                        .setPortType("Some port-type")
-                                        .setPortName("Some port-name")
-                                        .setPortRack("Some port-rack")
-                                        .setPortShelf("Some port-shelf")
-                                        .setPortSlot("Some port-slot")
-                                        .setPortSubSlot("Some port-sub-slot")
-                                        .build())
-                                .build())
-                        .setRxDirection(new RxDirectionBuilder()
-                                .setPort(new PortBuilder()
-                                        .setPortDeviceName("Some port-device-name")
-                                        .setPortType("Some port-type")
-                                        .setPortName("Some port-name")
-                                        .setPortRack("Some port-rack")
-                                        .setPortShelf("Some port-shelf")
-                                        .setPortSlot("Some port-slot")
-                                        .setPortSubSlot("Some port-sub-slot")
-                                        .build())
-                                .build())
-                        .build())
+                    .setServiceFormat(ServiceFormat.Ethernet)
+                    .setServiceRate(Uint32.valueOf(100))
+                    .setClli("clli11")
+                    .setNodeId("XPONDER-2-2")
+                    .setTxDirection(new TxDirectionBuilder()
+                            .setPort(new PortBuilder()
+                                    .setPortDeviceName("Some port-device-name")
+                                    .setPortType("Some port-type")
+                                    .setPortName("Some port-name")
+                                    .setPortRack("Some port-rack")
+                                    .setPortShelf("Some port-shelf")
+                                    .setPortSlot("Some port-slot")
+                                    .setPortSubSlot("Some port-sub-slot")
+                                    .build())
+                            .build())
+                    .setRxDirection(new RxDirectionBuilder()
+                            .setPort(new PortBuilder()
+                                    .setPortDeviceName("Some port-device-name")
+                                    .setPortType("Some port-type")
+                                    .setPortName("Some port-name")
+                                    .setPortRack("Some port-rack")
+                                    .setPortShelf("Some port-shelf")
+                                    .setPortSlot("Some port-slot")
+                                    .setPortSubSlot("Some port-sub-slot")
+                                    .build())
+                            .build())
+                    .build())
                 .setServiceZEnd(new org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev240205
                         .path.computation.reroute.request.input.ServiceZEndBuilder()
-                        .setServiceFormat(ServiceFormat.Ethernet)
-                        .setServiceRate(Uint32.valueOf(0))
-                        .setClli("Some clli11")
-                        .setNodeId("XPONDER-1-2")
-                        .setTxDirection(new TxDirectionBuilder()
-                                .setPort(new PortBuilder()
-                                        .setPortDeviceName("Some port-device-name")
-                                        .setPortType("Some port-type")
-                                        .setPortName("Some port-name")
-                                        .setPortRack("Some port-rack")
-                                        .setPortShelf("Some port-shelf")
-                                        .setPortSlot("Some port-slot")
-                                        .setPortSubSlot("Some port-sub-slot")
-                                        .build())
-                                .build())
-                        .setRxDirection(new RxDirectionBuilder()
-                                .setPort(new PortBuilder()
-                                        .setPortDeviceName("Some port-device-name")
-                                        .setPortType("Some port-type")
-                                        .setPortName("Some port-name")
-                                        .setPortRack("Some port-rack")
-                                        .setPortShelf("Some port-shelf")
-                                        .setPortSlot("Some port-slot")
-                                        .setPortSubSlot("Some port-sub-slot")
-                                        .build())
-                                .build())
-                        .build())
+                    .setServiceFormat(ServiceFormat.Ethernet)
+                    .setServiceRate(Uint32.valueOf(0))
+                    .setClli("Some clli11")
+                    .setNodeId("XPONDER-1-2")
+                    .setTxDirection(new TxDirectionBuilder()
+                            .setPort(new PortBuilder()
+                                    .setPortDeviceName("Some port-device-name")
+                                    .setPortType("Some port-type")
+                                    .setPortName("Some port-name")
+                                    .setPortRack("Some port-rack")
+                                    .setPortShelf("Some port-shelf")
+                                    .setPortSlot("Some port-slot")
+                                    .setPortSubSlot("Some port-sub-slot")
+                                    .build())
+                            .build())
+                    .setRxDirection(new RxDirectionBuilder()
+                            .setPort(new PortBuilder()
+                                    .setPortDeviceName("Some port-device-name")
+                                    .setPortType("Some port-type")
+                                    .setPortName("Some port-name")
+                                    .setPortRack("Some port-rack")
+                                    .setPortShelf("Some port-shelf")
+                                    .setPortSlot("Some port-slot")
+                                    .setPortSubSlot("Some port-sub-slot")
+                                    .build())
+                            .build())
+                    .build())
                 .setHardConstraints(new HardConstraintsBuilder()
-                        .setCustomerCode(Set.of("Some customer-code"))
-                        .setCoRouting(new CoRoutingBuilder()
-                                .setServiceIdentifierList(Map.of(
-                                        new org.opendaylight.yang.gen.v1
-                                                .http.org.openroadm.routing.constraints.rev221209
-                                                .constraints.co.routing.ServiceIdentifierListKey("test"),
-                                        new ServiceIdentifierListBuilder().setServiceIdentifier("test").build()))
-                                .build())
+                    .setCustomerCode(Set.of("Some customer-code"))
+                    .setCoRouting(new CoRoutingBuilder()
+                        .setServiceIdentifierList(Map.of(
+                                new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209
+                                        .constraints.co.routing.ServiceIdentifierListKey("test"),
+                                new ServiceIdentifierListBuilder().setServiceIdentifier("test").build()))
                         .build())
+                    .build())
                 .setSoftConstraints(new SoftConstraintsBuilder()
-                        .setCustomerCode(Set.of("Some customer-code"))
-                        .setCoRouting(new CoRoutingBuilder()
-                                .setServiceIdentifierList(Map.of(
-                                        new org.opendaylight.yang.gen.v1
-                                                .http.org.openroadm.routing.constraints.rev221209
-                                                .constraints.co.routing.ServiceIdentifierListKey("test"),
-                                        new ServiceIdentifierListBuilder().setServiceIdentifier("test").build()))
-                                .build())
+                    .setCustomerCode(Set.of("Some customer-code"))
+                    .setCoRouting(new CoRoutingBuilder()
+                        .setServiceIdentifierList(Map.of(
+                                new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209
+                                        .constraints.co.routing.ServiceIdentifierListKey("test"),
+                                new ServiceIdentifierListBuilder().setServiceIdentifier("test").build()))
                         .build())
+                    .build())
                 .setEndpoints(new EndpointsBuilder()
-                        .setAEndTp("AendTP")
-                        .setZEndTp("ZendTP")
-                        .build())
+                    .setAEndTp("AendTP")
+                    .setZEndTp("ZendTP")
+                    .build())
                 .build();
     }
 
@@ -802,8 +800,8 @@ public final class PceTestData {
                 .setDiversity(new DiversityBuilder()
                     .setServiceIdentifierList(Map.of(
                         new ServiceIdentifierListKey(base.getServiceName()),
-                        new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209.diversity
-                                .existing.service.constraints.ServiceIdentifierListBuilder()
+                        new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209
+                                .diversity.existing.service.constraints.ServiceIdentifierListBuilder()
                             .setServiceIdentifier(base.getServiceName())
                             .setServiceApplicability(new ServiceApplicabilityBuilder()
                                 .setNode(true)
@@ -821,40 +819,40 @@ public final class PceTestData {
             .setCustomer("Customer")
             .setServiceName("service 1")
             .setServiceAEnd(
-                new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.create.input
-                        .ServiceAEndBuilder()
+                new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+                        .service.create.input.ServiceAEndBuilder()
                     .setClli("clli")
                     .setServiceRate(Uint32.valueOf(0))
                     .setNodeId(new NodeIdType("XPONDER-1-2"))
                     .setTxDirection(Map.of(
                         new TxDirectionKey(Uint8.ZERO),
-                        new org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.service
-                                .endpoint.TxDirectionBuilder()
+                        new org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526
+                                .service.endpoint.TxDirectionBuilder()
                             .setPort(new PortBuilder().build())
                             .build()))
                     .setRxDirection(Map.of(
                         new RxDirectionKey(Uint8.ZERO),
-                        new org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.service
-                                .endpoint.RxDirectionBuilder()
+                        new org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526
+                                .service.endpoint.RxDirectionBuilder()
                             .setPort(new PortBuilder().build())
                             .build()))
                     .build())
             .setServiceZEnd(
-                new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.create.input
-                        .ServiceZEndBuilder()
+                new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+                        .service.create.input.ServiceZEndBuilder()
                     .setClli("clli")
                     .setServiceRate(Uint32.valueOf(0))
                     .setNodeId(new NodeIdType("XPONDER-3-2"))
                     .setTxDirection(Map.of(
                         new TxDirectionKey(Uint8.ZERO),
-                        new org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.service
-                                .endpoint.TxDirectionBuilder()
+                        new org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526
+                                .service.endpoint.TxDirectionBuilder()
                             .setPort(new PortBuilder().build())
                             .build()))
                     .setRxDirection(Map.of(
                         new RxDirectionKey(Uint8.ZERO),
-                        new org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.service
-                                .endpoint.RxDirectionBuilder()
+                        new org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526
+                                .service.endpoint.RxDirectionBuilder()
                             .setPort(new PortBuilder().build())
                             .build()))
                     .build())
@@ -931,8 +929,8 @@ public final class PceTestData {
                 .setCustomerCode(Set.of("Some customer-code"))
                 .setCoRouting(new CoRoutingBuilder()
                     .setServiceIdentifierList(Map.of(
-                        new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209.constraints.co
-                                .routing.ServiceIdentifierListKey("Some existing-service"),
+                        new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209
+                                .constraints.co.routing.ServiceIdentifierListKey("Some existing-service"),
                         new ServiceIdentifierListBuilder().setServiceIdentifier("Some existing-service").build()))
                     .build())
                 .build())
@@ -940,8 +938,8 @@ public final class PceTestData {
                 .setCustomerCode(Set.of("Some customer-code"))
                 .setCoRouting(new CoRoutingBuilder()
                     .setServiceIdentifierList(Map.of(
-                        new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209.constraints.co
-                                .routing.ServiceIdentifierListKey("Some existing-service"),
+                        new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209
+                                .constraints.co.routing.ServiceIdentifierListKey("Some existing-service"),
                         new ServiceIdentifierListBuilder().setServiceIdentifier("Some existing-service").build()))
                     .build())
                 .build())
diff --git a/pce/src/test/resources/spectrum-filling-rule1.json b/pce/src/test/resources/spectrum-filling-rule1.json
new file mode 100644 (file)
index 0000000..dfb0c83
--- /dev/null
@@ -0,0 +1,38 @@
+{
+    "controller-behaviour-settings": {
+        "spectrum-filling": {
+          "spectrum-filling-rules": [
+            {
+              "rule-id": 1,
+              "priority": 1,
+              "RMSA-policy": "maximize-capacity",
+              "spectrum-range-of-appliance": {
+                "dedicated-signal-bandwidth-multiple": 50,
+                "spectrum-portion-id": 0,
+                "start-edge-frequency": 191.325,
+                "stop-edge-frequency": 191.375,
+                "dedicated-customer": [
+                  "CustomerProfileLamda1"
+                ],
+                "non-authorized-customer": [
+                  "All-other"
+                ]
+              }
+            },
+            {
+              "rule-id": 2,
+              "priority": 1,
+              "RMSA-policy": "maximize-capacity",
+              "spectrum-range-of-appliance": {
+                "spectrum-portion-id": 1,
+                "start-edge-frequency": 191.375,
+                "stop-edge-frequency": 196.125,
+                "non-authorized-customer": [
+                  "CustomerProfileLamda1"
+                ]
+              }
+            }
+          ]
+        }
+    }
+}
index 2ea5077a6be795d34f43843a66cf6865dd94abde..7eb2e29c1ba6ab7b6474fdfec907a77194340f04 100644 (file)
@@ -78,7 +78,8 @@ public class PCEServiceWrapper {
             return performPCE(serviceCreateInput.getHardConstraints(), serviceCreateInput.getSoftConstraints(),
                     serviceCreateInput.getServiceName(), serviceCreateInput.getSdncRequestHeader(),
                     serviceCreateInput.getServiceAEnd(), serviceCreateInput.getServiceZEnd(),
-                    ServiceNotificationTypes.ServiceCreateResult, reserveResource);
+                    ServiceNotificationTypes.ServiceCreateResult, reserveResource,
+                    serviceCreateInput.getCustomer());
         } else {
             return returnPCEFailed();
         }
@@ -91,7 +92,8 @@ public class PCEServiceWrapper {
             return performPCE(tempServiceCreateInput.getHardConstraints(), tempServiceCreateInput.getSoftConstraints(),
                     tempServiceCreateInput.getCommonId(), tempServiceCreateInput.getSdncRequestHeader(),
                     tempServiceCreateInput.getServiceAEnd(), tempServiceCreateInput.getServiceZEnd(),
-                    ServiceNotificationTypes.ServiceCreateResult, reserveResource);
+                    ServiceNotificationTypes.ServiceCreateResult, reserveResource,
+                    tempServiceCreateInput.getCustomer());
         } else {
             return returnPCEFailed();
         }
@@ -106,7 +108,8 @@ public class PCEServiceWrapper {
                     serviceFeasibilityCheckInput.getSoftConstraints(), serviceFeasibilityCheckInput.getCommonId(),
                     serviceFeasibilityCheckInput.getSdncRequestHeader(), serviceFeasibilityCheckInput.getServiceAEnd(),
                     serviceFeasibilityCheckInput.getServiceZEnd(),
-                    ServiceNotificationTypes.ServiceCreateResult, reserveResource);
+                    ServiceNotificationTypes.ServiceCreateResult, reserveResource,
+                    serviceFeasibilityCheckInput.getCustomer());
         } else {
             return returnPCEFailed();
         }
@@ -114,7 +117,8 @@ public class PCEServiceWrapper {
 
     private PathComputationRequestOutput performPCE(HardConstraints hardConstraints, SoftConstraints softConstraints,
             String serviceName, SdncRequestHeader sdncRequestHeader, ServiceEndpoint serviceAEnd,
-            ServiceEndpoint serviceZEnd, ServiceNotificationTypes notifType, boolean reserveResource) {
+            ServiceEndpoint serviceZEnd, ServiceNotificationTypes notifType, boolean reserveResource,
+            String customerName) {
         LOG.info("Calling path computation.");
         notification = new ServiceRpcResultShBuilder().setNotificationType(notifType).setServiceName(serviceName)
                 .setStatus(RpcStatusEx.Pending)
@@ -127,7 +131,7 @@ public class PCEServiceWrapper {
         FutureCallback<PathComputationRequestOutput> pceCallback =
                 new PathComputationRequestOutputCallback(notifType, serviceName);
         PathComputationRequestInput pathComputationRequestInput = createPceRequestInput(serviceName, sdncRequestHeader,
-                hardConstraints, softConstraints, reserveResource, serviceAEnd, serviceZEnd);
+                hardConstraints, softConstraints, reserveResource, serviceAEnd, serviceZEnd, customerName);
         ListenableFuture<PathComputationRequestOutput> pce = this.pathComputationService
                 .pathComputationRequest(pathComputationRequestInput);
         Futures.addCallback(pce, pceCallback, executor);
@@ -173,7 +177,7 @@ public class PCEServiceWrapper {
     private PathComputationRequestInput createPceRequestInput(String serviceName,
             SdncRequestHeader serviceHandler, HardConstraints hardConstraints,
             SoftConstraints softConstraints, Boolean reserveResource, ServiceEndpoint serviceAEnd,
-            ServiceEndpoint serviceZEnd) {
+            ServiceEndpoint serviceZEnd, String customerName) {
         LOG.info("Mapping ServiceCreateInput or ServiceFeasibilityCheckInput or serviceReconfigureInput to PCE"
                 + "requests");
         ServiceHandlerHeaderBuilder serviceHandlerHeader = new ServiceHandlerHeaderBuilder();
@@ -187,6 +191,7 @@ public class PCEServiceWrapper {
             .setHardConstraints(hardConstraints)
             .setSoftConstraints(softConstraints)
             .setPceRoutingMetric(PceMetric.TEMetric)
+            .setCustomerName(customerName)
             .setServiceAEnd(ModelMappingUtils.createServiceAEnd(serviceAEnd))
             .setServiceZEnd(ModelMappingUtils.createServiceZEnd(serviceZEnd))
             .build();
index 2b99e3aef97770f664f43385655cc38edc7d6d8c..656b07c6777f2a5be7023497a5b6c67c3fde39d0 100644 (file)
   </current-pm-entry>
   </current-pm-list>
 
+  <current-pm-description xmlns="http://honeynode-simulator/pm-handling">
+    <pm-generation-rules>
+      <triggering-interface xmlns:org-openroadm-interfaces="http://org/openroadm/interfaces">org-openroadm-interfaces:opticalTransport</triggering-interface>
+      <pm-name-prefix>opticalPowerOutput</pm-name-prefix>
+      <!--This PM is generated on ROADMs on creation of the first NMC (MediaChannel) interface nmc-ttp-DEGX-TTP-[TX/TXRX]-[frequency]-->
+      <!--Its value will be changed as additional NMC are created-->
+      <analog>true</analog>
+      <!--Default value is purely indicative, the value shall be set trough pm-interact RPC according to a value calculated from span loss and Power mask -->
+      <!--The value set through the RPC will be the value to keep as a reference out of any forced mode use to simulate a failure -->
+      <default-current-value>0</default-current-value>
+      <max-value>21.82</max-value>
+      <min-value>-9.0</min-value>
+      <!--Evolution range is a percentage of the min max range expressed in dB-->
+      <evolution-range>5</evolution-range>
+    </pm-generation-rules>
+    <pm-generation-rules>
+      <triggering-interface xmlns:org-openroadm-interfaces="http://org/openroadm/interfaces">org-openroadm-interfaces:opticalTransport</triggering-interface>
+      <pm-name-prefix>opticalPowerInput</pm-name-prefix>
+      <!--This PM is generated on ROADMs on creation of a NMC (MediaChannel) interface nmc-ttp-DEGX-TTP-[RX/TXRX]-[frequency]-->
+      <analog>true</analog>
+      <!--Default value is purely indicative, the value shall be set trough pm-interact RPC according to a value calculated from span loss and Power mask -->
+      <!--The value set through the RPC will be the value to keep as a reference out of any forced mode use to simulate a failure -->
+      <default-current-value>-17.0</default-current-value>
+      <max-value>-9.0</max-value>
+      <min-value>-25.0</min-value>
+      <!--Evolution range is a percentage of the min max range expressed in dB-->
+      <evolution-range>10</evolution-range>
+    </pm-generation-rules>
+    <pm-generation-rules>
+      <triggering-interface xmlns:org-openroadm-interfaces="http://org/openroadm/interfaces">org-openroadm-interfaces:openROADMOpticalMultiplex</triggering-interface>
+      <pm-name-prefix>opticalPowerOutput</pm-name-prefix>
+      <!--This PM is generated on ROADMs on creation of the first NMC (MediaChannel) interface nmc-ttp-DEGX-TTP-[TX/TXRX]-[frequency]-->
+      <!--Its value will be changed as additional NMC are created-->
+      <analog>true</analog>
+      <!--Default value is purely indicative, the value shall be set trough pm-interact RPC according to a value calculated from span loss and Power mask -->
+      <!--The value set through the RPC will be the value to keep as a reference out of any forced mode use to simulate a failure -->
+      <default-current-value>0</default-current-value>
+      <max-value>21.82</max-value>
+      <min-value>-9.0</min-value>
+      <!--Evolution range is a percentage of the min max range expressed in dB-->
+      <evolution-range>5</evolution-range>
+    </pm-generation-rules>
+    <pm-generation-rules>
+      <triggering-interface xmlns:org-openroadm-interfaces="http://org/openroadm/interfaces">org-openroadm-interfaces:openROADMOpticalMultiplex</triggering-interface>
+      <pm-name-prefix>opticalPowerInput</pm-name-prefix>
+      <!--This PM is generated on ROADMs on creation of a NMC (MediaChannel) interface nmc-ttp-DEGX-TTP-[RX/TXRX]-[frequency]-->
+      <analog>true</analog>
+      <!--Default value is purely indicative, the value shall be set trough pm-interact RPC according to a value calculated from span loss and Power mask -->
+      <!--The value set through the RPC will be the value to keep as a reference out of any forced mode use to simulate a failure -->
+      <default-current-value>-17.0</default-current-value>
+      <max-value>-9.0</max-value>
+      <min-value>-25.0</min-value>
+      <!--Evolution range is a percentage of the min max range expressed in dB-->
+      <evolution-range>10</evolution-range>
+    </pm-generation-rules>
+  </current-pm-description>
+
  </data>
index d09d3906706dead55083c48289efad162aee4d4a..26b766ddf9dd61bb321002597052b6e7ee4ff718 100644 (file)
       </connection-ports>
     </degree>
   </org-openroadm-device>
- </data>
+
+  <current-pm-list xmlns="http://org/openroadm/pm">
+  <current-pm-entry>
+    <pm-resource-instance xmlns:d="http://org/openroadm/device">/d:org-openroadm-device/d:interface[d:name='OTS-DEG1-TTP-TXRX']</pm-resource-instance>
+    <pm-resource-type>interface</pm-resource-type>
+    <pm-resource-type-extension></pm-resource-type-extension>
+    <retrieval-time>2018-06-07T13:22:58+00:00</retrieval-time>
+    <current-pm>
+      <type>opticalPowerOutput</type>
+      <extension></extension>
+      <location>nearEnd</location>
+      <direction>tx</direction>
+      <measurement>
+        <granularity>15min</granularity>
+        <pmParameterValue>2.5</pmParameterValue>
+        <pmParameterUnit>dBm</pmParameterUnit>
+        <validity>complete</validity>
+      </measurement>
+      <measurement>
+        <granularity>24Hour</granularity>
+        <pmParameterValue>2.23</pmParameterValue>
+        <pmParameterUnit>dBm</pmParameterUnit>
+        <validity>complete</validity>
+      </measurement>
+    </current-pm>
+    <current-pm>
+      <type>opticalPowerInput</type>
+      <extension></extension>
+      <location>nearEnd</location>
+      <direction>rx</direction>
+      <measurement>
+        <granularity>15min</granularity>
+        <pmParameterValue>-21.1</pmParameterValue>
+        <pmParameterUnit>dBm</pmParameterUnit>
+        <validity>complete</validity>
+      </measurement>
+      <measurement>
+        <granularity>24Hour</granularity>
+        <pmParameterValue>-49.3</pmParameterValue>
+        <pmParameterUnit>dBm</pmParameterUnit>
+        <validity>complete</validity>
+      </measurement>
+    </current-pm>
+    <current-pm>
+      <type>opticalReturnLoss</type>
+      <extension></extension>
+      <location>nearEnd</location>
+      <direction>rx</direction>
+      <measurement>
+        <granularity>15min</granularity>
+        <pmParameterValue>40</pmParameterValue>
+        <pmParameterUnit>dBm</pmParameterUnit>
+        <validity>complete</validity>
+      </measurement>
+      <measurement>
+        <granularity>24Hour</granularity>
+        <pmParameterValue>44</pmParameterValue>
+        <pmParameterUnit>dBm</pmParameterUnit>
+        <validity>complete</validity>
+      </measurement>
+    </current-pm>
+  </current-pm-entry>
+  <current-pm-entry>
+    <pm-resource-instance xmlns:d="http://org/openroadm/device">/d:org-openroadm-device/d:interface[d:name='OTS-DEG2-TTP-TXRX']</pm-resource-instance>
+    <pm-resource-type>interface</pm-resource-type>
+    <pm-resource-type-extension></pm-resource-type-extension>
+    <retrieval-time>2018-06-07T13:22:58+00:00</retrieval-time>
+    <current-pm>
+      <type>opticalPowerOutput</type>
+      <extension></extension>
+      <location>nearEnd</location>
+      <direction>tx</direction>
+      <measurement>
+        <granularity>15min</granularity>
+        <pmParameterValue>2.5</pmParameterValue>
+        <pmParameterUnit>dBm</pmParameterUnit>
+        <validity>complete</validity>
+      </measurement>
+      <measurement>
+        <granularity>24Hour</granularity>
+        <pmParameterValue>2.23</pmParameterValue>
+        <pmParameterUnit>dBm</pmParameterUnit>
+        <validity>complete</validity>
+      </measurement>
+    </current-pm>
+    <current-pm>
+      <type>opticalPowerInput</type>
+      <extension></extension>
+      <location>nearEnd</location>
+      <direction>rx</direction>
+      <measurement>
+        <granularity>15min</granularity>
+        <pmParameterValue>-21.1</pmParameterValue>
+        <pmParameterUnit>dBm</pmParameterUnit>
+        <validity>complete</validity>
+      </measurement>
+      <measurement>
+        <granularity>24Hour</granularity>
+        <pmParameterValue>-49.3</pmParameterValue>
+        <pmParameterUnit>dBm</pmParameterUnit>
+        <validity>complete</validity>
+      </measurement>
+    </current-pm>
+    <current-pm>
+      <type>opticalReturnLoss</type>
+      <extension></extension>
+      <location>nearEnd</location>
+      <direction>rx</direction>
+      <measurement>
+        <granularity>15min</granularity>
+        <pmParameterValue>40</pmParameterValue>
+        <pmParameterUnit>dBm</pmParameterUnit>
+        <validity>complete</validity>
+      </measurement>
+      <measurement>
+        <granularity>24Hour</granularity>
+        <pmParameterValue>44</pmParameterValue>
+        <pmParameterUnit>dBm</pmParameterUnit>
+        <validity>complete</validity>
+      </measurement>
+    </current-pm>
+  </current-pm-entry>
+  </current-pm-list>
+
+  <current-pm-description xmlns="http://honeynode-simulator/pm-handling">
+    <pm-generation-rules>
+      <triggering-interface xmlns:org-openroadm-interfaces="http://org/openroadm/interfaces">org-openroadm-interfaces:opticalTransport</triggering-interface>
+      <pm-name-prefix>opticalPowerOutput</pm-name-prefix>
+      <!--This PM is generated on ROADMs on creation of the first NMC (MediaChannel) interface nmc-ttp-DEGX-TTP-[TX/TXRX]-[frequency]-->
+      <!--Its value will be changed as additional NMC are created-->
+      <analog>true</analog>
+      <!--Default value is purely indicative, the value shall be set trough pm-interact RPC according to a value calculated from span loss and Power mask -->
+      <!--The value set through the RPC will be the value to keep as a reference out of any forced mode use to simulate a failure -->
+      <default-current-value>0</default-current-value>
+      <max-value>21.82</max-value>
+      <min-value>-9.0</min-value>
+      <!--Evolution range is a percentage of the min max range expressed in dB-->
+      <evolution-range>5</evolution-range>
+    </pm-generation-rules>
+    <pm-generation-rules>
+      <triggering-interface xmlns:org-openroadm-interfaces="http://org/openroadm/interfaces">org-openroadm-interfaces:opticalTransport</triggering-interface>
+      <pm-name-prefix>opticalPowerInput</pm-name-prefix>
+      <!--This PM is generated on ROADMs on creation of a NMC (MediaChannel) interface nmc-ttp-DEGX-TTP-[RX/TXRX]-[frequency]-->
+      <analog>true</analog>
+      <!--Default value is purely indicative, the value shall be set trough pm-interact RPC according to a value calculated from span loss and Power mask -->
+      <!--The value set through the RPC will be the value to keep as a reference out of any forced mode use to simulate a failure -->
+      <default-current-value>-17.0</default-current-value>
+      <max-value>-9.0</max-value>
+      <min-value>-25.0</min-value>
+      <!--Evolution range is a percentage of the min max range expressed in dB-->
+      <evolution-range>10</evolution-range>
+    </pm-generation-rules>
+    <pm-generation-rules>
+      <triggering-interface xmlns:org-openroadm-interfaces="http://org/openroadm/interfaces">org-openroadm-interfaces:openROADMOpticalMultiplex</triggering-interface>
+      <pm-name-prefix>opticalPowerOutput</pm-name-prefix>
+      <!--This PM is generated on ROADMs on creation of the first NMC (MediaChannel) interface nmc-ttp-DEGX-TTP-[TX/TXRX]-[frequency]-->
+      <!--Its value will be changed as additional NMC are created-->
+      <analog>true</analog>
+      <!--Default value is purely indicative, the value shall be set trough pm-interact RPC according to a value calculated from span loss and Power mask -->
+      <!--The value set through the RPC will be the value to keep as a reference out of any forced mode use to simulate a failure -->
+      <default-current-value>0</default-current-value>
+      <max-value>21.82</max-value>
+      <min-value>-9.0</min-value>
+      <!--Evolution range is a percentage of the min max range expressed in dB-->
+      <evolution-range>5</evolution-range>
+    </pm-generation-rules>
+    <pm-generation-rules>
+      <triggering-interface xmlns:org-openroadm-interfaces="http://org/openroadm/interfaces">org-openroadm-interfaces:openROADMOpticalMultiplex</triggering-interface>
+      <pm-name-prefix>opticalPowerInput</pm-name-prefix>
+      <!--This PM is generated on ROADMs on creation of a NMC (MediaChannel) interface nmc-ttp-DEGX-TTP-[RX/TXRX]-[frequency]-->
+      <analog>true</analog>
+      <!--Default value is purely indicative, the value shall be set trough pm-interact RPC according to a value calculated from span loss and Power mask -->
+      <!--The value set through the RPC will be the value to keep as a reference out of any forced mode use to simulate a failure -->
+      <default-current-value>-17.0</default-current-value>
+      <max-value>-9.0</max-value>
+      <min-value>-25.0</min-value>
+      <!--Evolution range is a percentage of the min max range expressed in dB-->
+      <evolution-range>10</evolution-range>
+    </pm-generation-rules>
+  </current-pm-description>
+
+</data>
index bbd709d524c2fe57ae536236b969dad3d273a39d..47f8f1e367f4267c29013b273cdf9365d9b55cf7 100644 (file)
   </current-pm-entry>
   </current-pm-list>
 
- </data>
+  <current-pm-description xmlns="http://honeynode-simulator/pm-handling">
+    <pm-generation-rules>
+      <triggering-interface xmlns:org-openroadm-interfaces="http://org/openroadm/interfaces">org-openroadm-interfaces:opticalTransport</triggering-interface>
+      <pm-name-prefix>opticalPowerOutput</pm-name-prefix>
+      <!--This PM is generated on ROADMs on creation of the first NMC (MediaChannel) interface nmc-ttp-DEGX-TTP-[TX/TXRX]-[frequency]-->
+      <!--Its value will be changed as additional NMC are created-->
+      <analog>true</analog>
+      <!--Default value is purely indicative, the value shall be set trough pm-interact RPC according to a value calculated from span loss and Power mask -->
+      <!--The value set through the RPC will be the value to keep as a reference out of any forced mode use to simulate a failure -->
+      <default-current-value>0</default-current-value>
+      <max-value>21.82</max-value>
+      <min-value>-9.0</min-value>
+      <!--Evolution range is a percentage of the min max range expressed in dB-->
+      <evolution-range>5</evolution-range>
+    </pm-generation-rules>
+    <pm-generation-rules>
+      <triggering-interface xmlns:org-openroadm-interfaces="http://org/openroadm/interfaces">org-openroadm-interfaces:opticalTransport</triggering-interface>
+      <pm-name-prefix>opticalPowerInput</pm-name-prefix>
+      <!--This PM is generated on ROADMs on creation of a NMC (MediaChannel) interface nmc-ttp-DEGX-TTP-[RX/TXRX]-[frequency]-->
+      <analog>true</analog>
+      <!--Default value is purely indicative, the value shall be set trough pm-interact RPC according to a value calculated from span loss and Power mask -->
+      <!--The value set through the RPC will be the value to keep as a reference out of any forced mode use to simulate a failure -->
+      <default-current-value>-17.0</default-current-value>
+      <max-value>-9.0</max-value>
+      <min-value>-25.0</min-value>
+      <!--Evolution range is a percentage of the min max range expressed in dB-->
+      <evolution-range>10</evolution-range>
+    </pm-generation-rules>
+    <pm-generation-rules>
+      <triggering-interface xmlns:org-openroadm-interfaces="http://org/openroadm/interfaces">org-openroadm-interfaces:openROADMOpticalMultiplex</triggering-interface>
+      <pm-name-prefix>opticalPowerOutput</pm-name-prefix>
+      <!--This PM is generated on ROADMs on creation of the first NMC (MediaChannel) interface nmc-ttp-DEGX-TTP-[TX/TXRX]-[frequency]-->
+      <!--Its value will be changed as additional NMC are created-->
+      <analog>true</analog>
+      <!--Default value is purely indicative, the value shall be set trough pm-interact RPC according to a value calculated from span loss and Power mask -->
+      <!--The value set through the RPC will be the value to keep as a reference out of any forced mode use to simulate a failure -->
+      <default-current-value>0</default-current-value>
+      <max-value>21.82</max-value>
+      <min-value>-9.0</min-value>
+      <!--Evolution range is a percentage of the min max range expressed in dB-->
+      <evolution-range>5</evolution-range>
+    </pm-generation-rules>
+    <pm-generation-rules>
+      <triggering-interface xmlns:org-openroadm-interfaces="http://org/openroadm/interfaces">org-openroadm-interfaces:openROADMOpticalMultiplex</triggering-interface>
+      <pm-name-prefix>opticalPowerInput</pm-name-prefix>
+      <!--This PM is generated on ROADMs on creation of a NMC (MediaChannel) interface nmc-ttp-DEGX-TTP-[RX/TXRX]-[frequency]-->
+      <analog>true</analog>
+      <!--Default value is purely indicative, the value shall be set trough pm-interact RPC according to a value calculated from span loss and Power mask -->
+      <!--The value set through the RPC will be the value to keep as a reference out of any forced mode use to simulate a failure -->
+      <default-current-value>-17.0</default-current-value>
+      <max-value>-9.0</max-value>
+      <min-value>-25.0</min-value>
+      <!--Evolution range is a percentage of the min max range expressed in dB-->
+      <evolution-range>10</evolution-range>
+    </pm-generation-rules>
+  </current-pm-description>
+
+</data>