}
public static ServicePathInputData rendererCreateServiceInputAToZ(String serviceName,
- PathDescription pathDescription) {
+ PathDescription pathDescription, Action operation) {
int scale = GridConstant.FIXED_GRID_FREQUENCY_PRECISION;
AToZDirection atoZDirection = pathDescription.getAToZDirection();
LOG.info("Building ServicePathInputData for a to z direction {}", atoZDirection);
NodeLists nodeLists = getNodesListAToZ(atoZDirection.nonnullAToZ().values().iterator());
ServicePathInputBuilder servicePathInputBuilder = new ServicePathInputBuilder()
.setServiceName(serviceName)
- .setOperation(Action.Create)
- .setNodes(nodeLists.getList())
+ .setOperation(operation)
+ .setNodes(nodeLists.getRendererNodeList())
.setWidth(new FrequencyGHz(GridConstant.WIDTH_40));
if (atoZDirection.getAToZWavelengthNumber() != null) {
servicePathInputBuilder
}
public static ServicePathInputData rendererCreateServiceInputZToA(String serviceName,
- PathDescription pathDescription) {
+ PathDescription pathDescription, Action operation) {
int scale = GridConstant.FIXED_GRID_FREQUENCY_PRECISION;
ZToADirection ztoADirection = pathDescription.getZToADirection();
LOG.info("Building ServicePathInputData for z to a direction {}", ztoADirection);
NodeLists nodeLists = getNodesListZtoA(pathDescription.getZToADirection().nonnullZToA().values().iterator());
ServicePathInputBuilder servicePathInputBuilder = new ServicePathInputBuilder()
- .setOperation(Action.Create)
+ .setOperation(operation)
.setServiceName(serviceName)
- .setNodes(nodeLists.getList())
+ .setNodes(nodeLists.getRendererNodeList())
.setWidth(new FrequencyGHz(GridConstant.WIDTH_40));
if (ztoADirection.getZToAWavelengthNumber() != null) {
servicePathInputBuilder
}
// Adding createOtnServiceInputpath for A-Z and Z-A directions as one method
- public static OtnServicePathInput rendererCreateOtnServiceInput(String serviceName, String serviceFormat,
- Uint32 serviceRate, PathDescription pathDescription, boolean asideToZside) {
+ public static OtnServicePathInput rendererCreateOtnServiceInput(String serviceName, Action operation,
+ String serviceFormat, Uint32 serviceRate, PathDescription pathDescription, boolean asideToZside) {
// If atoZ is set true use A-to-Z direction otherwise use Z-to-A
List<org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev210618.otn.renderer.nodes.Nodes> nodes =
new ArrayList<>();
- NodeLists nodeLists = getNodesListAToZ(pathDescription.getAToZDirection().nonnullAToZ().values().iterator());
- if (!asideToZside) {
+ NodeLists nodeLists;
+ if (asideToZside) {
+ nodeLists = getNodesListAToZ(pathDescription.getAToZDirection().nonnullAToZ().values().iterator());
+ } else {
nodeLists = getNodesListZtoA(pathDescription.getZToADirection().nonnullZToA().values().iterator());
}
- LOG.info("These are node-lists {}, {}", nodeLists.getList(), nodeLists.getOlmList());
- for (Nodes node: nodeLists.getList()) {
+ LOG.info("These are node-lists {}, {}", nodeLists.getRendererNodeList(), nodeLists.getOlmNodeList());
+ for (Nodes node: nodeLists.getRendererNodeList()) {
nodes.add(new org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev210618.otn.renderer.nodes
.NodesBuilder()
.setNodeId(node.getNodeId())
}
OtnServicePathInputBuilder otnServicePathInputBuilder = new OtnServicePathInputBuilder()
.setServiceName(serviceName)
+ .setOperation(operation)
.setServiceFormat(serviceFormat)
.setServiceRate(serviceRate)
.setNodes(nodes);