SfcProviderServiceTypeAPI { public static boolean putServiceFunctionType(ServiceFunctionType sft) { boolean ret; printTraceStart(LOG); InstanceIdentifier<ServiceFunctionType> sftEntryIID = InstanceIdentifier.builder(ServiceFunctionTypes.class) .child(ServiceFunctionType.class, sft.getKey()) .build(); ret = SfcDataStoreAPI.writePutTransactionAPI(sftEntryIID, sft, LogicalDatastoreType.CONFIGURATION); printTraceStop(LOG); return ret; }  static boolean createServiceFunctionTypeEntry(ServiceFunction serviceFunction); static boolean putServiceFunctionType(ServiceFunctionType sft); static ServiceFunctionType readServiceFunctionType(SftTypeName serviceFunctionType); static boolean deleteServiceFunctionTypeEntry(ServiceFunction serviceFunction); static boolean deleteServiceFunctionType(SftTypeName sftType); static boolean deleteServiceFunctionType(ServiceFunctionType serviceFunctionType); static SftServiceFunctionName readServiceFunctionTypeEntry(ServiceFunction serviceFunction);  }
@Test public void testPutServiceFunctionType() throws Exception { ServiceFunctionTypeBuilder serviceFunctionTypeBuilder = new ServiceFunctionTypeBuilder(); SftTypeName sftType = new SftTypeName("firewall"); serviceFunctionTypeBuilder.setKey(new ServiceFunctionTypeKey(sftType)) .setType(sftType) .setBidirectional(false) .setNshAware(false) .setRequestReclassification(false); ServiceFunctionType serviceFunctionType = serviceFunctionTypeBuilder.build(); assertTrue(SfcProviderServiceTypeAPI.putServiceFunctionType(serviceFunctionType)); InstanceIdentifier<ServiceFunctionType> sftEntryIID = InstanceIdentifier.builder(ServiceFunctionTypes.class) .child(ServiceFunctionType.class, serviceFunctionType.getKey()) .build(); ServiceFunctionType serviceFunctionTypeRead = SfcDataStoreAPI.readTransactionAPI(sftEntryIID, LogicalDatastoreType.CONFIGURATION); assertEquals(serviceFunctionType, serviceFunctionTypeRead); }