Allow the client to specify ROADM service SRG port 69/109369/12
authorJoakim Törnqvist <joakim.tornqvist@smartoptics.com>
Thu, 7 Dec 2023 15:03:53 +0000 (15:03 +0000)
committerJoakim Törnqvist <joakim.tornqvist@smartoptics.com>
Thu, 29 Feb 2024 15:04:01 +0000 (15:04 +0000)
commit5055f395076dfc365e08ffcc13680b82304a4be7
tree24e72d9a96fe3a818044b3dbeb4dae92f2c3a40d
parent6ca4ae513f1a0a413947a3dad6e89a7f2102b646
Allow the client to specify ROADM service SRG port

Allows the client to specifiy port with 'port-device-name' and
'port-name' (see example down below).

The feature is implemented in PceOpticalNode. The rest are
classes being updated since there is a new argument in
the method PceOpticalNode.initSrgTps():

    initSrgTps(Preference portPreference) {...}

Feature implementation overview

The feature uses the classes in package:
org.opendaylight.transportpce.pce.networkanalyzer.port

* PceCalculation instantiates an instance of Preference using
  PreferenceFactory and passing it on to the constructor in
  PceOpticalNode.
* PreferenceFactory in turn uses PathComputationRequestInput
  to return either 'NoPreference' or 'ClientPreference'.
* Returning an instance of 'NoPreference' is the backwards compatible
  approach. The class 'NoPreference' is currently implemented as
  the equivalent of 'port-device-name' and 'port-name' being absent
  from the client request.
* If the client uses 'port-device-name' and 'port-name' an instance
  of ClientPreference is returned.
* PceOpticalNode uses the method preferredPort(...) defined by
  the interface Preference (implemented by NoPreference/
  ClientPreference) when building a list of avilable ports.
  If a port is not in the preferred list, it's treated as
  unavailable by PceOpticalNode.

APIImpact

POST /rests/operations/org-openroadm-service:service-create
{
  "input": {
...
    "port": {
      "port-device-name": "ROADM-B-SRG1",
      "port-name":        "SRG1-PP2-TXRX",
    }
...
  }
}

The above will result in port SRG1-PP2-TXRX on node ROADM-B-SRG1
being used in the service. All other ports on ROADM-B-SRG1
will be treated as "unavailable".

JIRA: TRNSPRTPCE-176
Change-Id: I453a92fda2977ac86c5c5ff47e1a7f6cd322334d
Signed-off-by: Joakim Törnqvist <joakim.tornqvist@smartoptics.com>
pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceCalculation.java
pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOpticalNode.java
pce/src/test/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOpticalNodeTest.java