- if ("1G".equals(input.getServiceRate())) {
- LOG.info("Input service is 1G");
- createdEthInterfaces.add(
- openRoadmInterfaceFactory.createOpenRoadmEth1GInterface(node.getNodeId(), node.getClientTp()));
- createdOduInterfaces.add(
- //suppporting interface?, payload ?
- openRoadmInterfaceFactory.createOpenRoadmOdu0Interface(node.getNodeId(), node.getClientTp(),
- input.getServiceName(), "07", false, input.getTribPortNumber(), input.getTribSlot()));
- createdOduInterfaces.add(
- openRoadmInterfaceFactory.createOpenRoadmOdu0Interface(node.getNodeId(), node.getNetworkTp(),
- input.getServiceName(), "07", true, input.getTribPortNumber(), input.getTribSlot()));
- } else if ("10G".equals(input.getServiceRate())) {
- LOG.info("Input service is 10G");
- createdEthInterfaces.add(
- openRoadmInterfaceFactory.createOpenRoadmEth10GInterface(node.getNodeId(), node.getClientTp()));
- createdOduInterfaces.add(
- //suppporting interface?, payload ?
- openRoadmInterfaceFactory.createOpenRoadmOdu2eInterface(node.getNodeId(), node.getClientTp(),
- input.getServiceName(),"03", false ,input.getTribPortNumber(),input.getTribSlot()));
- createdOduInterfaces.add(
- // supporting interface? payload ?
- openRoadmInterfaceFactory.createOpenRoadmOdu2eInterface(node.getNodeId(), node.getNetworkTp(),
- input.getServiceName(),"03" , true ,input.getTribPortNumber(),input.getTribSlot()));
+ switch (input.getServiceRate().intValue()) {
+ case 1:
+ LOG.info("Input service is 1G");
+ if (node.getClientTp() != null) {
+ createdEthInterfaces.add(
+ openRoadmInterfaceFactory.createOpenRoadmEth1GInterface(node.getNodeId(),
+ node.getClientTp()));
+ createdOduInterfaces.add(
+ // suppporting interface?, payload ?
+ openRoadmInterfaceFactory.createOpenRoadmOdu0Interface(node.getNodeId(), node.getClientTp(),
+ input.getServiceName(), PT_07, false, input.getTribPortNumber(), input.getTribSlot()));
+ }
+ createdOduInterfaces.add(
+ openRoadmInterfaceFactory.createOpenRoadmOdu0Interface(node.getNodeId(), node.getNetworkTp(),
+ input.getServiceName(), PT_07, true, input.getTribPortNumber(), input.getTribSlot()));
+ if (node.getNetwork2Tp() != null) {
+ createdOduInterfaces.add(
+ // supporting interface? payload ?
+ openRoadmInterfaceFactory.createOpenRoadmOdu0Interface(node.getNodeId(),
+ node.getNetwork2Tp(), input.getServiceName(), PT_07, true, input.getTribPortNumber(),
+ input.getTribSlot()));
+ }
+ break;
+ case 10:
+ LOG.info("Input service is 10G");
+ if (node.getClientTp() != null) {
+ createdEthInterfaces.add(openRoadmInterfaceFactory.createOpenRoadmEth10GInterface(
+ node.getNodeId(), node.getClientTp()));
+ createdOduInterfaces.add(
+ // suppporting interface?, payload ?
+ openRoadmInterfaceFactory.createOpenRoadmOdu2eInterface(node.getNodeId(),
+ node.getClientTp(), input.getServiceName(), PT_03, false, input.getTribPortNumber(),
+ input.getTribSlot()));
+ }
+ createdOduInterfaces.add(
+ // supporting interface? payload ?
+ openRoadmInterfaceFactory.createOpenRoadmOdu2eInterface(node.getNodeId(), node.getNetworkTp(),
+ input.getServiceName(), PT_03, true, input.getTribPortNumber(), input.getTribSlot()));
+ if (node.getNetwork2Tp() != null) {
+ createdOduInterfaces.add(
+ // supporting interface? payload ?
+ openRoadmInterfaceFactory.createOpenRoadmOdu2eInterface(node.getNodeId(),
+ node.getNetwork2Tp(), input.getServiceName(), PT_03, true, input.getTribPortNumber(),
+ input.getTribSlot()));
+ }
+ break;
+ case 100:
+ LOG.info("Input service is 100G");
+ // Take the first and last value in the list of OpucnTribSlot (assuming SH would provide
+ // min and max value only, size two)
+ OpucnTribSlotDef minOpucnTs = OpucnTribSlotDef.getDefaultInstance(
+ input.getOpucnTribSlots().get(0).getValue());
+ OpucnTribSlotDef maxOpucnTs = OpucnTribSlotDef.getDefaultInstance(
+ input.getOpucnTribSlots().get(1).getValue());
+ if (node.getClientTp() != null) {
+ createdEthInterfaces.add(openRoadmInterfaceFactory.createOpenRoadmEth100GInterface(
+ node.getNodeId(), node.getClientTp()));
+ // OPUCn trib information is optional when creating ODU4 ethernet (client) interface
+ createdOduInterfaces.add(
+ openRoadmInterfaceFactory.createOpenRoadmOtnOdu4LoInterface(node.getNodeId(),
+ node.getClientTp(), input.getServiceName(), PT_07, false, minOpucnTs,
+ maxOpucnTs));
+ }
+ // Here payload-type is optional and is not used for interface creation (especially for network)
+ createdOduInterfaces.add(
+ openRoadmInterfaceFactory.createOpenRoadmOtnOdu4LoInterface(node.getNodeId(),
+ node.getNetworkTp(), input.getServiceName(), PT_07, true, minOpucnTs,
+ maxOpucnTs));
+ // Here payload-type is optional and is not used for service creation
+ // This is needed if there is an intermediate node
+ if (node.getNetwork2Tp() != null) {
+ createdOduInterfaces.add(
+ openRoadmInterfaceFactory.createOpenRoadmOtnOdu4LoInterface(node.getNodeId(),
+ node.getNetwork2Tp(), input.getServiceName(), PT_07, true, minOpucnTs,
+ maxOpucnTs));
+ }
+ break;
+ default:
+ LOG.error("service rate {} not managed yet", input.getServiceRate());
+ return;