SfcProviderRpc implements ServiceFunctionService, ServiceFunctionChainService, RenderedServicePathService,
        ServicePathIdService, RenderedIoamPathService { @Override public Future<RpcResult<Void>> putServiceFunctionChains(PutServiceFunctionChainsInput input) { printTraceStart(LOG); ServiceFunctionChainsBuilder serviceFunctionChainsBuilder = new ServiceFunctionChainsBuilder(); serviceFunctionChainsBuilder = serviceFunctionChainsBuilder.setServiceFunctionChain(input.getServiceFunctionChain()); ServiceFunctionChains sfcs = serviceFunctionChainsBuilder.build(); if (!SfcDataStoreAPI.writeMergeTransactionAPI(SfcInstanceIdentifiers.SFC_IID, sfcs, LogicalDatastoreType.CONFIGURATION)) { LOG.error("Failed to create service function chain: {}", input.getServiceFunctionChain().toString()); } return Futures.immediateFuture(Rpcs.<Void>getRpcResult(true, Collections.<RpcError>emptySet())); }  static SfcProviderRpc getSfcProviderRpc(); void setDataProvider(DataBroker r); static void setDataProviderAux(DataBroker r); @Override Future<RpcResult<Void>> deleteAllServiceFunction(); @Override Future<RpcResult<Void>> deleteServiceFunction(DeleteServiceFunctionInput input); @Override Future<RpcResult<Void>> putServiceFunction(PutServiceFunctionInput input); @Override Future<RpcResult<ReadServiceFunctionOutput>> readServiceFunction(ReadServiceFunctionInput input); @Override Future<RpcResult<InstantiateServiceFunctionChainOutput>> instantiateServiceFunctionChain(
            InstantiateServiceFunctionChainInput input); @Override Future<RpcResult<Void>> putServiceFunctionChains(PutServiceFunctionChainsInput input); @Override Future<RpcResult<CreateRenderedPathOutput>> createRenderedPath(
            CreateRenderedPathInput createRenderedPathInput); @Override Future<RpcResult<DeleteRenderedPathOutput>> deleteRenderedPath(DeleteRenderedPathInput input); @Override Future<RpcResult<ReadRenderedServicePathFirstHopOutput>> readRenderedServicePathFirstHop(
            ReadRenderedServicePathFirstHopInput input); @Override Future<RpcResult<ReadRspFirstHopBySftListOutput>> readRspFirstHopBySftList(
            ReadRspFirstHopBySftListInput input); @Override Future<RpcResult<TraceRenderedServicePathOutput>> traceRenderedServicePath(
            TraceRenderedServicePathInput input); @Override Future<RpcResult<ReservePathIdRangeOutput>> reservePathIdRange(ReservePathIdRangeInput input); @Override Future<RpcResult<ReadPathIdOutput>> readPathId(ReadPathIdInput input); @Override Future<RpcResult<AllocatePathIdOutput>> allocatePathId(AllocatePathIdInput input); @Override Future<RpcResult<DeletePathIdOutput>> deletePathId(DeletePathIdInput input); @Override Future<RpcResult<SetGenerationAlgorithmOutput>> setGenerationAlgorithm(SetGenerationAlgorithmInput input); @Override Future<RpcResult<CreateIoamPathOutput>> createIoamPath(final CreateIoamPathInput input); @Override Future<RpcResult<DeleteIoamPathOutput>> deleteIoamPath(DeleteIoamPathInput input);  }
@Test public void putServiceFunctionChainsTest() { PutServiceFunctionChainsInputBuilder putServiceFunctionChainsInputBuilder = new PutServiceFunctionChainsInputBuilder(); ServiceFunctionChainBuilder serviceFunctionChainBuilder = new ServiceFunctionChainBuilder(); serviceFunctionChainBuilder.setName(new SfcName("SFC1")) .setKey(new ServiceFunctionChainKey(new SfcName("SFC1"))); ServiceFunctionChain serviceFunctionChain = serviceFunctionChainBuilder.build(); List<ServiceFunctionChain> serviceFunctionChainList = new ArrayList<>(); serviceFunctionChainList.add(serviceFunctionChain); putServiceFunctionChainsInputBuilder.setServiceFunctionChain(serviceFunctionChainList); PutServiceFunctionChainsInput putServiceFunctionChainsInput = putServiceFunctionChainsInputBuilder.build(); sfcProviderRpc.putServiceFunctionChains(putServiceFunctionChainsInput); ServiceFunctionChainsBuilder serviceFunctionChainsBuilder = new ServiceFunctionChainsBuilder(); serviceFunctionChainsBuilder = serviceFunctionChainsBuilder .setServiceFunctionChain(putServiceFunctionChainsInput.getServiceFunctionChain()); serviceFunctionChainsBuilder.build(); InstanceIdentifier<ServiceFunctionChains> SFC_IID = InstanceIdentifier.builder(ServiceFunctionChains.class).build(); ServiceFunctionChains serviceFunctionChainsFromDataStore = SfcDataStoreAPI.readTransactionAPI(SFC_IID, LogicalDatastoreType.CONFIGURATION); assertNotNull(serviceFunctionChainsFromDataStore); assertEquals(new SfcName("SFC1"), serviceFunctionChainsFromDataStore.getServiceFunctionChain().get(0).getName()); }