- private final Node node;
- private final NodeId nodeId;
- private final OpenroadmNodeType nodeType;
- private final ServiceFormat serviceFormat;
- private final String pceNodeType;
-
- // wavelength calculation per node type
- private List<Long> availableWLindex = new ArrayList<Long>();
- private Map<String, OpenroadmTpType> availableSrgPp = new TreeMap<String, OpenroadmTpType>();
- private Map<String, OpenroadmTpType> availableSrgCp = new TreeMap<String, OpenroadmTpType>();
- private List<String> usedXpndrNWTps = new ArrayList<String>();
- private List<PceLink> outgoingLinks = new ArrayList<PceLink>();
- private Map<String, String> clientPerNwTp = new HashMap<String, String>();
-
- public PceOpticalNode(Node node, OpenroadmNodeType nodeType, NodeId nodeId, ServiceFormat serviceFormat,
- String pceNodeType) {
- this.node = node;
- this.nodeId = nodeId;
- this.nodeType = nodeType;
- this.serviceFormat = serviceFormat;
- this.pceNodeType = pceNodeType;
-
- if ((node == null) || (nodeId == null) || (nodeType == null)) {
- LOG.error("PceNode: one of parameters is not populated : nodeId, node type");
+ private Node node;
+ private NodeId nodeId;
+ private String deviceNodeId;
+ private OpenroadmNodeType nodeType;
+ private AdminStates adminStates;
+ private State state;
+ private String serviceType;
+ private PortMapping portMapping;
+
+ private Map<String, OpenroadmTpType> availableSrgPp = new TreeMap<>();
+ private Map<String, OpenroadmTpType> availableSrgCp = new TreeMap<>();
+ private List<String> usedXpndrNWTps = new ArrayList<>();
+ private List<PceLink> outgoingLinks = new ArrayList<>();
+ private Map<String, String> clientPerNwTp = new HashMap<>();
+ private final AvailFreqMapsKey freqMapKey = new AvailFreqMapsKey(GridConstant.C_BAND);
+ private BitSet frequenciesBitSet;
+ private String version;
+ private BigDecimal slotWidthGranularity;
+
+ public PceOpticalNode(String deviceNodeId, String serviceType, PortMapping portMapping, Node node,
+ OpenroadmNodeType nodeType, String version, BigDecimal slotWidthGranularity) {
+ if (deviceNodeId != null
+ && serviceType != null
+ && portMapping != null
+ && node != null
+ && node.getNodeId() != null
+ && nodeType != null
+ && version != null
+ && slotWidthGranularity != null) {
+ this.deviceNodeId = deviceNodeId;
+ this.serviceType = serviceType;
+ this.portMapping = portMapping;
+ this.node = node;
+ this.nodeId = node.getNodeId();
+ this.nodeType = nodeType;
+ this.version = version;
+ this.slotWidthGranularity = slotWidthGranularity;
+ this.adminStates = node.augmentation(org.opendaylight.yang.gen.v1.http
+ .org.openroadm.common.network.rev200529.Node1.class).getAdministrativeState();
+ this.state = node.augmentation(org.opendaylight.yang.gen.v1.http
+ .org.openroadm.common.network.rev200529.Node1.class).getOperationalState();
+ } else {
+ LOG.error("PceNode: one of parameters is not populated : nodeId, node type, slot width granularity");