- private void readIncludeNodes(List<OrderedHops> listHops, PceConstraints constraints) {
- for (int i = 0; i < listHops.size(); i++) {
- HopType hoptype = listHops.get(i).getHopType().getHopType();
-
- String hopt = hoptype.implementedInterface().getSimpleName();
- LOG.info("in readIncludeNodes next hop to include {}", hopt);
- switch (hopt) {
- case "Node":
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev171017.ordered.constraints.sp.hop.type.hop.type.Node
- node = (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
- .constraints.rev171017.ordered.constraints.sp.hop.type.hop.type.Node) hoptype;
- constraints.setListToInclude(constraints.new ResourcePair(PceConstraints.ResourceType.NODE,
- node.getNodeId()));
- break;
- case "SRLG":
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev171017.ordered.constraints.sp.hop.type.hop.type.SRLG
- srlg = (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
- .constraints.rev171017.ordered.constraints.sp.hop.type.hop.type.SRLG) hoptype;
- constraints.setListToInclude(constraints.new ResourcePair(PceConstraints.ResourceType.SRLG,
- srlg.getSRLG()));
- break;
- case "Clli":
- org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
- .rev171017.ordered.constraints.sp.hop.type.hop.type.Clli
- clli = (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
- .constraints.rev171017.ordered.constraints.sp.hop.type.hop.type.Clli) hoptype;
- constraints.setListToInclude(constraints.new ResourcePair(PceConstraints.ResourceType.CLLI,
- clli.getClli()));
- break;
- default:
- LOG.error("in readIncludeNodes unsupported include type {}", hopt);
+ private void readInclude(Include include, PceConstraints constraints) {
+ List<NodeIdType> nodes = include.getNodeId();
+ if (nodes != null) {
+ for (NodeIdType node : nodes) {
+ constraints.setListToInclude(new ResourcePair(PceConstraints.ResourceType.NODE, node.getValue()));
+ }
+ }
+ List<Uint32> srlgs = include.getSrlgId();
+ if (srlgs != null) {
+ for (Uint32 srlg : srlgs) {
+ constraints.setListToInclude(new ResourcePair(PceConstraints.ResourceType.SRLG, srlg.toString()));
+ }
+ }
+ List<String> sites = include.getSite();
+ if (sites != null) {
+ for (String site : sites) {
+ constraints.setListToInclude(new ResourcePair(PceConstraints.ResourceType.CLLI, site));