+ private static Map<String, String> extractZendFromPathDescriptionForOtn(PathDescription pathDescription) {
+ List<ZToA> tpList = pathDescription.getZToADirection().getZToA().values().stream()
+ .sorted((az1, az2) -> Integer.compare(Integer.parseInt(az1.getId()), Integer.parseInt(az2.getId())))
+ .filter(az -> TERMINATION_POINT.equals(az.getResource().getResource().implementedInterface()
+ .getSimpleName()))
+ .collect(Collectors.toList());
+ for (ZToA ztoA : tpList) {
+ TerminationPoint tp = (TerminationPoint) ztoA.getResource().getResource();
+ if (!tp.getTpId().isEmpty() && !tp.getTpNodeId().isEmpty()) {
+ String nodeId = tp.getTpNodeId();
+ String lcp = tp.getTpId();
+ return Map.of("nodeId", nodeId, "tpid", lcp);
+ }
+ }
+ return Map.of();
+ }
+
+ private static Map<String, String> extractAendFromPathDescriptionForOptical(PathDescription pathDescription) {
+ List<AToZ> tpList = pathDescription.getAToZDirection().getAToZ().values().stream()
+ .sorted((az1, az2) -> Integer.compare(Integer.parseInt(az1.getId()), Integer.parseInt(az2.getId())))
+ .filter(az -> TERMINATION_POINT.equals(az.getResource().getResource().implementedInterface()
+ .getSimpleName()))
+ .collect(Collectors.toList());
+ for (AToZ atoZ : tpList) {
+ TerminationPoint tp = (TerminationPoint) atoZ.getResource().getResource();
+ if (!tp.getTpId().contains("CLIENT") && !tp.getTpId().isEmpty() && !tp.getTpNodeId().isEmpty()) {
+// String nodeId = tp.getTpNodeId();
+// String lcp = tp.getTpId();
+ return Map.of("nodeId", tp.getTpNodeId(), "tpid", tp.getTpId());
+ }
+ }
+ return Map.of();
+ }
+
+ private static Map<String, String> extractZendFromPathDescriptionForOptical(PathDescription pathDescription) {
+ List<ZToA> tpList = pathDescription.getZToADirection().getZToA().values().stream()
+ .sorted((az1, az2) -> Integer.compare(Integer.parseInt(az1.getId()), Integer.parseInt(az2.getId())))
+ .filter(az -> TERMINATION_POINT.equals(az.getResource().getResource().implementedInterface()
+ .getSimpleName()))
+ .collect(Collectors.toList());
+ for (ZToA ztoA : tpList) {
+ TerminationPoint tp = (TerminationPoint) ztoA.getResource().getResource();
+ if (!tp.getTpId().contains("CLIENT") && !tp.getTpId().isEmpty() && !tp.getTpNodeId().isEmpty()) {
+// String nodeId = tp.getTpNodeId();
+// String lcp = tp.getTpId();
+ return Map.of("nodeId", tp.getTpNodeId(), "tpid", tp.getTpId());
+ }
+ }
+ return Map.of();
+ }