X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=servicehandler%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fservicehandler%2FMappingConstraints.java;h=4b561e3c2f5b138b49e2edea6ac1c55f3fd2dfe3;hb=98dda60c2cd59d7c7dd8dba35d7d80473862646d;hp=a9f8749e36765af336268188e16ef7b4c00c169c;hpb=0779ad5796bb645690874959c9a891c42e2f7175;p=transportpce.git diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/MappingConstraints.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/MappingConstraints.java index a9f8749e3..4b561e3c2 100644 --- a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/MappingConstraints.java +++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/MappingConstraints.java @@ -9,25 +9,28 @@ package org.opendaylight.transportpce.servicehandler; -import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.Constraints; -import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.constraints.CoRoutingOrGeneral; -import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.constraints.co.routing.or.general.CoRouting; -import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.constraints.co.routing.or.general.General; -import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.constraints.co.routing.or.general.general.Diversity; -import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.constraints.co.routing.or.general.general.Exclude; -import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.constraints.co.routing.or.general.general.Include; -import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.constraints.co.routing.or.general.general.Latency; -import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.HardConstraints; -import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.SoftConstraints; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.ConstraintsSp; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.general.DiversityBuilder; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.general.ExcludeBuilder; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.general.IncludeBuilder; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.general.LatencyBuilder; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.diversity.existing.service.contraints.sp.ExistingServiceApplicabilityBuilder; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.HardConstraintsBuilder; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.SoftConstraintsBuilder; +import java.util.ArrayList; +import java.util.List; +import org.opendaylight.yang.gen.v1.http.org.openroadm.common.node.types.rev181130.NodeIdType; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.Constraints; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.CoRoutingOrGeneral; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co.routing.or.general.CoRouting; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co.routing.or.general.General; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co.routing.or.general.general.Diversity; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co.routing.or.general.general.Exclude; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co.routing.or.general.general.Include; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co.routing.or.general.general.Latency; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.routing.constraints.HardConstraints; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.routing.constraints.SoftConstraints; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.ConstraintsSp; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.constraints.sp.co.routing.or.general.general.DiversityBuilder; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.constraints.sp.co.routing.or.general.general.ExcludeBuilder; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.constraints.sp.co.routing.or.general.general.IncludeBuilder; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.constraints.sp.co.routing.or.general.general.LatencyBuilder; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.diversity.existing.service.contraints.sp.ExistingServiceApplicabilityBuilder; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.routing.constraints.sp.HardConstraintsBuilder; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.routing.constraints.sp.SoftConstraintsBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -43,10 +46,10 @@ public class MappingConstraints { private static final Logger LOG = LoggerFactory.getLogger(MappingConstraints.class); private HardConstraints serviceHardConstraints; private SoftConstraints serviceSoftConstraints; - private org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface - .routing.constraints.rev171017.routing.constraints.sp.HardConstraints servicePathHardConstraints; - private org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface - .routing.constraints.rev171017.routing.constraints.sp.SoftConstraints servicePathSoftConstraints; + private org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.routing + .constraints.sp.HardConstraints servicePathHardConstraints; + private org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.routing + .constraints.sp.SoftConstraints servicePathSoftConstraints; /** * MappingConstraints class constructor @@ -67,10 +70,11 @@ public class MappingConstraints { * @param hard HardConstraints * @param soft SoftConstraints */ - public MappingConstraints(org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface - .routing.constraints.rev171017.routing.constraints.sp.HardConstraints hard, - org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface - .routing.constraints.rev171017.routing.constraints.sp.SoftConstraints soft) { + public MappingConstraints( + org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.routing + .constraints.sp.HardConstraints hard, + org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.routing + .constraints.sp.SoftConstraints soft) { setServicePathHardConstraints(hard); setServicePathSoftConstraints(soft); } @@ -84,88 +88,10 @@ public class MappingConstraints { * @return ConstraintsSp HardConstraintsSp or HardConstraintsSp */ private ConstraintsSp getConstraints(T input) { - CoRoutingOrGeneral coRoutingOrGeneral = null; HardConstraintsBuilder tempHard = new HardConstraintsBuilder(); SoftConstraintsBuilder tempSoft = new SoftConstraintsBuilder(); if ((input != null) && (input instanceof Constraints)) { - Constraints constraints = (Constraints)input; - coRoutingOrGeneral = constraints.getCoRoutingOrGeneral(); - General tmpGeneral = null; - CoRouting tmpCoRouting = null; - if (coRoutingOrGeneral != null) { - org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints - .rev171017.constraints.sp.co.routing.or.general.GeneralBuilder finalGeneral = - new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints - .rev171017.constraints.sp.co.routing.or.general.GeneralBuilder(); - org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints - .rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder finalCoRouting = - new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints - .rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder(); - if (coRoutingOrGeneral instanceof General) { - tmpGeneral = (General) coRoutingOrGeneral; - if (tmpGeneral != null) { - Diversity tmpDiversity = tmpGeneral.getDiversity(); - if (tmpDiversity != null) { - finalGeneral.setDiversity( - new DiversityBuilder() - .setExistingService(tmpDiversity.getExistingService()) - .setExistingServiceApplicability( - new ExistingServiceApplicabilityBuilder() - .setClli(tmpDiversity.getExistingServiceApplicability().isSite()) - .setNode(tmpDiversity.getExistingServiceApplicability().isNode()) - .setSrlg(tmpDiversity.getExistingServiceApplicability().isSrlg()) - .build()) - .build()); - } - Exclude tmpExclude = tmpGeneral.getExclude(); - if (tmpExclude != null) { - finalGeneral.setExclude( - new ExcludeBuilder() - .setSupportingServiceName(tmpExclude.getSupportingServiceName()) - .setClli(tmpExclude.getSite()) - .setNodeId(tmpExclude.getNodeId()) - //.setAffinity(value) - //.setSRLG(value) - .build()); - } - Include tmpInclude = tmpGeneral.getInclude(); - if (tmpInclude != null) { - finalGeneral.setInclude( - new IncludeBuilder() - //.setOrderedHops() - .build()); - } - Latency tmpLatency = tmpGeneral.getLatency(); - if (tmpLatency != null) { - finalGeneral.setLatency( - new LatencyBuilder() - .setMaxLatency(tmpLatency.getMaxLatency()) - .build()); - } - } - tempHard.setCoRoutingOrGeneral(finalGeneral.build()) - .setCustomerCode(constraints.getCustomerCode()); - tempSoft.setCoRoutingOrGeneral(finalGeneral.build()) - .setCustomerCode(constraints.getCustomerCode()); - } else if (coRoutingOrGeneral instanceof CoRouting) { - tmpCoRouting = (CoRouting)coRoutingOrGeneral; - if (tmpCoRouting != null) { - org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014 - .constraints.co.routing.or.general.co.routing.CoRouting tmpCoRoutingCoRouting = - tmpCoRouting.getCoRouting(); - if (tmpCoRoutingCoRouting != null) { - finalCoRouting.setCoRouting( - new CoRoutingBuilder() - .setExistingService(tmpCoRoutingCoRouting.getExistingService()) - .build()); - } - } - tempHard.setCoRoutingOrGeneral(finalCoRouting.build()) - .setCustomerCode(constraints.getCustomerCode()); - tempSoft.setCoRoutingOrGeneral(finalCoRouting.build()) - .setCustomerCode(constraints.getCustomerCode()); - } - } + updateConstraintBuilders(input, tempHard, tempSoft); } if (input instanceof HardConstraints) { return tempHard.build(); @@ -176,182 +102,135 @@ public class MappingConstraints { } } + /** + * Update hardConstraintsBuilder and softConstraintsBuilder regarding input. + * @param T + * @param input T + * @param hardConstraintsBuilder HardConstraintsBuilder + * @param softConstraintsBuilder SoftConstraintsBuilder + */ + private void updateConstraintBuilders(T input, + HardConstraintsBuilder hardConstraintsBuilder, + SoftConstraintsBuilder softConstraintsBuilder) { + Constraints constraints = (Constraints)input; + CoRoutingOrGeneral coRoutingOrGeneral = constraints.getCoRoutingOrGeneral(); + if (coRoutingOrGeneral != null) { + if (coRoutingOrGeneral instanceof General) { + updateConstraintBuilders4General(hardConstraintsBuilder, softConstraintsBuilder, constraints); + } else if (coRoutingOrGeneral instanceof CoRouting) { + updateConstraintBuilders4Corouting(hardConstraintsBuilder, softConstraintsBuilder, constraints); + } + } + } + + /** + * Update hardConstraintsBuilder and softConstraintsBuilder for corouting constraints. + * @param hardConstraintsBuilder HardConstraintsBuilder + * @param softConstraintsBuilder SoftConstraintsBuilder + * @param constraints Constraints + */ + private void updateConstraintBuilders4Corouting(HardConstraintsBuilder hardConstraintsBuilder, + SoftConstraintsBuilder softConstraintsBuilder, Constraints constraints) { + org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.constraints.sp + .co.routing.or.general.CoRoutingBuilder finalCoRouting = + new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118 + .constraints.sp.co.routing.or.general.CoRoutingBuilder(); + CoRouting tmpCoRouting = (CoRouting)constraints.getCoRoutingOrGeneral(); + if (tmpCoRouting != null) { + org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co.routing.or + .general.co.routing.CoRouting tmpCoRoutingCoRouting = tmpCoRouting.getCoRouting(); + if (tmpCoRoutingCoRouting != null) { + finalCoRouting.setCoRouting(new CoRoutingBuilder() + .setExistingService(tmpCoRoutingCoRouting.getExistingService()) + .build()); + } + } + hardConstraintsBuilder + .setCoRoutingOrGeneral(finalCoRouting.build()) + .setCustomerCode(constraints.getCustomerCode()); + softConstraintsBuilder + .setCoRoutingOrGeneral(finalCoRouting.build()) + .setCustomerCode(constraints.getCustomerCode()); + } + + /** + * Update hardConstraintsBuilder and softConstraintsBuilder for general constraints. + * @param hardConstraintsBuilder HardConstraintsBuilder + * @param softConstraintsBuilder SoftConstraintsBuilder + * @param constraints Constraints + */ + private void updateConstraintBuilders4General(HardConstraintsBuilder hardConstraintsBuilder, + SoftConstraintsBuilder softConstraintsBuilder, Constraints constraints) { + org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.constraints.sp + .co.routing.or.general.GeneralBuilder finalGeneral = + new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118 + .constraints.sp.co.routing.or.general.GeneralBuilder(); + General tmpGeneral = (General) constraints.getCoRoutingOrGeneral(); + if (tmpGeneral != null) { + Diversity tmpDiversity = tmpGeneral.getDiversity(); + if (tmpDiversity != null) { + finalGeneral.setDiversity( + new DiversityBuilder() + .setExistingService(tmpDiversity.getExistingService()) + .setExistingServiceApplicability( + new ExistingServiceApplicabilityBuilder() + .setClli(tmpDiversity.getExistingServiceApplicability().getSite()) + .setNode(tmpDiversity.getExistingServiceApplicability().getNode()) + .setSrlg(tmpDiversity.getExistingServiceApplicability().getSrlg()) + .build()) + .build()); + } + Exclude tmpExclude = tmpGeneral.getExclude(); + if (tmpExclude != null) { + List nodeIdList = new ArrayList<>(); + for (NodeIdType nodeId : tmpExclude.getNodeId()) { + nodeIdList.add(nodeId.getValue()); + } + finalGeneral.setExclude( + new ExcludeBuilder() + .setSupportingServiceName(tmpExclude.getSupportingServiceName()) + .setClli(tmpExclude.getSite()) + .setNodeId(nodeIdList) + .build()); + } + Include tmpInclude = tmpGeneral.getInclude(); + if (tmpInclude != null) { + finalGeneral.setInclude( + new IncludeBuilder() + .build()); + } + Latency tmpLatency = tmpGeneral.getLatency(); + if (tmpLatency != null) { + finalGeneral.setLatency( + new LatencyBuilder() + .setMaxLatency(tmpLatency.getMaxLatency()) + .build()); + } + } + hardConstraintsBuilder.setCoRoutingOrGeneral(finalGeneral.build()) + .setCustomerCode(constraints.getCustomerCode()); + softConstraintsBuilder.setCoRoutingOrGeneral(finalGeneral.build()) + .setCustomerCode(constraints.getCustomerCode()); + } + /** * map hard/soft constraints from Service 1.2 * to ServicePath 1.4. */ public void serviceToServicePathConstarints() { LOG.info("Mapping Service Constraints to ServicePath Constraints"); - //CoRoutingOrGeneral coRoutingOrGeneral = null; if (serviceHardConstraints != null) { - /*HardConstraintsBuilder tempHard = new HardConstraintsBuilder(); - coRoutingOrGeneral = serviceHardConstraints.getCoRoutingOrGeneral(); - General tmpGeneral = null; - CoRouting tmpCoRouting = null; - if (coRoutingOrGeneral != null) { - org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints - .rev171017.constraints.sp.co.routing.or.general.GeneralBuilder finalGeneral = - new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints - .rev171017.constraints.sp.co.routing.or.general.GeneralBuilder(); - org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints - .rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder finalCoRouting = - new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints - .rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder(); - if (coRoutingOrGeneral instanceof General) { - tmpGeneral = (General) coRoutingOrGeneral; - if (tmpGeneral != null) { - Diversity tmpDiversity = tmpGeneral.getDiversity(); - if (tmpDiversity != null) { - finalGeneral.setDiversity( - new DiversityBuilder() - .setExistingService(tmpDiversity.getExistingService()) - .setExistingServiceApplicability( - new ExistingServiceApplicabilityBuilder() - .setClli(tmpDiversity.getExistingServiceApplicability().isSite()) - .setNode(tmpDiversity.getExistingServiceApplicability().isNode()) - .setSrlg(tmpDiversity.getExistingServiceApplicability().isSrlg()) - .build()) - .build()); - } - Exclude tmpExclude = tmpGeneral.getExclude(); - if (tmpExclude != null) { - finalGeneral.setExclude( - new ExcludeBuilder() - .setSupportingServiceName(tmpExclude.getSupportingServiceName()) - .setClli(tmpExclude.getSite()) - .setNodeId(tmpExclude.getNodeId()) - //.setAffinity(value) - //.setSRLG(value) - .build()); - } - Include tmpInclude = tmpGeneral.getInclude(); - if (tmpInclude != null) { - finalGeneral.setInclude( - new IncludeBuilder() - //.setOrderedHops() - .build()); - } - Latency tmpLatency = tmpGeneral.getLatency(); - if (tmpLatency != null) { - finalGeneral.setLatency( - new LatencyBuilder() - .setMaxLatency(tmpLatency.getMaxLatency()) - .build()); - } - } - tempHard - .setCoRoutingOrGeneral(finalGeneral.build()) - .setCustomerCode(serviceHardConstraints.getCustomerCode()); - } else if (coRoutingOrGeneral instanceof CoRouting) { - tmpCoRouting = (CoRouting)coRoutingOrGeneral; - if (tmpCoRouting != null) { - org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014 - .constraints.co.routing.or.general.co.routing.CoRouting tmpCoRoutingCoRouting = - tmpCoRouting.getCoRouting(); - if (tmpCoRoutingCoRouting != null) { - finalCoRouting.setCoRouting( - new CoRoutingBuilder() - .setExistingService(tmpCoRoutingCoRouting.getExistingService()) - .build()); - } - } - tempHard - .setCoRoutingOrGeneral(finalCoRouting.build()) - .setCustomerCode(serviceHardConstraints.getCustomerCode()); - - } - } - servicePathHardConstraints = tempHard.build();*/ - - org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints - .rev171017.routing.constraints.sp.HardConstraints tempHard = (org.opendaylight.yang.gen - .v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing + org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.routing + .constraints.sp.HardConstraints tempHard = + (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.routing .constraints.sp.HardConstraints) getConstraints(serviceHardConstraints); if (tempHard != null) { servicePathHardConstraints = tempHard; } } else if (serviceSoftConstraints != null) { - /*oftConstraintsBuilder tempSoft = new SoftConstraintsBuilder(); - coRoutingOrGeneral = serviceSoftConstraints.getCoRoutingOrGeneral(); - General tmpGeneral = null; - CoRouting tmpCoRouting = null; - if (coRoutingOrGeneral != null) { - org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints - .rev171017.constraints.sp.co.routing.or.general.GeneralBuilder finalGeneral = - new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints - .rev171017.constraints.sp.co.routing.or.general.GeneralBuilder(); - org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints - .rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder finalCoRouting = - new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints - .rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder(); - if (coRoutingOrGeneral instanceof General) { - tmpGeneral = (General) coRoutingOrGeneral; - if (tmpGeneral != null) { - Diversity tmpDiversity = tmpGeneral.getDiversity(); - if (tmpDiversity != null) { - finalGeneral.setDiversity( - new DiversityBuilder() - .setExistingService(tmpDiversity.getExistingService()) - .setExistingServiceApplicability( - new ExistingServiceApplicabilityBuilder() - .setClli(tmpDiversity.getExistingServiceApplicability().isSite()) - .setNode(tmpDiversity.getExistingServiceApplicability().isNode()) - .setSrlg(tmpDiversity.getExistingServiceApplicability().isSrlg()) - .build()) - .build()); - } - Exclude tmpExclude = tmpGeneral.getExclude(); - if (tmpExclude != null) { - finalGeneral.setExclude( - new ExcludeBuilder() - .setSupportingServiceName(tmpExclude.getSupportingServiceName()) - .setClli(tmpExclude.getSite()) - .setNodeId(tmpExclude.getNodeId()) - //.setAffinity(value) - //.setSRLG(value) - .build()); - } - Include tmpInclude = tmpGeneral.getInclude(); - if (tmpInclude != null) { - finalGeneral.setInclude( - new IncludeBuilder() - //.setOrderedHops() - .build()); - } - Latency tmpLatency = tmpGeneral.getLatency(); - if (tmpLatency != null) { - finalGeneral.setLatency( - new LatencyBuilder() - .setMaxLatency(tmpLatency.getMaxLatency()) - .build()); - } - } - tempSoft - .setCoRoutingOrGeneral(finalGeneral.build()) - .setCustomerCode(serviceSoftConstraints.getCustomerCode()); - } else if (coRoutingOrGeneral instanceof CoRouting) { - tmpCoRouting = (CoRouting)coRoutingOrGeneral; - if (tmpCoRouting != null) { - org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014 - .constraints.co.routing.or.general.co.routing.CoRouting tmpCoRoutingCoRouting = - tmpCoRouting.getCoRouting(); - if (tmpCoRoutingCoRouting != null) { - finalCoRouting.setCoRouting( - new CoRoutingBuilder() - .setExistingService(tmpCoRoutingCoRouting.getExistingService()) - .build()); - } - } - tempSoft - .setCoRoutingOrGeneral(finalCoRouting.build()) - .setCustomerCode(serviceSoftConstraints.getCustomerCode()); - - } - } - servicePathSoftConstraints = tempSoft.build();*/ - org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints - .rev171017.routing.constraints.sp.SoftConstraints tempSoft = (org.opendaylight.yang.gen - .v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing + org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.routing + .constraints.sp.SoftConstraints tempSoft = + (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.routing .constraints.sp.SoftConstraints) getConstraints(serviceSoftConstraints); if (tempSoft != null) { servicePathSoftConstraints = tempSoft; @@ -381,25 +260,25 @@ public class MappingConstraints { public org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface - .routing.constraints.rev171017.routing.constraints.sp.HardConstraints getServicePathHardConstraints() { + .routing.constraints.rev220118.routing.constraints.sp.HardConstraints getServicePathHardConstraints() { return servicePathHardConstraints; } public void setServicePathHardConstraints(org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface - .routing.constraints.rev171017.routing.constraints.sp.HardConstraints servicePathHardConstraints) { + .routing.constraints.rev220118.routing.constraints.sp.HardConstraints servicePathHardConstraints) { this.servicePathHardConstraints = servicePathHardConstraints; } public org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface - .routing.constraints.rev171017.routing.constraints.sp.SoftConstraints getServicePathSoftConstraints() { + .routing.constraints.rev220118.routing.constraints.sp.SoftConstraints getServicePathSoftConstraints() { return servicePathSoftConstraints; } public void setServicePathSoftConstraints(org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface - .routing.constraints.rev171017.routing.constraints.sp.SoftConstraints servicePathSoftConstraints) { + .routing.constraints.rev220118.routing.constraints.sp.SoftConstraints servicePathSoftConstraints) { this.servicePathSoftConstraints = servicePathSoftConstraints; }