+
+ public static void createLportTagInterfaceMap(WriteTransaction t, String infName, Integer ifIndex) {
+ InstanceIdentifier<IfIndexInterface> id = InstanceIdentifier.builder(IfIndexesInterfaceMap.class).child(IfIndexInterface.class, new IfIndexInterfaceKey(ifIndex)).build();
+ IfIndexInterface ifIndexInterface = new IfIndexInterfaceBuilder().setIfIndex(ifIndex).setKey(new IfIndexInterfaceKey(ifIndex)).setInterfaceName(infName).build();
+ t.put(LogicalDatastoreType.OPERATIONAL, id, ifIndexInterface, true);
+ }
+
+ public static void removeLportTagInterfaceMap(WriteTransaction t, IdManagerService idManager, DataBroker broker, String infName, Integer ifIndex) {
+ InstanceIdentifier<IfIndexInterface> id = InstanceIdentifier.builder(IfIndexesInterfaceMap.class).child(IfIndexInterface.class, new IfIndexInterfaceKey(ifIndex)).build();
+ Optional<IfIndexInterface> ifIndexesInterface = IfmUtil.read(LogicalDatastoreType.OPERATIONAL, id, broker);
+ if(ifIndexesInterface.isPresent()) {
+ t.delete(LogicalDatastoreType.OPERATIONAL, id);
+ }
+ IfmUtil.releaseId(idManager, IfmConstants.IFM_IDPOOL_NAME, infName);
+ }