X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Fstatistics%2Fservices%2Fdirect%2Fsinglelayer%2FSingleLayerDirectStatisticsProviderInitializer.java;fp=openflowplugin-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Fstatistics%2Fservices%2Fdirect%2Fsinglelayer%2FSingleLayerDirectStatisticsProviderInitializer.java;h=97499406792f279a2445b956e8802f8e85c822ac;hb=617a0726d931230945a8a8d28a6e34be39f56b16;hp=0000000000000000000000000000000000000000;hpb=9f8a5a168696e279ae49ed79efe4590abc49b9ba;p=openflowplugin.git diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/singlelayer/SingleLayerDirectStatisticsProviderInitializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/singlelayer/SingleLayerDirectStatisticsProviderInitializer.java new file mode 100644 index 0000000000..9749940679 --- /dev/null +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/singlelayer/SingleLayerDirectStatisticsProviderInitializer.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +package org.opendaylight.openflowplugin.impl.statistics.services.direct.singlelayer; + +import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; +import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; +import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProvider; +import org.opendaylight.openflowplugin.impl.statistics.services.direct.AbstractFlowDirectStatisticsService; +import org.opendaylight.openflowplugin.impl.statistics.services.direct.AbstractGroupDirectStatisticsService; +import org.opendaylight.openflowplugin.impl.statistics.services.direct.AbstractMeterDirectStatisticsService; +import org.opendaylight.openflowplugin.impl.statistics.services.direct.AbstractPortDirectStatisticsService; +import org.opendaylight.openflowplugin.impl.statistics.services.direct.AbstractQueueDirectStatisticsService; +import org.opendaylight.openflowplugin.impl.statistics.services.direct.OpendaylightDirectStatisticsServiceProvider; +import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor; + +/** + * Utility class for instantiating #{@link org.opendaylight.openflowplugin.impl.statistics.services.direct.OpendaylightDirectStatisticsServiceProvider} + * with all multi-layer services already in + */ +public class SingleLayerDirectStatisticsProviderInitializer { + + public static OpendaylightDirectStatisticsServiceProvider createProvider( + final RequestContextStack requestContextStack, + final DeviceContext deviceContext, + final ConvertorExecutor convertorExecutor, + final MultipartWriterProvider statisticsWriterProvider) { + + final OpendaylightDirectStatisticsServiceProvider provider = new OpendaylightDirectStatisticsServiceProvider(); + + provider.register(AbstractFlowDirectStatisticsService.class, new FlowDirectStatisticsService( + requestContextStack, deviceContext, convertorExecutor, statisticsWriterProvider)); + provider.register(AbstractGroupDirectStatisticsService.class, new FlowDirectStatisticsService( + requestContextStack, deviceContext, convertorExecutor, statisticsWriterProvider)); + provider.register(AbstractMeterDirectStatisticsService.class, new MeterDirectStatisticsService( + requestContextStack, deviceContext, convertorExecutor, statisticsWriterProvider)); + provider.register(AbstractPortDirectStatisticsService.class, new PortDirectStatisticsService( + requestContextStack, deviceContext, convertorExecutor, statisticsWriterProvider)); + provider.register(AbstractQueueDirectStatisticsService.class, new QueueDirectStatisticsService( + requestContextStack, deviceContext, convertorExecutor, statisticsWriterProvider)); + + return provider; + } + +}