- private Uuid getNodeUuid4Photonic(Map<OwnedNodeEdgePointKey, OwnedNodeEdgePoint> onepl,
- Map<NodeRuleGroupKey, NodeRuleGroup> nodeRuleGroupList,
- Map<RuleKey, Rule> ruleList) {
- Uuid nodeUuid;
- nodeUuid = this.uuidMap.get(String.join("+", this.ietfNodeId, TapiStringConstants.OTSI));
- // iNep creation on otsi node
- for (int i = 0; i < oorNetworkPortList.size(); i++) {
- LOG.info("NEP = {}", String.join("+", this.ietfNodeId, TapiStringConstants.I_OTSI,
- oorNetworkPortList.get(i).getTpId().getValue()));
- Uuid nepUuid1 = new Uuid(UUID.nameUUIDFromBytes(
- (String.join("+", this.ietfNodeId, TapiStringConstants.I_OTSI,
- oorNetworkPortList.get(i).getTpId().getValue())).getBytes(Charset.forName("UTF-8")))
- .toString());
- this.uuidMap.put(String.join("+", this.ietfNodeId, TapiStringConstants.I_OTSI,
- oorNetworkPortList.get(i).getTpId().getValue()), nepUuid1);
- Name onedName = new NameBuilder()
- .setValueName("iNodeEdgePoint")
- .setValue(String.join("+", this.ietfNodeId, TapiStringConstants.I_OTSI,
- oorNetworkPortList.get(i).getTpId().getValue()))
- .build();
-
- OwnedNodeEdgePoint onep = createNep(oorNetworkPortList.get(i), Map.of(onedName.key(), onedName),
- LayerProtocolName.PHOTONICMEDIA, LayerProtocolName.PHOTONICMEDIA, true,
- String.join("+", this.ietfNodeId, TapiStringConstants.I_OTSI));
- onepl.put(onep.key(), onep);
- }
- // eNep creation on otsi node
- for (int i = 0; i < oorNetworkPortList.size(); i++) {
- LOG.info("NEP = {}", String.join("+", this.ietfNodeId, TapiStringConstants.E_OTSI,
- oorNetworkPortList.get(i).getTpId().getValue()));
- Uuid nepUuid2 = new Uuid(UUID.nameUUIDFromBytes(
- (String.join("+", this.ietfNodeId, TapiStringConstants.E_OTSI,
- oorNetworkPortList.get(i).getTpId().getValue())).getBytes(Charset.forName("UTF-8")))
- .toString());
- this.uuidMap.put(String.join("+", this.ietfNodeId, TapiStringConstants.E_OTSI,
- oorNetworkPortList.get(i).getTpId().getValue()), nepUuid2);
- Name onedName = new NameBuilder()
- .setValueName("eNodeEdgePoint")
- .setValue(String.join("+", this.ietfNodeId, TapiStringConstants.E_OTSI,
- oorNetworkPortList.get(i).getTpId().getValue()))
- .build();
-
- OwnedNodeEdgePoint onep = createNep(oorNetworkPortList.get(i), Map.of(onedName.key(), onedName),
- LayerProtocolName.PHOTONICMEDIA, LayerProtocolName.PHOTONICMEDIA, false,
- String.join("+", this.ietfNodeId, TapiStringConstants.E_OTSI));
- onepl.put(onep.key(), onep);
- }
- // Photonic Media Nep creation on otsi node
- for (int i = 0; i < oorNetworkPortList.size(); i++) {
- LOG.info("NEP = {}", String.join("+", this.ietfNodeId, TapiStringConstants.PHTNC_MEDIA,
- oorNetworkPortList.get(i).getTpId().getValue()));
- Uuid nepUuid3 = new Uuid(UUID.nameUUIDFromBytes(
- (String.join("+", this.ietfNodeId, TapiStringConstants.PHTNC_MEDIA,
- oorNetworkPortList.get(i).getTpId().getValue())).getBytes(Charset.forName("UTF-8")))
- .toString());
- this.uuidMap.put(String.join("+", this.ietfNodeId, TapiStringConstants.PHTNC_MEDIA,
- oorNetworkPortList.get(i).getTpId().getValue()), nepUuid3);
- Name onedName = new NameBuilder()
- .setValueName("PhotMedNodeEdgePoint")
- .setValue(String.join("+", this.ietfNodeId, TapiStringConstants.PHTNC_MEDIA,
- oorNetworkPortList.get(i).getTpId().getValue()))
- .build();
-
- OwnedNodeEdgePoint onep = createNep(oorNetworkPortList.get(i), Map.of(onedName.key(), onedName),
- LayerProtocolName.PHOTONICMEDIA, LayerProtocolName.PHOTONICMEDIA, false,
- String.join("+", this.ietfNodeId, TapiStringConstants.PHTNC_MEDIA));
- onepl.put(onep.key(), onep);
- }
- // create NodeRuleGroup
- int count = 1;
- LOG.info("OTSi switching pool = {}", this.oorOduSwitchingPool.nonnullNonBlockingList().values());
- for (TerminationPoint tp : this.oorNetworkPortList) {
- Map<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePointKey,
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint>
- nepList = new HashMap<>();
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group
- .NodeEdgePoint inep = new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210
- .node.rule.group.NodeEdgePointBuilder()
- .setTopologyUuid(tapiTopoUuid)
- .setNodeUuid(this.uuidMap.get(String.join("+", this.ietfNodeId, TapiStringConstants.OTSI)))
- .setNodeEdgePointUuid(
- this.uuidMap.get(String.join("+", this.ietfNodeId, TapiStringConstants.I_OTSI,
- tp.getTpId().getValue())))
- .build();
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group
- .NodeEdgePoint enep = new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210
- .node.rule.group.NodeEdgePointBuilder()
- .setTopologyUuid(tapiTopoUuid)
- .setNodeUuid(this.uuidMap.get(String.join("+", this.ietfNodeId, TapiStringConstants.OTSI)))
- .setNodeEdgePointUuid(
- this.uuidMap.get(String.join("+", this.ietfNodeId, TapiStringConstants.E_OTSI,
- tp.getTpId().getValue())))
- .build();
- nepList.put(inep.key(), inep);
- nepList.put(enep.key(), enep);
- // Empty random creation of mandatory fields for avoiding errors....
- CostCharacteristic costCharacteristic = new CostCharacteristicBuilder()
- .setCostAlgorithm("Restricted Shortest Path - RSP")
- .setCostName("HOP_COUNT")
- .setCostValue(TapiStringConstants.COST_HOP_VALUE)
- .build();
- LatencyCharacteristic latencyCharacteristic = new LatencyCharacteristicBuilder()
- .setFixedLatencyCharacteristic(TapiStringConstants.FIXED_LATENCY_VALUE)
- .setQueingLatencyCharacteristic(TapiStringConstants.QUEING_LATENCY_VALUE)
- .setJitterCharacteristic(TapiStringConstants.JITTER_VALUE)
- .setWanderCharacteristic(TapiStringConstants.WANDER_VALUE)
- .setTrafficPropertyName("FIXED_LATENCY")
- .build();
- RiskCharacteristic riskCharacteristic = new RiskCharacteristicBuilder()
- .setRiskCharacteristicName("risk characteristic")
- .setRiskIdentifierList(Set.of("risk identifier1", "risk identifier2"))
- .build();
- NodeRuleGroup nodeRuleGroup = new NodeRuleGroupBuilder()
- .setUuid(new Uuid(
- UUID.nameUUIDFromBytes(("otsi node rule group " + count).getBytes(Charset.forName("UTF-8")))
- .toString()))
- .setRule(ruleList)
- .setNodeEdgePoint(nepList)
- .setRiskCharacteristic(Map.of(riskCharacteristic.key(), riskCharacteristic))
- .setCostCharacteristic(Map.of(costCharacteristic.key(), costCharacteristic))
- .setLatencyCharacteristic(Map.of(latencyCharacteristic.key(), latencyCharacteristic))
- .build();
- nodeRuleGroupList.put(nodeRuleGroup.key(), nodeRuleGroup);
- count++;
- }
- return nodeUuid;
- }
-
- private Uuid getNodeUuid4Dsr(Map<OwnedNodeEdgePointKey, OwnedNodeEdgePoint> onepl,
- Map<NodeRuleGroupKey, NodeRuleGroup> nodeRuleGroupList, Map<RuleKey, Rule> ruleList) {
- Uuid nodeUuid;
- nodeUuid = this.uuidMap.get(String.join("+", this.ietfNodeId, TapiStringConstants.DSR));
- // client nep creation on DSR node
- for (int i = 0; i < oorClientPortList.size(); i++) {
- LOG.info("NEP = {}", String.join("+", this.ietfNodeId, TapiStringConstants.DSR,
- oorClientPortList.get(i).getTpId().getValue()));
- Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes(
- (String.join("+", this.ietfNodeId, TapiStringConstants.DSR,
- oorClientPortList.get(i).getTpId().getValue())).getBytes(Charset.forName("UTF-8"))).toString());
- this.uuidMap.put(String.join("+", this.ietfNodeId, TapiStringConstants.DSR,
- oorClientPortList.get(i).getTpId().getValue()), nepUuid);
- NameBuilder nameBldr = new NameBuilder().setValue(
- String.join("+", this.ietfNodeId, TapiStringConstants.DSR,
- oorClientPortList.get(i).getTpId().getValue()));
- Name name;
- if (OpenroadmNodeType.TPDR.equals(this.ietfNodeType)) {
- name = nameBldr.setValueName("100G-tpdr").build();
- } else {
- name = nameBldr.setValueName("NodeEdgePoint_C").build();
- }
-
- OwnedNodeEdgePoint onep = createNep(oorClientPortList.get(i), Map.of(name.key(), name),
- LayerProtocolName.DSR, LayerProtocolName.DSR, true, String.join("+", this.ietfNodeId,
- TapiStringConstants.DSR));
- onepl.put(onep.key(), onep);
- }
- // network nep creation on I_ODU node
- for (int i = 0; i < oorNetworkPortList.size(); i++) {
- LOG.info("NEP = {}", String.join("+", this.ietfNodeId, TapiStringConstants.I_ODU,
- oorNetworkPortList.get(i).getTpId().getValue()));
- Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes(
- (String.join("+", this.ietfNodeId, TapiStringConstants.I_ODU,
- oorNetworkPortList.get(i).getTpId().getValue())).getBytes(Charset.forName("UTF-8"))).toString());
- this.uuidMap.put(String.join("+", this.ietfNodeId, TapiStringConstants.I_ODU,
- oorNetworkPortList.get(i).getTpId().getValue()), nepUuid);
- Name onedName = new NameBuilder()
- .setValueName("iNodeEdgePoint_N")
- .setValue(String.join("+", this.ietfNodeId, TapiStringConstants.I_ODU,
- oorNetworkPortList.get(i).getTpId().getValue()))
- .build();
-
- OwnedNodeEdgePoint onep = createNep(oorNetworkPortList.get(i), Map.of(onedName.key(), onedName),
- LayerProtocolName.ODU, LayerProtocolName.DSR, true, String.join("+", this.ietfNodeId,
- TapiStringConstants.I_ODU));
- onepl.put(onep.key(), onep);
- }
- // network nep creation on E_ODU node
- for (int i = 0; i < oorClientPortList.size(); i++) {
- LOG.info("NEP = {}", String.join("+", this.ietfNodeId, TapiStringConstants.E_ODU,
- oorClientPortList.get(i).getTpId().getValue()));
- Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes(
- (String.join("+", this.ietfNodeId, TapiStringConstants.E_ODU,
- oorClientPortList.get(i).getTpId().getValue())).getBytes(Charset.forName("UTF-8"))).toString());
- this.uuidMap.put(String.join("+", this.ietfNodeId, TapiStringConstants.E_ODU,
- oorClientPortList.get(i).getTpId().getValue()), nepUuid);
- Name onedName = new NameBuilder()
- .setValueName("eNodeEdgePoint_N")
- .setValue(String.join("+", this.ietfNodeId, TapiStringConstants.E_ODU,
- oorClientPortList.get(i).getTpId().getValue()))
- .build();
-
- OwnedNodeEdgePoint onep = createNep(oorClientPortList.get(i), Map.of(onedName.key(), onedName),
- LayerProtocolName.ODU, LayerProtocolName.DSR, false, String.join("+", this.ietfNodeId,
- TapiStringConstants.E_ODU));
- onepl.put(onep.key(), onep);
- }
- // create NodeRuleGroup
- int count = 1;
- LOG.info("ODU switching pool = {}", this.oorOduSwitchingPool.nonnullNonBlockingList().values());
- for (NonBlockingList nbl : this.oorOduSwitchingPool.nonnullNonBlockingList().values()) {
- Map<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePointKey,
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint>
- nepList = new HashMap<>();
- LOG.info("UUidMap={}", this.uuidMap.keySet());
- LOG.info("TP list = {}", nbl.getTpList());
- for (TpId tp : nbl.getTpList()) {
- LOG.info("TP={}", tp.getValue());
- LOG.info("UuidKey={}", String.join("+", this.ietfNodeId,
- TapiStringConstants.E_ODU, tp.getValue()));
- if (this.uuidMap.containsKey(String.join("+", this.ietfNodeId,
- TapiStringConstants.E_ODU, tp.getValue()))
- && this.uuidMap.containsKey(String.join("+", this.ietfNodeId,
- TapiStringConstants.DSR, tp.getValue()))) {
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint
- nep1 = new org.opendaylight.yang.gen.v1.urn
- .onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePointBuilder()
- .setTopologyUuid(tapiTopoUuid)
- .setNodeUuid(this.uuidMap.get(String.join("+", this.ietfNodeId,
- TapiStringConstants.DSR)))
- .setNodeEdgePointUuid(this.uuidMap.get(String.join(
- "+", this.ietfNodeId, TapiStringConstants.DSR, tp.getValue())))
- .build();
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint
- nep2 = new org.opendaylight.yang.gen.v1.urn
- .onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePointBuilder()
- .setTopologyUuid(tapiTopoUuid)
- .setNodeUuid(this.uuidMap.get(String.join("+", this.ietfNodeId,
- TapiStringConstants.DSR)))
- .setNodeEdgePointUuid(this.uuidMap.get(String.join(
- "+", this.ietfNodeId, TapiStringConstants.E_ODU, tp.getValue())))
- .build();
- nepList.put(nep1.key(), nep1);
- nepList.put(nep2.key(), nep2);
- }
- }
- // Empty random creation of mandatory fields for avoiding errors....
- CostCharacteristic costCharacteristic = new CostCharacteristicBuilder()
- .setCostAlgorithm("Restricted Shortest Path - RSP")
- .setCostName("HOP_COUNT")
- .setCostValue(TapiStringConstants.COST_HOP_VALUE)
- .build();
- LatencyCharacteristic latencyCharacteristic = new LatencyCharacteristicBuilder()
- .setFixedLatencyCharacteristic(TapiStringConstants.FIXED_LATENCY_VALUE)
- .setQueingLatencyCharacteristic(TapiStringConstants.QUEING_LATENCY_VALUE)
- .setJitterCharacteristic(TapiStringConstants.JITTER_VALUE)
- .setWanderCharacteristic(TapiStringConstants.WANDER_VALUE)
- .setTrafficPropertyName("FIXED_LATENCY")
- .build();
- RiskCharacteristic riskCharacteristic = new RiskCharacteristicBuilder()
- .setRiskCharacteristicName("risk characteristic")
- .setRiskIdentifierList(Set.of("risk identifier1", "risk identifier2"))
- .build();
- NodeRuleGroup nodeRuleGroup = new NodeRuleGroupBuilder()
- .setUuid(new Uuid(UUID.nameUUIDFromBytes(("dsr node rule group " + count)
- .getBytes(Charset.forName("UTF-8"))).toString()))
- .setRule(ruleList)
- .setNodeEdgePoint(nepList)
- .setRiskCharacteristic(Map.of(riskCharacteristic.key(), riskCharacteristic))
- .setCostCharacteristic(Map.of(costCharacteristic.key(), costCharacteristic))
- .setLatencyCharacteristic(Map.of(latencyCharacteristic.key(), latencyCharacteristic))
- .build();
- nodeRuleGroupList.put(nodeRuleGroup.key(), nodeRuleGroup);
- count++;
- }
- return nodeUuid;
- }
-
- private OwnedNodeEdgePoint createNep(TerminationPoint oorTp, Map<NameKey, Name> nepNames,
- LayerProtocolName nepProtocol, LayerProtocolName nodeProtocol, boolean withSip,
- String keyword) {
- String key = String.join("+", keyword, oorTp.getTpId().getValue());
- OwnedNodeEdgePointBuilder onepBldr = new OwnedNodeEdgePointBuilder()
- .setUuid(this.uuidMap.get(key))
- .setLayerProtocolName(nepProtocol)
- .setName(nepNames);
- if (withSip) {
- onepBldr.setMappedServiceInterfacePoint(createMSIP(1, nepProtocol, oorTp, keyword));
- }
- AdministrativeState adminState = null;
- OperationalState operState = null;
- if (oorTp.augmentation(TerminationPoint1.class).getAdministrativeState() != null) {
- adminState = this.tapiLink.setTapiAdminState(oorTp.augmentation(TerminationPoint1.class)
- .getAdministrativeState().getName());
- }
- if (oorTp.augmentation(TerminationPoint1.class).getOperationalState() != null) {
- operState = this.tapiLink.setTapiOperationalState(oorTp.augmentation(TerminationPoint1.class)
- .getOperationalState().getName());
- }
- onepBldr.setSupportedCepLayerProtocolQualifier(createSupportedLayerProtocolQualifier(oorTp, nepProtocol))
- .setLinkPortDirection(PortDirection.BIDIRECTIONAL)
- .setLinkPortRole(PortRole.SYMMETRIC)
- .setAdministrativeState(adminState)
- .setOperationalState(operState)
- .setLifecycleState(LifecycleState.INSTALLED)
- .setTerminationDirection(TerminationDirection.BIDIRECTIONAL)
- .setTerminationState(TerminationState.TERMINATEDBIDIRECTIONAL);
- return onepBldr.build();
- }
-