use of org.opendaylight.openflowplugin.impl.services.sal.SalBundleServiceImpl in project openflowplugin by opendaylight.
the class MdSalRegistrationUtils method registerServices.
/**
* Method registers all OF services for role {@link OfpRole#BECOMEMASTER}.
*
* @param rpcContext - registration processing is implemented in
* {@link org.opendaylight.openflowplugin.api.openflow.rpc.RpcContext}
*
* @param deviceContext - every service needs
* {@link org.opendaylight.openflowplugin.api.openflow.device.DeviceContext} as input parameter
*
* @param convertorExecutor convertor executor
*/
public static void registerServices(@Nonnull final RpcContext rpcContext, @Nonnull final DeviceContext deviceContext, final ExtensionConverterProvider extensionConverterProvider, final ConvertorExecutor convertorExecutor) {
// TODO: Use multipart writer provider from device context
final MultipartWriterProvider multipartWriterProvider = MultipartWriterProviderFactory.createDefaultProvider(deviceContext);
// create service instances
final SalFlowServiceImpl salFlowService = new SalFlowServiceImpl(rpcContext, deviceContext, convertorExecutor);
final FlowCapableTransactionServiceImpl flowCapableTransactionService = new FlowCapableTransactionServiceImpl(rpcContext, deviceContext);
final SalAsyncConfigServiceImpl salAsyncConfigService = new SalAsyncConfigServiceImpl(rpcContext, deviceContext);
final SalGroupServiceImpl salGroupService = new SalGroupServiceImpl(rpcContext, deviceContext, convertorExecutor);
final SalMeterServiceImpl salMeterService = new SalMeterServiceImpl(rpcContext, deviceContext, convertorExecutor);
// register routed service instances
rpcContext.registerRpcServiceImplementation(SalEchoService.class, new SalEchoServiceImpl(rpcContext, deviceContext));
rpcContext.registerRpcServiceImplementation(SalFlowService.class, salFlowService);
rpcContext.registerRpcServiceImplementation(FlowCapableTransactionService.class, flowCapableTransactionService);
rpcContext.registerRpcServiceImplementation(SalAsyncConfigService.class, salAsyncConfigService);
rpcContext.registerRpcServiceImplementation(SalMeterService.class, salMeterService);
rpcContext.registerRpcServiceImplementation(SalGroupService.class, salGroupService);
rpcContext.registerRpcServiceImplementation(SalTableService.class, new SalTableServiceImpl(rpcContext, deviceContext, convertorExecutor, multipartWriterProvider));
rpcContext.registerRpcServiceImplementation(SalPortService.class, new SalPortServiceImpl(rpcContext, deviceContext, convertorExecutor));
rpcContext.registerRpcServiceImplementation(PacketProcessingService.class, new PacketProcessingServiceImpl(rpcContext, deviceContext, convertorExecutor));
rpcContext.registerRpcServiceImplementation(NodeConfigService.class, new NodeConfigServiceImpl(rpcContext, deviceContext));
rpcContext.registerRpcServiceImplementation(OpendaylightFlowStatisticsService.class, OpendaylightFlowStatisticsServiceImpl.createWithOook(rpcContext, deviceContext, convertorExecutor));
// register direct statistics gathering services
rpcContext.registerRpcServiceImplementation(OpendaylightDirectStatisticsService.class, new OpendaylightDirectStatisticsServiceImpl(deviceContext.canUseSingleLayerSerialization() ? SingleLayerDirectStatisticsProviderInitializer.createProvider(rpcContext, deviceContext, convertorExecutor, multipartWriterProvider) : MultiLayerDirectStatisticsProviderInitializer.createProvider(rpcContext, deviceContext, convertorExecutor, multipartWriterProvider)));
// register flat batch services
rpcContext.registerRpcServiceImplementation(SalFlatBatchService.class, new SalFlatBatchServiceImpl(new SalFlowsBatchServiceImpl(salFlowService, flowCapableTransactionService), new SalGroupsBatchServiceImpl(salGroupService, flowCapableTransactionService), new SalMetersBatchServiceImpl(salMeterService, flowCapableTransactionService)));
// register experimenter services
rpcContext.registerRpcServiceImplementation(SalExperimenterMessageService.class, new SalExperimenterMessageServiceImpl(rpcContext, deviceContext, extensionConverterProvider));
rpcContext.registerRpcServiceImplementation(SalExperimenterMpMessageService.class, new SalExperimenterMpMessageServiceImpl(rpcContext, deviceContext, extensionConverterProvider));
// register onf extension bundles
rpcContext.registerRpcServiceImplementation(SalBundleService.class, new SalBundleServiceImpl(new SalExperimenterMessageServiceImpl(rpcContext, deviceContext, extensionConverterProvider)));
}
Aggregations