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;
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()) {
--- /dev/null
+/*
+ * 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 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;
+ }
+ for (Map.Entry<SpectrumFillingRulesKey, SpectrumFillingRules> rule:
+ spectrumConstraint.getSpectrumFillingRules().entrySet()) {
+ FrequencyTHz startFreq = rule.getValue().getSpectrumRangeOfAppliance().getStartEdgeFrequency();
+ FrequencyTHz stopFreq = rule.getValue().getSpectrumRangeOfAppliance().getStopEdgeFrequency();
+ if (customerName != null
+ && rule.getValue().getSpectrumRangeOfAppliance().getNonAuthorizedCustomer() != null
+ && rule.getValue().getSpectrumRangeOfAppliance().getNonAuthorizedCustomer()
+ .contains(customerName)) {
+ //Customer shall not be put in this spectrum portion
+ referenceBitSet.set(
+ GridUtils.getIndexFromFrequency(startFreq.getValue()),
+ GridUtils.getIndexFromFrequency(stopFreq.getValue()), false);
+ LOG.info("Specific Spectrum filling Rules have been defined for customer {}, exluding it from "
+ + "the spectrum range {} - {} ", customerName, startFreq.toString(), stopFreq.toString());
+ } else if (customerName != null
+ && rule.getValue().getSpectrumRangeOfAppliance().getDedicatedCustomer() != null
+ && rule.getValue().getSpectrumRangeOfAppliance()
+ .getDedicatedCustomer().contains(customerName)) {
+ // Spectrum portion is dedicated to customers including this one
+ referenceBitSet.set(
+ GridUtils.getIndexFromFrequency(startFreq.getValue()),
+ GridUtils.getIndexFromFrequency(stopFreq.getValue()), true);
+ LOG.info("Specific Spectrum filling Rules have been defined for customer {}, to dedicate "
+ + "spectrum range {} - {} to it ", customerName, startFreq.toString(), stopFreq.toString());
+ } else if (rule.getValue().getSpectrumRangeOfAppliance().getDedicatedCustomer() != null
+ && !rule.getValue().getSpectrumRangeOfAppliance().getDedicatedCustomer().isEmpty()) {
+ // 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("Specific Spectrum filling Rules have been defined for other customers, preventing"
+ + " the customer to use spectrum range {}--{}", startFreq.toString(), stopFreq.toString());
+ }
+ }
+ return referenceBitSet;
+ }
+ } catch (InterruptedException | ExecutionException e1) {
+ LOG.error("Exception caught handling Spectrum filling Rules {} ", e1.getCause().toString());
+ }
+ LOG.info("Did not succeed finding any Specific Spectrum filling Rules defined in Configuration Datastore");
+ return referenceBitSet;
+ }
+}
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;
private Double margin = null;
PceConstraints pceHardConstraints;
private PceConstraintMode pceConstraintMode;
+ private BitSet spectrumConstraint;
// results
private PceResult pceResult = null;
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;
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);
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();
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")
pceNode.getNodeId(), pceNodeVersion, sltWdthGran, ctralFreqGran);
isFlexGrid = false;
}
+ if (spectrumConstraint != null) {
+ result.and(spectrumConstraint);
+ }
+
LOG.debug("Bitset result {}", result);
return computeBestSpectrumAssignment(result, spectralWidthSlotNumber, isFlexGrid);
}
*/
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;
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;
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 {
@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(
assertNull(pceSendingPceRPCs.getMessage());
}
+
@Test
void responseCodeTest() {
assertNull(pceSendingPceRPCs.getResponseCode());
--- /dev/null
+/*
+ * 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"));
+ }
+
+}
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));
}
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));
}
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));
}
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));
}
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));
}
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));
}
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));
}
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));
}
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);
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)
--- /dev/null
+{
+ "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"
+ ]
+ }
+ }
+ ]
+ }
+ }
+}
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();
}
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();
}
serviceFeasibilityCheckInput.getSoftConstraints(), serviceFeasibilityCheckInput.getCommonId(),
serviceFeasibilityCheckInput.getSdncRequestHeader(), serviceFeasibilityCheckInput.getServiceAEnd(),
serviceFeasibilityCheckInput.getServiceZEnd(),
- ServiceNotificationTypes.ServiceCreateResult, reserveResource);
+ ServiceNotificationTypes.ServiceCreateResult, reserveResource,
+ serviceFeasibilityCheckInput.getCustomer());
} else {
return returnPCEFailed();
}
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)
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);
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();
.setHardConstraints(hardConstraints)
.setSoftConstraints(softConstraints)
.setPceRoutingMetric(PceMetric.TEMetric)
+ .setCustomerName(customerName)
.setServiceAEnd(ModelMappingUtils.createServiceAEnd(serviceAEnd))
.setServiceZEnd(ModelMappingUtils.createServiceZEnd(serviceZEnd))
.build();