Determine preferred node/port from PCRI
Package intended to be used to determine preferred SRG port
usage when setting up optical services between ROADMs.
Use an instance of PathComputationRequestInput, e.g. API
input and provides a method for checking if a specific SRG port
is among the ports in the client request.
Package org.opendaylight.transportpce.pce.networkanalyzer.port:
* Preference - Interface defining one method capable
of determining if a node/port is 'preferred'
by the client.
* ClientPreference - Implements Preference. Contains information
about actual client port preference.
* NoPreference - Implements Preference. Typically used when
the client has no preference regarding port.
* Factory - Interface defining methods needed in order
to convert a PathComputationRequestInput
to an implementation of Preferenc.
* PreferenceFactory - Implements Factory. The method
'portPreference' should typically be used
implementing the feature in the application.
The method portPreference either returns
an instance of 'ClientPreference' or
'NoPreference'.
Example:
public void someMethod(PathComputationRequestInput input) {
Factory portPreferenceFactory = new PreferenceFactory();
Preference preference = portPreferenceFactory.portPreference(input);
if (preference.preferredPort("ROADM-A-SRG1", "SRG1-PP1-TXRX")) {
System.out.println("The port 'SRG1-PP1-TXRX' on 'ROADM-A-SRG1' "
+"is preferred by the client.");
}
}
JIRA: TRNSPRTPCE-176
Change-Id: Iba7e7886678deb6d965391633f819995635caa06
Signed-off-by: Joakim Törnqvist <joakim.tornqvist@smartoptics.com>