X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Fstatistics%2Fservices%2FAllGroupsStatsService.java;h=e05369237bde7e1b36143914ffd4ae8f3d1a1d95;hb=3ee047a21cbd0754dabaab6d01708d5c20be80fd;hp=55e3368ddf5ca40c1978969c9303c19f3ab24ed6;hpb=8177187cebab29c26a8f0242b997920f006c1add;p=openflowplugin.git diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllGroupsStatsService.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllGroupsStatsService.java index 55e3368ddf..e05369237b 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllGroupsStatsService.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllGroupsStatsService.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the @@ -13,8 +13,7 @@ import org.opendaylight.openflowjava.protocol.api.util.BinContent; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; import org.opendaylight.openflowplugin.api.openflow.device.Xid; -import org.opendaylight.openflowplugin.impl.services.RequestInputUtils; -import org.opendaylight.openflowplugin.impl.services.ServiceException; +import org.opendaylight.openflowplugin.impl.services.util.RequestInputUtils; import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService; import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.GroupStatisticsToNotificationTransformer; import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor; @@ -32,32 +31,26 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestGroupCase; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestGroupCaseBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.group._case.MultipartRequestGroupBuilder; +import org.opendaylight.yangtools.yang.common.Uint32; final class AllGroupsStatsService extends AbstractCompatibleStatService { - - private static final MultipartRequestGroupCase GROUP_CASE; - - static { - final MultipartRequestGroupCaseBuilder caseBuilder = new MultipartRequestGroupCaseBuilder(); - final MultipartRequestGroupBuilder mprGroupBuild = new MultipartRequestGroupBuilder(); - mprGroupBuild.setGroupId(new GroupId(BinContent.intToUnsignedLong(Group.OFPGALL.getIntValue()))); - caseBuilder.setMultipartRequestGroup(mprGroupBuild.build()); - - GROUP_CASE = caseBuilder.build(); - } + private static final MultipartRequestGroupCase GROUP_CASE = new MultipartRequestGroupCaseBuilder() + .setMultipartRequestGroup(new MultipartRequestGroupBuilder() + .setGroupId(new GroupId(Uint32.valueOf(BinContent.intToUnsignedLong(Group.OFPGALL.getIntValue())))) + .build()) + .build(); private final ConvertorExecutor convertorExecutor; - - public AllGroupsStatsService(RequestContextStack requestContextStack, DeviceContext deviceContext, AtomicLong compatibilityXidSeed, ConvertorExecutor convertorExecutor) { + AllGroupsStatsService(final RequestContextStack requestContextStack, final DeviceContext deviceContext, + final AtomicLong compatibilityXidSeed, final ConvertorExecutor convertorExecutor) { super(requestContextStack, deviceContext, compatibilityXidSeed); this.convertorExecutor = convertorExecutor; } - @Override - protected OfHeader buildRequest(final Xid xid, final GetAllGroupStatisticsInput input) throws ServiceException { + protected OfHeader buildRequest(final Xid xid, final GetAllGroupStatisticsInput input) { // Create multipart request header final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader( MultipartType.OFPMPGROUP, xid.getValue(), getVersion()); @@ -70,12 +63,14 @@ final class AllGroupsStatsService extends } @Override - public GetAllGroupStatisticsOutput buildTxCapableResult(TransactionId emulatedTxId) { + public GetAllGroupStatisticsOutput buildTxCapableResult(final TransactionId emulatedTxId) { return new GetAllGroupStatisticsOutputBuilder().setTransactionId(emulatedTxId).build(); } @Override - public GroupStatisticsUpdated transformToNotification(List result, TransactionId emulatedTxId) { - return GroupStatisticsToNotificationTransformer.transformToNotification(result, getDeviceInfo(), emulatedTxId, convertorExecutor); + public GroupStatisticsUpdated transformToNotification(final List result, + final TransactionId emulatedTxId) { + return GroupStatisticsToNotificationTransformer.transformToNotification(result, getDeviceInfo(), emulatedTxId, + convertorExecutor); } }