+ public String createOpenRoadmOtsInterface(String nodeId, Mapping mapping) throws OpenRoadmInterfaceException {
+ if (mapping.getSupportingOts() == null) {
+ // Create generic interface
+ InterfaceBuilder otsInterfaceBldr = createGenericInterfaceBuilder(mapping, OpticalTransport.class, "OTS-"
+ + mapping.getLogicalConnectionPoint());
+ // OTS interface augmentation specific data
+ OtsBuilder otsIfBuilder = new OtsBuilder();
+ otsIfBuilder.setFiberType(FiberType.Smf);
+
+ // Create Interface1 type object required for adding as
+ // augmentation
+ org.opendaylight.yang.gen.v1.http.org.openroadm.optical.transport.interfaces.rev161014
+ .Interface1Builder otsIf1Builder = new org.opendaylight.yang.gen.v1.http.org.openroadm.optical
+ .transport.interfaces.rev161014.Interface1Builder();
+ otsInterfaceBldr.addAugmentation(
+ org.opendaylight.yang.gen.v1.http.org.openroadm.optical.transport.interfaces.rev161014.Interface1.class,
+ otsIf1Builder.setOts(otsIfBuilder.build()).build());
+ this.openRoadmInterfaces.postInterface(nodeId, otsInterfaceBldr);
+ this.portMapping.updateMapping(nodeId, mapping);
+ return otsInterfaceBldr.build().getName();
+ } else {
+ return mapping.getSupportingOts();
+ }
+ }
+
+ public String createOpenRoadmOmsInterface(String nodeId, Mapping mapping) throws OpenRoadmInterfaceException {
+ if (mapping.getSupportingOms() == null) {
+ // Create generic interface
+ InterfaceBuilder omsInterfaceBldr = createGenericInterfaceBuilder(mapping, OpenROADMOpticalMultiplex.class,
+ "OMS-" + mapping.getLogicalConnectionPoint());
+ if (mapping.getSupportingOts() != null) {
+ omsInterfaceBldr.setSupportingInterface(mapping.getSupportingOts());
+ } else {
+ throw new OpenRoadmInterfaceException(String.format("Unable to get ots interface from mapping % - %",
+ nodeId, mapping.getLogicalConnectionPoint()));
+ }
+ this.openRoadmInterfaces.postInterface(nodeId, omsInterfaceBldr);
+ this.portMapping.updateMapping(nodeId, mapping);
+ return omsInterfaceBldr.build().getName();
+ } else {
+ return mapping.getSupportingOms();
+ }
+ }
+