Merge "SONAR TD - AbstractService"
authorJozef Bacigal <jozef.bacigal@pantheon.tech>
Mon, 15 Aug 2016 12:56:49 +0000 (12:56 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 15 Aug 2016 12:56:49 +0000 (12:56 +0000)
37 files changed:
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/EchoService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/FlowCapableTransactionServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/FlowService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/GroupService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/MeterService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/NodeConfigServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/PacketProcessingServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/RoleService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalExperimenterMessageServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalPortServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalRoleServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SalTableServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/ServiceException.java [new file with mode: 0644]
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AggregateFlowsInTableService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllFlowsInAllTablesService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllFlowsInTableService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllGroupsStatsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllMeterConfigStatsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllMeterStatsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllPortStatsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllQueuesAllPortsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/AllQueuesOnePortService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/FlowsInTableService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/GroupDescriptionService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/GroupFeaturesService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/GroupStatsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/MatchingFlowsInTableService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/MeterFeaturesService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/MeterStatsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OneQueueOnePortService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/OpendaylightFlowTableStatisticsServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/PortStatsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/dedicated/StatisticsGatheringOnTheFlyService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/dedicated/StatisticsGatheringService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/AbstractDirectStatisticsService.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/SalPortServiceImplTest.java

index 57e86731f8eb336ae6825fbb7c276a9811fad5ba..546e57119aa2c9e931f6467b8625cf505d3b42e4 100644 (file)
@@ -87,7 +87,7 @@ abstract class AbstractService<I, O> {
         return messageSpy;
     }
 
-    protected abstract OfHeader buildRequest(Xid xid, I input) throws Exception;
+    protected abstract OfHeader buildRequest(Xid xid, I input) throws ServiceException;
 
     protected abstract FutureCallback<OfHeader> createCallback(RequestContext<O> context, Class<?> requestType);
 
index 8afe07ea2ff29b5435e4989944323ac27f555d94..0bf4a5bba7232cd00041aa2ae7ade503f1e8e98e 100644 (file)
@@ -20,7 +20,7 @@ public class EchoService extends AbstractSimpleService<EchoInputBuilder, EchoOut
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final EchoInputBuilder input) throws Exception {
+    protected OfHeader buildRequest(final Xid xid, final EchoInputBuilder input) throws ServiceException {
         return input
                 .setXid(xid.getValue())
                 .setVersion(getVersion())
index bbba541d3d630be96aa732f918c7f36fce8a9b4b..f319947cf34df9761de337ea37fabcaf9053f0bf 100644 (file)
@@ -28,7 +28,7 @@ public class FlowCapableTransactionServiceImpl extends AbstractVoidService<SendB
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final SendBarrierInput input) {
+    protected OfHeader buildRequest(final Xid xid, final SendBarrierInput input) throws ServiceException {
         final BarrierInputBuilder barrierInputOFJavaBuilder = new BarrierInputBuilder();
         barrierInputOFJavaBuilder.setVersion(getVersion());
         barrierInputOFJavaBuilder.setXid(xid.getValue());
index e3fbb01c027ddf5ceea8bcdf758d98de160974c7..e865d903309eb989b4cccb051cab52eacd481c2e 100644 (file)
@@ -42,7 +42,7 @@ final class FlowService<O extends DataObject> extends AbstractSimpleService<Flow
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final FlowModInputBuilder input) {
+    protected OfHeader buildRequest(final Xid xid, final FlowModInputBuilder input) throws ServiceException {
         input.setXid(xid.getValue());
         return input.build();
     }
index d0f50eaa74a0de2792473859c680a050509ad25d..aa1ebe15ccf02e0fcb808fe3c9321f63f68f350b 100644 (file)
@@ -31,7 +31,7 @@ final class GroupService<I extends Group, O extends DataObject> extends Abstract
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final I input) {
+    protected OfHeader buildRequest(final Xid xid, final I input) throws ServiceException {
         final Optional<GroupModInputBuilder> ofGroupModInput = convertorExecutor.convert(input, data);
 
         final GroupModInputBuilder groupModInputBuilder = ofGroupModInput
index 91d4abbacbdca82c53c9c2b27cd837ef2477c752..7b6fc8e69b7f123fbdf8cec2717638cda287f5b8 100644 (file)
@@ -31,7 +31,7 @@ final class MeterService<I extends Meter, O extends DataObject> extends Abstract
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final I input) {
+    protected OfHeader buildRequest(final Xid xid, final I input) throws ServiceException {
         final Optional<MeterModInputBuilder> ofMeterModInput = convertorExecutor.convert(input, data);
         final MeterModInputBuilder meterModInputBuilder = ofMeterModInput
                 .orElse(MeterConvertor.defaultResult(getVersion()));
index 420dc80827b4209d86296f76fafbe09b12f01436..5a45f44336de19ddf9f3c92443a5bc7721c197bf 100644 (file)
@@ -30,7 +30,7 @@ public final class NodeConfigServiceImpl extends AbstractSimpleService<SetConfig
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final SetConfigInput input) {
+    protected OfHeader buildRequest(final Xid xid, final SetConfigInput input) throws ServiceException {
         SetConfigInputBuilder builder = new SetConfigInputBuilder();
         SwitchConfigFlag flag = SwitchConfigFlag.valueOf(input.getFlag());
 
index b8449e49545e50faba0a24de2fa137847750fe35..e32dbb5337d5fcb67703c41b073860740f2d1959 100644 (file)
@@ -36,7 +36,7 @@ public final class PacketProcessingServiceImpl extends AbstractVoidService<Trans
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final TransmitPacketInput input) {
+    protected OfHeader buildRequest(final Xid xid, final TransmitPacketInput input) throws ServiceException {
         final PacketOutConvertorData data = new PacketOutConvertorData(getVersion());
         data.setDatapathId(getDatapathId());
         data.setXid(xid.getValue());
index de1ad3efea2b1e887d0f349537aa839348573fdf..c2653bf20803c14d2e6f491fd96608019f79a07a 100644 (file)
@@ -47,7 +47,7 @@ public class RoleService extends AbstractSimpleService<RoleRequestInputBuilder,
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final RoleRequestInputBuilder input) {
+    protected OfHeader buildRequest(final Xid xid, final RoleRequestInputBuilder input) throws ServiceException {
         input.setXid(xid.getValue());
         return input.build();
     }
index 6baeda6c3a784ead8f9730620a20a841c271389f..b1969eb08dca33f12f041bf0526e1ca44c950fd8 100644 (file)
@@ -37,21 +37,28 @@ public class SalExperimenterMessageServiceImpl extends AbstractVoidService<SendE
     }
 
     @Override
-    protected OfHeader buildRequest(Xid xid, SendExperimenterInput input) throws ConversionException {
+    protected OfHeader buildRequest(Xid xid, SendExperimenterInput input) throws ServiceException {
         final TypeVersionKey key = new TypeVersionKey(input.getExperimenterMessageOfChoice().getImplementedInterface(), getVersion());
         final ConvertorMessageToOFJava<ExperimenterMessageOfChoice, ExperimenterDataOfChoice> messageConverter =
                 extensionConverterProvider.getMessageConverter(key);
 
         if (messageConverter == null) {
-            throw new ConverterNotFoundException(key.toString());
+            throw new ServiceException(new ConverterNotFoundException(key.toString()));
         }
-        
-        final ExperimenterInputBuilder experimenterInputBld = new ExperimenterInputBuilder()
-                .setExperimenter(messageConverter.getExperimenterId())
-                .setExpType(messageConverter.getType())
-                .setExperimenterDataOfChoice(messageConverter.convert(input.getExperimenterMessageOfChoice()))
-                .setVersion(getVersion())
-                .setXid(xid.getValue());
+
+        final ExperimenterInputBuilder experimenterInputBld;
+
+        try {
+            experimenterInputBld = new ExperimenterInputBuilder()
+                    .setExperimenter(messageConverter.getExperimenterId())
+                    .setExpType(messageConverter.getType())
+                    .setExperimenterDataOfChoice(messageConverter.convert(input.getExperimenterMessageOfChoice()))
+                    .setVersion(getVersion())
+                    .setXid(xid.getValue());
+        } catch (ConversionException e) {
+            throw new ServiceException(e);
+        }
+
         return experimenterInputBld.build();
     }
 
index 86f9afe8e98174c068903c4db3aeca90ec5aed66..3fc621e356a990966b517c924df375876cd0a7b9 100644 (file)
@@ -40,7 +40,7 @@ public final class SalPortServiceImpl extends AbstractSimpleService<UpdatePortIn
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final UpdatePortInput input) {
+    protected OfHeader buildRequest(final Xid xid, final UpdatePortInput input) throws ServiceException {
         final Port inputPort = input.getUpdatedPort().getPort().getPort().get(0);
         final Optional<PortModInput> ofPortModInput = convertorExecutor.convert(inputPort, data);
 
index e357397d09a13b0f8ef21d3f129b395f49b725c8..9906515af633106c39dd1f239c6e653ff2d35722 100644 (file)
@@ -58,7 +58,7 @@ public final class SalRoleServiceImpl extends AbstractSimpleService<SetRoleInput
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final SetRoleInput input) {
+    protected OfHeader buildRequest(final Xid xid, final SetRoleInput input) throws ServiceException {
         return null;
     }
 
index 25ccd243ae49e1b9a44628d91b963349e881bd56..ef757c9c4f80bce02bd22f370d24f8e27193fd0d 100644 (file)
@@ -170,7 +170,7 @@ public final class SalTableServiceImpl extends AbstractMultipartService<UpdateTa
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final UpdateTableInput input) {
+    protected OfHeader buildRequest(final Xid xid, final UpdateTableInput input) throws ServiceException {
         final MultipartRequestTableFeaturesCaseBuilder caseBuilder = new MultipartRequestTableFeaturesCaseBuilder();
         final MultipartRequestTableFeaturesBuilder requestBuilder = new MultipartRequestTableFeaturesBuilder();
 
diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/ServiceException.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/ServiceException.java
new file mode 100644 (file)
index 0000000..7804e0b
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2016 Cisco Systems, Inc. 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.services;
+
+/**
+ * Exception thrown by {@link org.opendaylight.openflowplugin.impl.services.AbstractService#buildRequest(org.opendaylight.openflowplugin.api.openflow.device.Xid, Object)}
+ */
+public class ServiceException extends Exception {
+    public ServiceException(Throwable cause) {
+        super(cause);
+    }
+}
index 45a19e1ae56add3299a60952f6b4e908655757d1..5d8fa400d71cee9467a0f7cb627956ca89afe1e8 100644 (file)
@@ -18,6 +18,7 @@ import org.opendaylight.openflowplugin.api.openflow.device.TranslatorLibrary;
 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
 import org.opendaylight.openflowplugin.api.openflow.md.core.TranslatorKey;
 import org.opendaylight.openflowplugin.impl.services.RequestInputUtils;
+import org.opendaylight.openflowplugin.impl.services.ServiceException;
 import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.openflowplugin.openflow.md.util.FlowCreatorUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.AggregateFlowStatisticsUpdate;
@@ -54,7 +55,7 @@ public final class AggregateFlowsInTableService extends AbstractCompatibleStatSe
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input) throws ServiceException {
         // Create multipart request body for fetch all the group stats
         final MultipartRequestAggregateCaseBuilder multipartRequestAggregateCaseBuilder = new MultipartRequestAggregateCaseBuilder();
         final MultipartRequestAggregateBuilder mprAggregateRequestBuilder = new MultipartRequestAggregateBuilder();
index caa24be942bf1815b0351f75e5f3f0900c86b4e7..c466f1dde37cbbef8bb7981f716cc2dae517c368 100644 (file)
@@ -14,6 +14,7 @@ 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.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.FlowStatisticsToNotificationTransformer;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
@@ -55,7 +56,7 @@ public final class AllFlowsInAllTablesService extends AbstractCompatibleStatServ
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAllFlowsStatisticsFromAllFlowTablesInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetAllFlowsStatisticsFromAllFlowTablesInput input) throws ServiceException {
         final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(
                 MultipartType.OFPMPFLOW, xid.getValue(), getVersion());
         mprInput.setMultipartRequestBody(flowCase);
index d7a4af5da35782cbb5dfb4c6c5dcf9b38b5cc39a..d37a31dc8c0a505f56e776861473181fbe6d0647 100644 (file)
@@ -15,6 +15,7 @@ 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.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.FlowStatisticsToNotificationTransformer;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
@@ -44,7 +45,7 @@ public class AllFlowsInTableService extends AbstractCompatibleStatService<GetAll
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAllFlowStatisticsFromFlowTableInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetAllFlowStatisticsFromFlowTableInput input) throws ServiceException {
         final MultipartRequestFlowBuilder mprFlowRequestBuilder = new MultipartRequestFlowBuilder();
         mprFlowRequestBuilder.setTableId(input.getTableId().getValue());
         mprFlowRequestBuilder.setOutPort(OFConstants.OFPP_ANY);
index 4c563dde03196afba06de62ea70049daa8863dfe..55e3368ddf5ca40c1978969c9303c19f3ab24ed6 100644 (file)
@@ -14,6 +14,7 @@ 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.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.GroupStatisticsToNotificationTransformer;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
@@ -56,7 +57,7 @@ final class AllGroupsStatsService extends
 
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAllGroupStatisticsInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetAllGroupStatisticsInput input) throws ServiceException {
         // Create multipart request header
         final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(
                 MultipartType.OFPMPGROUP, xid.getValue(), getVersion());
index 19768808addff4e38b2a971e62894b6599adcb73..bb72f11925cf4ba1b25d31c7b0a2c08b53d1f421 100644 (file)
@@ -16,6 +16,7 @@ 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.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData;
@@ -65,7 +66,7 @@ final class AllMeterConfigStatsService
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAllMeterConfigStatisticsInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetAllMeterConfigStatisticsInput input) throws ServiceException {
         MultipartRequestInputBuilder mprInput = RequestInputUtils
                 .createMultipartHeader(MultipartType.OFPMPMETERCONFIG, xid.getValue(), getVersion());
         return mprInput.setMultipartRequestBody(METER_CONFIG_CASE).build();
index 2c47f1ec58c6109ef97eb8f6eab2042db9a16c7e..ef80529f9c7addbc4b55354de4a2aab01cb37eb4 100644 (file)
@@ -14,6 +14,7 @@ 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.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.MeterStatisticsToNotificationTransformer;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
@@ -55,7 +56,7 @@ final class AllMeterStatsService
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAllMeterStatisticsInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetAllMeterStatisticsInput input) throws ServiceException {
         MultipartRequestInputBuilder mprInput = RequestInputUtils
                 .createMultipartHeader(MultipartType.OFPMPMETER, xid.getValue(), getVersion());
         return mprInput.setMultipartRequestBody(METER_CASE).build();
index 20be7f9433deefcd7e451bcc20a8e34e54089687..393dc43b95770831a678a663162048110ea60cd4 100644 (file)
@@ -14,6 +14,7 @@ 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.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.NodeConnectorStatisticsToNotificationTransformer;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
@@ -51,7 +52,7 @@ final class AllPortStatsService
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAllNodeConnectorsStatisticsInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetAllNodeConnectorsStatisticsInput input) throws ServiceException {
         MultipartRequestInputBuilder mprInput = RequestInputUtils
                 .createMultipartHeader(MultipartType.OFPMPPORTSTATS, xid.getValue(), getVersion());
         mprInput.setMultipartRequestBody(PORT_STATS_CASE);
index ca34feb4c5dbecbcaf51ad09652ef1c176269564..054a99ac36cd77121ac77774005f9c2895afeb7b 100644 (file)
@@ -14,6 +14,7 @@ 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.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.QueueStatisticsToNotificationTransformer;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
@@ -51,7 +52,7 @@ final class AllQueuesAllPortsService
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAllQueuesStatisticsFromAllPortsInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetAllQueuesStatisticsFromAllPortsInput input) throws ServiceException {
         // Set request body to main multipart request
         MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(
                 MultipartType.OFPMPQUEUE, xid.getValue(), getVersion());
index 697edecaa01525037769cc80bf430cd323ac8ec7..0372c699f822fd734724279a1969e7ab7c74730a 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
 import org.opendaylight.openflowplugin.impl.services.RequestInputUtils;
+import org.opendaylight.openflowplugin.impl.services.ServiceException;
 import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.QueueStatisticsToNotificationTransformer;
 import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil;
@@ -38,7 +39,7 @@ final class AllQueuesOnePortService
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAllQueuesStatisticsFromGivenPortInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetAllQueuesStatisticsFromGivenPortInput input) throws ServiceException {
         MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
         MultipartRequestQueueBuilder mprQueueBuilder = new MultipartRequestQueueBuilder();
         // Select all queues
index 1bf30f6650d1106f00bc9e61c0ce7bc745db437a..58f5c45df8f43350a9fd8dbe9a13ce29b6268e32 100644 (file)
@@ -14,6 +14,7 @@ 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.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.FlowStatisticsToNotificationTransformer;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
@@ -41,7 +42,7 @@ public final class FlowsInTableService extends AbstractCompatibleStatService<Get
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetFlowStatisticsFromFlowTableInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetFlowStatisticsFromFlowTableInput input) throws ServiceException {
         final MultipartRequestFlowCaseBuilder multipartRequestFlowCaseBuilder = new MultipartRequestFlowCaseBuilder();
         final MultipartRequestFlowBuilder mprFlowRequestBuilder = new MultipartRequestFlowBuilder();
 
index 1858309ae3298e7ac7d71694c2c842fed900347b..2e6ca05a69debca42c280f22f6c1f7710ae119de 100644 (file)
@@ -15,6 +15,7 @@ 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.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData;
@@ -45,7 +46,7 @@ final class GroupDescriptionService
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetGroupDescriptionInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetGroupDescriptionInput input) throws ServiceException {
         final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(
                 MultipartType.OFPMPGROUPDESC, xid.getValue(), getVersion());
         mprInput.setMultipartRequestBody(GROUP_DESC_CASE);
index 008429797eff41b0cb774dee8f2cc4c7cc71face..9e93ba56d6a115f1e24e5387206c45729399241e 100644 (file)
@@ -16,6 +16,7 @@ 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.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupFeaturesInput;
@@ -56,7 +57,7 @@ final class GroupFeaturesService
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetGroupFeaturesInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetGroupFeaturesInput input) throws ServiceException {
         final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(
                 MultipartType.OFPMPGROUPFEATURES, xid.getValue(), getVersion());
         mprInput.setMultipartRequestBody(GROUP_FEAT_CASE);
index edb78d16ce31c3a2fdf82cdbd0a659adc3e711ec..ce95e5f75e0fb9246a044cc9e819a6c4f63eafea 100644 (file)
@@ -13,6 +13,7 @@ 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.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.GroupStatisticsToNotificationTransformer;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
@@ -40,7 +41,7 @@ final class GroupStatsService
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetGroupStatisticsInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetGroupStatisticsInput input) throws ServiceException {
         final MultipartRequestGroupCaseBuilder caseBuilder = new MultipartRequestGroupCaseBuilder();
         final MultipartRequestGroupBuilder mprGroupBuild = new MultipartRequestGroupBuilder();
         mprGroupBuild.setGroupId(new GroupId(input.getGroupId().getValue()));
index 5e013172047008dabc9cb64c02043388ff3f2a9d..1a6ba9c00c0a17b547b04d2174d54fe2e4e0432c 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.openflowplugin.api.openflow.device.Xid;
 import org.opendaylight.openflowplugin.impl.services.AbstractMultipartService;
 import org.opendaylight.openflowplugin.impl.services.RequestInputUtils;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
+import org.opendaylight.openflowplugin.impl.services.ServiceException;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.MatchReactor;
 import org.opendaylight.openflowplugin.openflow.md.util.FlowCreatorUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput;
@@ -34,7 +35,7 @@ final class MatchingFlowsInTableService extends AbstractMultipartService<GetAggr
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) throws ServiceException {
         final MultipartRequestAggregateCaseBuilder multipartRequestAggregateCaseBuilder = new MultipartRequestAggregateCaseBuilder();
         final MultipartRequestAggregateBuilder mprAggregateRequestBuilder = new MultipartRequestAggregateBuilder();
         final short tableId = MoreObjects.firstNonNull(input.getTableId(), OFConstants.OFPTT_ALL).shortValue();
index 5409a641366a80ec3d750daba289e46a36e73025..cd97a7364b39d126be87c11cd65c62d6e527b22d 100644 (file)
@@ -16,6 +16,7 @@ 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.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
@@ -52,7 +53,7 @@ final class MeterFeaturesService
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetMeterFeaturesInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetMeterFeaturesInput input) throws ServiceException {
         MultipartRequestInputBuilder mprInput =
                 RequestInputUtils.createMultipartHeader(MultipartType.OFPMPMETERFEATURES, xid.getValue(), getVersion());
         mprInput.setMultipartRequestBody(METER_FEATURES_CASE);
index d7c0ec0209bc29cb66467cb3c5ebf9937826e82a..2a0b96969f9e196f38d94f2319f2fc2a23427f6f 100644 (file)
@@ -13,6 +13,7 @@ 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.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.MeterStatisticsToNotificationTransformer;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
@@ -40,7 +41,7 @@ final class MeterStatsService
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetMeterStatisticsInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetMeterStatisticsInput input) throws ServiceException {
         MultipartRequestMeterCaseBuilder caseBuilder =
                 new MultipartRequestMeterCaseBuilder();
         MultipartRequestMeterBuilder mprMeterBuild =
index 469c91362e5dabba9e1a9763a0b987c6a1e63610..12ebb39efc4f8165ebdbd0551bcce7712f7c9471 100644 (file)
@@ -14,6 +14,7 @@ import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
 import org.opendaylight.openflowplugin.impl.services.RequestInputUtils;
+import org.opendaylight.openflowplugin.impl.services.ServiceException;
 import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.QueueStatisticsToNotificationTransformer;
 import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil;
@@ -37,7 +38,7 @@ final class OneQueueOnePortService
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetQueueStatisticsFromGivenPortInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetQueueStatisticsFromGivenPortInput input) throws ServiceException {
         MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
         MultipartRequestQueueBuilder mprQueueBuilder = new MultipartRequestQueueBuilder();
         // Select specific queue
index 326e6f7d55ff2992ef2a42a3b439fd64a9be8f33..efc8e6fcb2e61e3c84c7c4373d50bd26c9431ab1 100644 (file)
@@ -16,6 +16,7 @@ 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.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64;
@@ -61,7 +62,7 @@ public final class OpendaylightFlowTableStatisticsServiceImpl extends
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetFlowTablesStatisticsInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetFlowTablesStatisticsInput input) throws ServiceException {
         // Create multipart request body for fetch all the group stats
         final MultipartRequestTableCaseBuilder multipartRequestTableCaseBuilder = new MultipartRequestTableCaseBuilder();
         final MultipartRequestTableBuilder multipartRequestTableBuilder = new MultipartRequestTableBuilder();
index 8354c3df762237e089208818159c10c9174fd617..8355c96e0da1d6bd94a2027f5cc71220efa536b5 100644 (file)
@@ -14,6 +14,7 @@ import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
 import org.opendaylight.openflowplugin.impl.services.RequestInputUtils;
+import org.opendaylight.openflowplugin.impl.services.ServiceException;
 import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.AbstractCompatibleStatService;
 import org.opendaylight.openflowplugin.impl.statistics.services.compatibility.NodeConnectorStatisticsToNotificationTransformer;
 import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil;
@@ -37,7 +38,7 @@ final class PortStatsService
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetNodeConnectorStatisticsInput input) {
+    protected OfHeader buildRequest(final Xid xid, final GetNodeConnectorStatisticsInput input) throws ServiceException {
         MultipartRequestPortStatsCaseBuilder caseBuilder =
                 new MultipartRequestPortStatsCaseBuilder();
         MultipartRequestPortStatsBuilder mprPortStatsBuilder =
index 1ba77a309bc04dfa0264a4c4df0dfdea41221875..a88e405b7c71372a3cb846253e2f7c52713c525f 100644 (file)
@@ -17,6 +17,7 @@ import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.Event
 import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.StatisticsGatherer;
 import org.opendaylight.openflowplugin.impl.common.MultipartRequestInputFactory;
 import org.opendaylight.openflowplugin.impl.services.AbstractMultipartOnTheFlyService;
+import org.opendaylight.openflowplugin.impl.services.ServiceException;
 import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCounter;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
@@ -46,7 +47,7 @@ public class StatisticsGatheringOnTheFlyService extends AbstractMultipartOnTheFl
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final MultipartType input) {
+    protected OfHeader buildRequest(final Xid xid, final MultipartType input) throws ServiceException {
         return MultipartRequestInputFactory.makeMultipartRequestInput(xid.getValue(), getVersion(), input);
     }
 }
index b6f1b10f33c0c102ac85f5741d45a40616fc6e43..fc0f8d3f3ff3c09a6833ddc9efdab0eeb556be47 100644 (file)
@@ -17,6 +17,7 @@ import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.Event
 import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.StatisticsGatherer;
 import org.opendaylight.openflowplugin.impl.common.MultipartRequestInputFactory;
 import org.opendaylight.openflowplugin.impl.services.AbstractMultipartService;
+import org.opendaylight.openflowplugin.impl.services.ServiceException;
 import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCounter;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply;
@@ -45,7 +46,7 @@ public class StatisticsGatheringService extends AbstractMultipartService<Multipa
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final MultipartType input) {
+    protected OfHeader buildRequest(final Xid xid, final MultipartType input) throws ServiceException {
         return MultipartRequestInputFactory.makeMultipartRequestInput(xid.getValue(), getVersion(), input);
     }
 }
index 156c34a0cdefab96376ef45eca564ceb75084fb0..d8ad2ae86b3e47b65709ffe78e0720e12424a9e6 100644 (file)
@@ -23,6 +23,7 @@ import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
 import org.opendaylight.openflowplugin.impl.services.AbstractMultipartService;
 import org.opendaylight.openflowplugin.impl.services.RequestInputUtils;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
+import org.opendaylight.openflowplugin.impl.services.ServiceException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.StoreStatsGrouping;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply;
@@ -107,7 +108,7 @@ public abstract class AbstractDirectStatisticsService<I extends StoreStatsGroupi
     }
 
     @Override
-    protected OfHeader buildRequest(Xid xid, I input) throws Exception {
+    protected OfHeader buildRequest(Xid xid, I input) throws ServiceException {
         return RequestInputUtils.createMultipartHeader(multipartType, xid.getValue(), getVersion())
                 .setMultipartRequestBody(buildRequestBody(input))
                 .build();
index a8940cb58ff5bc26e6e86e3cd71e4a913d77d9cf..c0d55986fcd49a23ae3b2c7b6394603dd9eb4a43 100644 (file)
@@ -51,7 +51,7 @@ public class SalPortServiceImplTest extends ServiceMocking {
     }
 
     @Test
-    public void testBuildRequest() {
+    public void testBuildRequest() throws Exception {
         final OfHeader ofHeader = salPortService.buildRequest(new Xid(DUMMY_XID), dummyUpdatePortInput());
     }