Search in sources :

Example 1 with OpendaylightFlowStatisticsServiceDelegateImpl

use of org.opendaylight.openflowplugin.impl.statistics.services.compatibility.OpendaylightFlowStatisticsServiceDelegateImpl in project openflowplugin by opendaylight.

the class MdSalRegistrationUtils method registerStatCompatibilityServices.

/**
 * Support deprecated statistic related services for backward compatibility. The only exception from deprecation is
 * the aggregated flow statistic with match criteria input.
 *
 * @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 notificationPublishService - notification service
 *
 * @param convertorExecutor - convertor executor
 */
public static void registerStatCompatibilityServices(final RpcContext rpcContext, final DeviceContext deviceContext, final NotificationPublishService notificationPublishService, final ConvertorExecutor convertorExecutor) {
    AtomicLong compatibilityXidSeed = new AtomicLong();
    // pickup low statistics service
    final OpendaylightFlowStatisticsService flowStatisticsService = Preconditions.checkNotNull(rpcContext.lookupRpcService(OpendaylightFlowStatisticsService.class));
    // attach delegate to flow statistics service (to cover all but aggregated stats with match filter input)
    final OpendaylightFlowStatisticsServiceDelegateImpl flowStatisticsDelegate = new OpendaylightFlowStatisticsServiceDelegateImpl(rpcContext, deviceContext, notificationPublishService, new AtomicLong(), convertorExecutor);
    ((Delegator<OpendaylightFlowStatisticsService>) flowStatisticsService).setDelegate(flowStatisticsDelegate);
    // register all statistics (deprecated) services
    rpcContext.registerRpcServiceImplementation(OpendaylightFlowTableStatisticsService.class, new OpendaylightFlowTableStatisticsServiceImpl(rpcContext, deviceContext, compatibilityXidSeed, notificationPublishService));
    rpcContext.registerRpcServiceImplementation(OpendaylightGroupStatisticsService.class, new OpendaylightGroupStatisticsServiceImpl(rpcContext, deviceContext, compatibilityXidSeed, notificationPublishService, convertorExecutor));
    rpcContext.registerRpcServiceImplementation(OpendaylightMeterStatisticsService.class, new OpendaylightMeterStatisticsServiceImpl(rpcContext, deviceContext, compatibilityXidSeed, notificationPublishService, convertorExecutor));
    rpcContext.registerRpcServiceImplementation(OpendaylightQueueStatisticsService.class, new OpendaylightQueueStatisticsServiceImpl(rpcContext, deviceContext, compatibilityXidSeed, notificationPublishService));
    rpcContext.registerRpcServiceImplementation(OpendaylightPortStatisticsService.class, new OpendaylightPortStatisticsServiceImpl(rpcContext, deviceContext, compatibilityXidSeed, notificationPublishService));
}
Also used : OpendaylightFlowStatisticsServiceDelegateImpl(org.opendaylight.openflowplugin.impl.statistics.services.compatibility.OpendaylightFlowStatisticsServiceDelegateImpl) AtomicLong(java.util.concurrent.atomic.AtomicLong) OpendaylightMeterStatisticsServiceImpl(org.opendaylight.openflowplugin.impl.statistics.services.OpendaylightMeterStatisticsServiceImpl) OpendaylightPortStatisticsServiceImpl(org.opendaylight.openflowplugin.impl.statistics.services.OpendaylightPortStatisticsServiceImpl) Delegator(org.opendaylight.openflowplugin.api.openflow.statistics.compatibility.Delegator) OpendaylightQueueStatisticsServiceImpl(org.opendaylight.openflowplugin.impl.statistics.services.OpendaylightQueueStatisticsServiceImpl) OpendaylightGroupStatisticsServiceImpl(org.opendaylight.openflowplugin.impl.statistics.services.OpendaylightGroupStatisticsServiceImpl) OpendaylightFlowTableStatisticsServiceImpl(org.opendaylight.openflowplugin.impl.statistics.services.OpendaylightFlowTableStatisticsServiceImpl) OpendaylightFlowStatisticsService(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService)

Aggregations

AtomicLong (java.util.concurrent.atomic.AtomicLong)1 Delegator (org.opendaylight.openflowplugin.api.openflow.statistics.compatibility.Delegator)1 OpendaylightFlowTableStatisticsServiceImpl (org.opendaylight.openflowplugin.impl.statistics.services.OpendaylightFlowTableStatisticsServiceImpl)1 OpendaylightGroupStatisticsServiceImpl (org.opendaylight.openflowplugin.impl.statistics.services.OpendaylightGroupStatisticsServiceImpl)1 OpendaylightMeterStatisticsServiceImpl (org.opendaylight.openflowplugin.impl.statistics.services.OpendaylightMeterStatisticsServiceImpl)1 OpendaylightPortStatisticsServiceImpl (org.opendaylight.openflowplugin.impl.statistics.services.OpendaylightPortStatisticsServiceImpl)1 OpendaylightQueueStatisticsServiceImpl (org.opendaylight.openflowplugin.impl.statistics.services.OpendaylightQueueStatisticsServiceImpl)1 OpendaylightFlowStatisticsServiceDelegateImpl (org.opendaylight.openflowplugin.impl.statistics.services.compatibility.OpendaylightFlowStatisticsServiceDelegateImpl)1 OpendaylightFlowStatisticsService (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService)1