Fix checkstyle warnings for services package 82/62082/6
authormiroslav.macko <miroslav.macko@pantheon.tech>
Mon, 21 Aug 2017 12:01:07 +0000 (14:01 +0200)
committermiroslav.macko <miroslav.macko@pantheon.tech>
Tue, 22 Aug 2017 10:23:57 +0000 (12:23 +0200)
See also: bug 8607

Change-Id: I1f97d8faed46209423f95170af2413e0fb4beb07
Signed-off-by: miroslav.macko <miroslav.macko@pantheon.tech>
79 files changed:
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractAggregateFlowMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractExperimenterMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractMultipartCollectorService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractMultipartOnTheFlyService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractMultipartRequestCallback.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractMultipartRequestOnTheFlyCallback.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractRequestCallback.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractSilentErrorService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractSimpleService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractTableMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractVoidService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/RoleService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/SimpleRequestCallback.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/BatchStepJob.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/BatchStepType.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchFlowAdapters.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchGroupAdapters.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchMeterAdapters.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerAggregateFlowMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerExperimenterMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerFlowMultipartRequestOnTheFlyCallback.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerFlowService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerGroupService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerMeterService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerMultipartCollectorService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerMultipartRequestCallback.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerTableMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/FlowCapableTransactionServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/NodeConfigServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/PacketProcessingServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalEchoServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalExperimenterMessageServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalExperimenterMpMessageServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalFlatBatchServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalFlowServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalFlowsBatchServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalGroupServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalGroupsBatchServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalMeterServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalMetersBatchServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalPortServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalRoleServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalTableServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerAggregateFlowMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerExperimenterMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerFlowMultipartRequestOnTheFlyCallback.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerFlowService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerMultipartCollectorService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerMultipartRequestCallback.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerTableMultipartService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/util/RequestContextUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/util/ServiceException.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/DeviceInitializationUtil.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/AbstractRequestCallbackTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/MultipartRequestCallbackTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/MultipartRequestOnTheFlyCallbackTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/ServiceMocking.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchFlowAdaptersTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchGroupAdaptersTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchMeterAdaptersTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/FlowCapableTransactionServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/NodeConfigServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/PacketProcessingServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalEchoServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalExperimenterMessageServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalFlatBatchServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalFlowServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalFlowsBatchServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalGroupServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalGroupsBatchServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalMeterServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalMetersBatchServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalPortServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalRoleServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalTableServiceImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerAggregateFlowMultipartServiceTest.java

index 521565c465120ebfc4e489fa54dbc0e709f2d15b..32cb41d6a51faa3c882a4f43a37c4b8ce7a91f49 100644 (file)
@@ -7,10 +7,7 @@
  */
 package org.opendaylight.openflowplugin.impl.device;
 
-import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.MoreExecutors;
 import io.netty.util.HashedWheelTimer;
 import io.netty.util.internal.ConcurrentSet;
 import java.util.Optional;
index 0938cb5b30d15b38b19b413af95d4ca9a8bc8c35..f11c19a5bb3940ea5e1e2a1ed3afeca354fd4107 100644 (file)
@@ -18,16 +18,17 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 public abstract class AbstractAggregateFlowMultipartService<T extends OfHeader>
     extends AbstractMultipartService<GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput, T> {
 
-    public AbstractAggregateFlowMultipartService(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
+    public AbstractAggregateFlowMultipartService(final RequestContextStack requestContextStack,
+                                                 final DeviceContext deviceContext) {
         super(requestContextStack, deviceContext);
     }
 
     /**
-     * Process input and return reply
+     * Process input and return reply.
      * @param input input
      * @return reply
      */
     public abstract Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>> handleAndReply(
-        final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input);
+        GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input);
 
 }
index 4870304a4d6eb6e1af365a5725626c4f79db6cf6..8b043a2581ade3532137a33484f071562a55b43e 100644 (file)
@@ -17,7 +17,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.ser
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
-public abstract class AbstractExperimenterMultipartService<T extends OfHeader> extends AbstractMultipartService<SendExperimenterMpRequestInput, T> {
+public abstract class AbstractExperimenterMultipartService<T extends OfHeader>
+        extends AbstractMultipartService<SendExperimenterMpRequestInput, T> {
 
     private final ExtensionConverterProvider extensionConverterProvider;
 
@@ -28,7 +29,7 @@ public abstract class AbstractExperimenterMultipartService<T extends OfHeader> e
     }
 
     /**
-     * Get extension converter provider
+     * Get extension converter provider.
      * @return extension converter provider
      */
     protected ExtensionConverterProvider getExtensionConverterProvider() {
@@ -36,10 +37,10 @@ public abstract class AbstractExperimenterMultipartService<T extends OfHeader> e
     }
 
     /**
-     * Process experimenter input and result experimenter output
+     * Process experimenter input and result experimenter output.
      * @param input experimenter input
      * @return experimenter output
      */
-    public abstract Future<RpcResult<SendExperimenterMpRequestOutput>> handleAndReply(SendExperimenterMpRequestInput input);
-
+    public abstract Future<RpcResult<SendExperimenterMpRequestOutput>>
+        handleAndReply(SendExperimenterMpRequestInput input);
 }
index 62546b47f3234a6e733b861a7c891d5e67d6a1da..5d5a2eca933a92e26e597cba1b9bcb01e02a17cb 100644 (file)
@@ -20,9 +20,11 @@ import org.opendaylight.openflowplugin.impl.util.DeviceInitializationUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 
-public abstract class AbstractMultipartCollectorService<T extends OfHeader> extends AbstractMultipartService<MultipartType, T> {
+public abstract class AbstractMultipartCollectorService<T extends OfHeader>
+        extends AbstractMultipartService<MultipartType, T> {
 
-    protected AbstractMultipartCollectorService(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
+    protected AbstractMultipartCollectorService(final RequestContextStack requestContextStack,
+                                                final DeviceContext deviceContext) {
         super(requestContextStack, deviceContext);
     }
 
@@ -37,7 +39,7 @@ public abstract class AbstractMultipartCollectorService<T extends OfHeader> exte
             }
 
             @Override
-            public void onFailure(@Nonnull final Throwable t) {
+            public void onFailure(@Nonnull final Throwable throwable) {
                 // If we failed getting table features, at least create empty tables
                 if (MultipartType.OFPMPTABLEFEATURES.getClass().equals(requestType)) {
                     DeviceInitializationUtil.makeEmptyTables(
@@ -46,13 +48,16 @@ public abstract class AbstractMultipartCollectorService<T extends OfHeader> exte
                         getDeviceContext().getPrimaryConnectionContext().getFeatures().getTables());
                 }
 
-                callback.onFailure(t);
+                callback.onFailure(throwable);
             }
         };
     }
 
     @Override
     protected OfHeader buildRequest(final Xid xid, final MultipartType input) {
-        return MultipartRequestInputFactory.makeMultipartRequest(xid.getValue(), getVersion(), input, canUseSingleLayerSerialization());
+        return MultipartRequestInputFactory.makeMultipartRequest(xid.getValue(),
+                                                                 getVersion(),
+                                                                 input,
+                                                                 canUseSingleLayerSerialization());
     }
 }
index 9873807cb670190d8d7a07d28a74e0e7fc66e5d9..1b7e8f75acd27c033f239c9ec81ab0f96d73509b 100644 (file)
@@ -13,9 +13,9 @@ import java.util.List;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
+import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProvider;
 import org.opendaylight.openflowplugin.impl.services.multilayer.MultiLayerFlowMultipartRequestOnTheFlyCallback;
 import org.opendaylight.openflowplugin.impl.services.singlelayer.SingleLayerFlowMultipartRequestOnTheFlyCallback;
-import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProvider;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 
@@ -34,10 +34,19 @@ public abstract class AbstractMultipartOnTheFlyService<I, T extends OfHeader> ex
     }
 
     @Override
-    protected final FutureCallback<OfHeader> createCallback(final RequestContext<List<T>> context, final Class<?> requestType) {
+    protected final FutureCallback<OfHeader> createCallback(final RequestContext<List<T>> context,
+                                                            final Class<?> requestType) {
         return canUseSingleLayerSerialization()
-            ? new SingleLayerFlowMultipartRequestOnTheFlyCallback<>(context, requestType, getDeviceContext(), getEventIdentifier(), statisticsWriterProvider)
-            : new MultiLayerFlowMultipartRequestOnTheFlyCallback<>(context, requestType, getDeviceContext(), getEventIdentifier(), statisticsWriterProvider, convertorExecutor);
+            ? new SingleLayerFlowMultipartRequestOnTheFlyCallback<>(context,
+                                                                    requestType,
+                                                                    getDeviceContext(),
+                                                                    getEventIdentifier(),
+                                                                    statisticsWriterProvider)
+            : new MultiLayerFlowMultipartRequestOnTheFlyCallback<>(context,
+                                                                   requestType,
+                                                                   getDeviceContext(),
+                                                                   getEventIdentifier(),
+                                                                   statisticsWriterProvider,
+                                                                   convertorExecutor);
     }
-
 }
index d4a4330da03d6616ecdf826df01dc3289aa4dfe3..508a52cef0f47acae6f57c7c0dcb6d12f02c297e 100644 (file)
@@ -56,17 +56,17 @@ public abstract class AbstractMultipartRequestCallback<T extends OfHeader> exten
     }
 
     /**
-     * Check if result is multipart
+     * Check if result is multipart.
      * @param result result
      * @return true if result is multipart
      */
-    protected abstract boolean isMultipart(final OfHeader result);
+    protected abstract boolean isMultipart(OfHeader result);
 
     /**
-     * Check if result requests more multiparts
+     * Check if result requests more multiparts.
      * @param result result
      * @return true if result requests more multiparts
      */
-    protected abstract boolean isReqMore(final T result);
+    protected abstract boolean isReqMore(T result);
 
 }
index 6150fa9d8048620430542963b3f957727e037ef3..43a3450d40e6eba648e4bb78e9eb920bf156f74d 100644 (file)
@@ -32,7 +32,8 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public abstract class AbstractMultipartRequestOnTheFlyCallback<T extends OfHeader> extends AbstractMultipartRequestCallback<T> {
+public abstract class AbstractMultipartRequestOnTheFlyCallback<T extends OfHeader>
+                                                        extends AbstractMultipartRequestCallback<T> {
     private static final Logger LOG = LoggerFactory.getLogger(AbstractMultipartRequestOnTheFlyCallback.class);
     private final DeviceInfo deviceInfo;
     private final EventIdentifier doneEventIdentifier;
@@ -49,7 +50,8 @@ public abstract class AbstractMultipartRequestOnTheFlyCallback<T extends OfHeade
                                                     final ConvertorExecutor convertorExecutor) {
         super(context, requestType, deviceContext, eventIdentifier);
         deviceInfo = deviceContext.getDeviceInfo();
-        doneEventIdentifier = new EventIdentifier(getMultipartType().name(), deviceContext.getDeviceInfo().getNodeId().toString());
+        doneEventIdentifier =
+                new EventIdentifier(getMultipartType().name(), deviceContext.getDeviceInfo().getNodeId().toString());
         txFacade = deviceContext;
         deviceRegistry = deviceContext;
         this.statisticsWriterProvider = statisticsWriterProvider;
@@ -57,7 +59,7 @@ public abstract class AbstractMultipartRequestOnTheFlyCallback<T extends OfHeade
     }
 
     @Override
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({"unchecked", "checkstyle:IllegalCatch"})
     public void onSuccess(final OfHeader result) {
         if (Objects.isNull(result)) {
             LOG.warn("Response received was null.");
@@ -100,7 +102,9 @@ public abstract class AbstractMultipartRequestOnTheFlyCallback<T extends OfHeade
             } catch (final Exception ex) {
                 LOG.warn("Unexpected exception occurred while translating response: {}.", result.getClass(), ex);
                 setResult(RpcResultBuilder.<List<T>>failed().withError(RpcError.ErrorType.APPLICATION,
-                        String.format("Unexpected exception occurred while translating response: %s. %s", result.getClass(), ex)).build());
+                        String.format("Unexpected exception occurred while translating response: %s. %s",
+                                      result.getClass(),
+                                      ex)).build());
                 endCollecting(false);
                 return;
             }
@@ -112,7 +116,7 @@ public abstract class AbstractMultipartRequestOnTheFlyCallback<T extends OfHeade
     }
 
     /**
-     * Get tx facade
+     * Get tx facade.
      * @return tx facade
      */
     protected TxFacade getTxFacade() {
@@ -120,7 +124,7 @@ public abstract class AbstractMultipartRequestOnTheFlyCallback<T extends OfHeade
     }
 
     /**
-     * Starts collecting of multipart data
+     * Starts collecting of multipart data.
      */
     private synchronized void startCollecting() {
         EventsTimeCounter.markStart(doneEventIdentifier);
@@ -149,11 +153,13 @@ public abstract class AbstractMultipartRequestOnTheFlyCallback<T extends OfHeade
                         instanceIdentifier,
                         deviceRegistry.getDeviceGroupRegistry());
                 break;
+            default:
+                LOG.warn("Unsupported type {}", getMultipartType());
         }
     }
 
     /**
-     * Ends collecting of multipart data
+     * Ends collecting of multipart data.
      * @param setResult set empty success result
      */
     private void endCollecting(final boolean setResult) {
@@ -178,13 +184,14 @@ public abstract class AbstractMultipartRequestOnTheFlyCallback<T extends OfHeade
             case OFPMPGROUPDESC:
                 deviceRegistry.getDeviceGroupRegistry().processMarks();
                 break;
+            default:
+                LOG.warn("Unsupported type {}", getMultipartType());
         }
     }
 
     /**
-     * Get multipart type
+     * Get multipart type.
      * @return multipart type
      */
     protected abstract MultipartType getMultipartType();
-
 }
index d16f3b7ccf12434b897be81875586ac987db7c5f..187871ef8fa1222b343b701c110b77d58c5fca18 100644 (file)
@@ -26,7 +26,8 @@ public abstract class AbstractMultipartService<I, T extends OfHeader> extends Ab
     private static final Function<OfHeader, Boolean> ALTERNATE_IS_COMPLETE = message ->
         !(message instanceof MultipartReply) || !((MultipartReply) message).isRequestMore();
 
-    protected AbstractMultipartService(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
+    protected AbstractMultipartService(final RequestContextStack requestContextStack,
+                                       final DeviceContext deviceContext) {
         super(requestContextStack, deviceContext);
     }
 
index 4e442881780b253a7b2c12bb7eedc2831c48603b..45326a7bc89969c5891a2940377635be2b67250c 100644 (file)
@@ -54,19 +54,22 @@ public abstract class AbstractRequestCallback<T> implements FutureCallback<OfHea
     }
 
     @Override
-    public final void onFailure(@Nonnull final Throwable t) {
+    public final void onFailure(@Nonnull final Throwable throwable) {
         final RpcResultBuilder<T> builder;
         if (null != eventIdentifier) {
             EventsTimeCounter.markEnd(eventIdentifier);
         }
-        if (t instanceof DeviceRequestFailedException) {
-            final Error err = ((DeviceRequestFailedException) t).getError();
-            final String errorString = String.format("Device reported error type %s code %s", err.getTypeString(), err.getCodeString());
+        if (throwable instanceof DeviceRequestFailedException) {
+            final Error err = ((DeviceRequestFailedException) throwable).getError();
+            final String errorString = String.format("Device reported error type %s code %s",
+                                                     err.getTypeString(),
+                                                     err.getCodeString());
 
-            builder = RpcResultBuilder.<T>failed().withError(RpcError.ErrorType.APPLICATION, errorString, t);
+            builder = RpcResultBuilder.<T>failed().withError(RpcError.ErrorType.APPLICATION, errorString, throwable);
             spyMessage(StatisticsGroup.TO_SWITCH_SUBMIT_FAILURE);
         } else {
-            builder = RpcResultBuilder.<T>failed().withError(RpcError.ErrorType.APPLICATION, t.getMessage(), t);
+            builder = RpcResultBuilder.<T>failed()
+                    .withError(RpcError.ErrorType.APPLICATION, throwable.getMessage(), throwable);
             spyMessage(StatisticsGroup.TO_SWITCH_SUBMIT_ERROR);
         }
 
index 8a8486944c84eb202fe1e68e23e7ddefe9846f72..d7ee0510358b8690e6718ff6296083021af190fc 100644 (file)
@@ -133,8 +133,10 @@ public abstract class AbstractService<I, O> {
         }
 
         if (Objects.isNull(requestContext.getXid())) {
-            getMessageSpy().spyMessage(requestContext.getClass(), MessageSpy.StatisticsGroup.TO_SWITCH_RESERVATION_REJECTED);
-            return RequestContextUtil.closeRequestContextWithRpcError(requestContext, "Outbound queue wasn't able to reserve XID.");
+            getMessageSpy().spyMessage(requestContext.getClass(),
+                                       MessageSpy.StatisticsGroup.TO_SWITCH_RESERVATION_REJECTED);
+            return RequestContextUtil
+                    .closeRequestContextWithRpcError(requestContext, "Outbound queue wasn't able to reserve XID.");
         }
 
         getMessageSpy().spyMessage(requestContext.getClass(), MessageSpy.StatisticsGroup.TO_SWITCH_READY_FOR_SUBMIT);
@@ -143,15 +145,22 @@ public abstract class AbstractService<I, O> {
         OfHeader request = null;
         try {
             request = buildRequest(xid, input);
-            Verify.verify(xid.getValue().equals(request.getXid()), "Expected XID %s got %s", xid.getValue(), request.getXid());
-        } catch (Exception ex) {
+            Verify.verify(xid.getValue().equals(request.getXid()),
+                          "Expected XID %s got %s",
+                          xid.getValue(),
+                          request.getXid());
+        } catch (ServiceException ex) {
             LOG.error("Failed to build request for {}, forfeiting request {}", input, xid.getValue(), ex);
-            RequestContextUtil.closeRequestContextWithRpcError(requestContext, "failed to build request input: " + ex.getMessage());
+            RequestContextUtil.closeRequestContextWithRpcError(requestContext,
+                                                               "failed to build request input: " + ex.getMessage());
         } finally {
-            final OutboundQueue outboundQueue = getDeviceContext().getPrimaryConnectionContext().getOutboundQueueProvider();
+            final OutboundQueue outboundQueue =
+                    getDeviceContext().getPrimaryConnectionContext().getOutboundQueueProvider();
 
             if (Objects.nonNull(isComplete)) {
-                outboundQueue.commitEntry(xid.getValue(), request, createCallback(requestContext, requestType), isComplete);
+                outboundQueue.commitEntry(xid.getValue(),
+                                          request,
+                                          createCallback(requestContext, requestType), isComplete);
             } else {
                 outboundQueue.commitEntry(xid.getValue(), request, createCallback(requestContext, requestType));
             }
index aa3039978f804df726ed60156f8e89e0bcfa929e..727ccff8bb95e47682e7c4c8f4a7754c7d869cb4 100644 (file)
@@ -23,7 +23,9 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 public abstract class AbstractSilentErrorService<I, O extends DataObject>
         extends AbstractSimpleService<I, O> {
 
-    protected AbstractSilentErrorService(RequestContextStack requestContextStack, DeviceContext deviceContext, Class<O> clazz) {
+    protected AbstractSilentErrorService(RequestContextStack requestContextStack,
+                                         DeviceContext deviceContext,
+                                         Class<O> clazz) {
         super(requestContextStack, deviceContext, clazz);
     }
 
@@ -31,9 +33,8 @@ public abstract class AbstractSilentErrorService<I, O extends DataObject>
     public ListenableFuture<RpcResult<O>> handleServiceCall(@Nonnull I input,
                                                             @Nullable final Function<OfHeader, Boolean> isComplete) {
         return Futures.catching(
-                super.handleServiceCall(input, isComplete),
-                Throwable.class,
-                t -> RpcResultBuilder.<O>failed().build());
+            super.handleServiceCall(input, isComplete),
+            Throwable.class,
+            t -> RpcResultBuilder.<O>failed().build());
     }
-
 }
index 38de909c2db39e7603d6ca3bee0ec071a0964b37..a2dcada96aa22eea17485ddb61103512a7c20496 100644 (file)
@@ -18,13 +18,16 @@ import org.opendaylight.yangtools.yang.binding.DataObject;
 public abstract class AbstractSimpleService<I, O extends DataObject> extends AbstractService<I, O> {
     private final Class<O> clazz;
 
-    protected AbstractSimpleService(final RequestContextStack requestContextStack, final DeviceContext deviceContext, final Class<O> clazz) {
+    protected AbstractSimpleService(final RequestContextStack requestContextStack,
+                                    final DeviceContext deviceContext,
+                                    final Class<O> clazz) {
         super(requestContextStack, deviceContext);
         this.clazz = Preconditions.checkNotNull(clazz);
     }
 
     @Override
-    protected final FutureCallback<OfHeader> createCallback(final RequestContext<O> context, final Class<?> requestType) {
+    protected final FutureCallback<OfHeader> createCallback(final RequestContext<O> context,
+                                                            final Class<?> requestType) {
         return SimpleRequestCallback.create(context, requestType, getMessageSpy(), clazz);
     }
 }
index af03b42997503f56c3eb74bfcc4371979af4cff1..e45c095fce47bd06c2b3bddd934883b4f7df128e 100644 (file)
@@ -20,7 +20,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.Upd
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutput;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
-public abstract class AbstractTableMultipartService<T extends OfHeader> extends AbstractMultipartService<UpdateTableInput, T> {
+public abstract class AbstractTableMultipartService<T extends OfHeader>
+        extends AbstractMultipartService<UpdateTableInput, T> {
 
     private final MultipartWriterProvider multipartWriterProvider;
 
@@ -32,9 +33,10 @@ public abstract class AbstractTableMultipartService<T extends OfHeader> extends
     }
 
     /**
-     * Stores table features to operational datastore
+     * Stores table features to operational datastore.
      */
-    protected void storeStatistics(List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures> result) {
+    protected void storeStatistics(List<org.opendaylight.yang.gen.v1.urn
+            .opendaylight.table.types.rev131026.table.features.TableFeatures> result) {
         multipartWriterProvider
             .lookup(MultipartType.OFPMPTABLEFEATURES)
             .ifPresent(writer -> {
@@ -49,7 +51,7 @@ public abstract class AbstractTableMultipartService<T extends OfHeader> extends
     }
 
     /**
-     * Process experimenter input and result experimenter output
+     * Process experimenter input and result experimenter output.
      * @param input experimenter input
      * @return experimenter output
      */
index a24fcda674f2f2d85fa05413e170ce9269b66542..05fd4d533b1e05b73ab83c9064ffa6905063eb28 100644 (file)
@@ -19,7 +19,8 @@ public abstract class AbstractVoidService<T> extends AbstractService<T, Void> {
     }
 
     @Override
-    protected final FutureCallback<OfHeader> createCallback(final RequestContext<Void> context, final Class<?> requestType) {
+    protected final FutureCallback<OfHeader> createCallback(final RequestContext<Void> context,
+                                                            final Class<?> requestType) {
         return new VoidRequestCallback(context, requestType, getMessageSpy());
     }
 }
index 8abfd8b954acdab2739ce5c5b56df81173a831ac..2f9510aaafa73819767906db8f7dfb271afe2361 100644 (file)
@@ -35,15 +35,14 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-/**
- * Created by kramesha on 8/24/15.
- */
 public class RoleService extends AbstractSimpleService<RoleRequestInputBuilder, RoleRequestOutput> {
     private static final Logger LOG = LoggerFactory.getLogger(RoleService.class);
 
     private final DeviceContext deviceContext;
 
-    public RoleService(final RequestContextStack requestContextStack, final DeviceContext deviceContext, final Class<RoleRequestOutput> clazz) {
+    public RoleService(final RequestContextStack requestContextStack,
+                       final DeviceContext deviceContext,
+                       final Class<RoleRequestOutput> clazz) {
         super(requestContextStack, deviceContext, clazz);
         this.deviceContext = deviceContext;
     }
@@ -64,7 +63,8 @@ public class RoleService extends AbstractSimpleService<RoleRequestInputBuilder,
         roleRequestInputBuilder.setGenerationId(BigInteger.ZERO);
 
         final SettableFuture<BigInteger> finalFuture = SettableFuture.create();
-        final ListenableFuture<RpcResult<RoleRequestOutput>> genIdListenableFuture = handleServiceCall(roleRequestInputBuilder);
+        final ListenableFuture<RpcResult<RoleRequestOutput>> genIdListenableFuture =
+                handleServiceCall(roleRequestInputBuilder);
         Futures.addCallback(genIdListenableFuture, new FutureCallback<RpcResult<RoleRequestOutput>>() {
             @Override
             public void onSuccess(final RpcResult<RoleRequestOutput> roleRequestOutputRpcResult) {
@@ -75,13 +75,15 @@ public class RoleService extends AbstractSimpleService<RoleRequestInputBuilder,
                         finalFuture.set(roleRequestOutput.getGenerationId());
                     } else {
                         LOG.info("roleRequestOutput is null in getGenerationIdFromDevice");
-                        finalFuture.setException(new RoleChangeException("Exception in getting generationId for device:" + getDeviceInfo().getNodeId().getValue()));
+                        finalFuture.setException(new RoleChangeException("Exception in getting generationId for device:"
+                                + getDeviceInfo().getNodeId().getValue()));
                     }
 
                 } else {
-                    LOG.error("getGenerationIdFromDevice RPC error " +
-                            roleRequestOutputRpcResult.getErrors().iterator().next().getInfo());
-                    finalFuture.setException(new RoleChangeException(ErrorUtil.errorsToString(roleRequestOutputRpcResult.getErrors())));
+                    LOG.error("getGenerationIdFromDevice RPC error "
+                            + roleRequestOutputRpcResult.getErrors().iterator().next().getInfo());
+                    finalFuture.setException(new RoleChangeException(ErrorUtil
+                            .errorsToString(roleRequestOutputRpcResult.getErrors())));
                 }
             }
 
@@ -95,7 +97,9 @@ public class RoleService extends AbstractSimpleService<RoleRequestInputBuilder,
     }
 
 
-    public Future<RpcResult<SetRoleOutput>> submitRoleChange(final OfpRole ofpRole, final Short version, final BigInteger generationId) {
+    public Future<RpcResult<SetRoleOutput>> submitRoleChange(final OfpRole ofpRole,
+                                                             final Short version,
+                                                             final BigInteger generationId) {
         LOG.info("submitRoleChange called for device:{}, role:{}",
                 getDeviceInfo().getNodeId(), ofpRole);
         final RoleRequestInputBuilder roleRequestInputBuilder = new RoleRequestInputBuilder();
@@ -103,7 +107,8 @@ public class RoleService extends AbstractSimpleService<RoleRequestInputBuilder,
         roleRequestInputBuilder.setVersion(version);
         roleRequestInputBuilder.setGenerationId(generationId);
 
-        final ListenableFuture<RpcResult<RoleRequestOutput>> roleListenableFuture = handleServiceCall(roleRequestInputBuilder);
+        final ListenableFuture<RpcResult<RoleRequestOutput>> roleListenableFuture =
+                handleServiceCall(roleRequestInputBuilder);
 
         final SettableFuture<RpcResult<SetRoleOutput>> finalFuture = SettableFuture.create();
         Futures.addCallback(roleListenableFuture, new FutureCallback<RpcResult<RoleRequestOutput>>() {
@@ -115,8 +120,10 @@ public class RoleService extends AbstractSimpleService<RoleRequestInputBuilder,
                 final Collection<RpcError> rpcErrors = roleRequestOutputRpcResult.getErrors();
                 if (roleRequestOutput != null) {
                     final SetRoleOutputBuilder setRoleOutputBuilder = new SetRoleOutputBuilder();
-                    setRoleOutputBuilder.setTransactionId(new TransactionId(BigInteger.valueOf(roleRequestOutput.getXid())));
-                    finalFuture.set(RpcResultBuilder.<SetRoleOutput>success().withResult(setRoleOutputBuilder.build()).build());
+                    setRoleOutputBuilder
+                            .setTransactionId(new TransactionId(BigInteger.valueOf(roleRequestOutput.getXid())));
+                    finalFuture.set(RpcResultBuilder.<SetRoleOutput>success()
+                            .withResult(setRoleOutputBuilder.build()).build());
 
                 } else if (rpcErrors != null) {
                     LOG.trace("roleRequestOutput is null , rpcErrors={}", rpcErrors);
@@ -158,6 +165,4 @@ public class RoleService extends AbstractSimpleService<RoleRequestInputBuilder,
         }
         return ofJavaRole;
     }
-
-
 }
index ad08aad92f3ad5ef06b90162eacbeeacb495b8d8..519b1b71217872dd9f861bbb142145d5475417d6 100644 (file)
@@ -21,17 +21,23 @@ public final class SimpleRequestCallback<T extends DataObject> extends AbstractR
     private static final Logger LOG = LoggerFactory.getLogger(SimpleRequestCallback.class);
     private final Class<T> clazz;
 
-    private SimpleRequestCallback(final RequestContext<T> context, final Class<?> requestType, final MessageSpy spy, final Class<T> clazz) {
+    private SimpleRequestCallback(final RequestContext<T> context,
+                                  final Class<?> requestType,
+                                  final MessageSpy spy,
+                                  final Class<T> clazz) {
         super(context, requestType, spy, null);
         this.clazz = Preconditions.checkNotNull(clazz);
     }
 
-    public static <T extends DataObject> FutureCallback<OfHeader> create(final RequestContext<T> context, final Class<?> requestType, final MessageSpy spy, final Class<T> clazz) {
+    public static <T extends DataObject> FutureCallback<OfHeader> create(final RequestContext<T> context,
+                                                                         final Class<?> requestType,
+                                                                         final MessageSpy spy,
+                                                                         final Class<T> clazz) {
         return new SimpleRequestCallback<>(context, requestType, spy, clazz);
     }
 
     @Override
-    public final void onSuccess(final OfHeader result) {
+    public void onSuccess(OfHeader result) {
         spyMessage(MessageSpy.StatisticsGroup.TO_SWITCH_SUBMIT_SUCCESS);
 
         if (result == null) {
index 7a629eb75408e1f2dc553e59c7fcc45500725f03..24f314e0c867287548510b8ed70c67556209339e 100644 (file)
@@ -21,7 +21,8 @@ public class BatchStepJob {
     private final AsyncFunction<RpcResult<ProcessFlatBatchOutput>, RpcResult<ProcessFlatBatchOutput>> stepFunction;
 
     public BatchStepJob(final BatchPlanStep planStep,
-                        final AsyncFunction<RpcResult<ProcessFlatBatchOutput>, RpcResult<ProcessFlatBatchOutput>> stepFunction) {
+                        final AsyncFunction<RpcResult<ProcessFlatBatchOutput>,
+                        RpcResult<ProcessFlatBatchOutput>> stepFunction) {
         this.planStep = planStep;
         this.stepFunction = stepFunction;
     }
@@ -33,5 +34,4 @@ public class BatchStepJob {
     public AsyncFunction<RpcResult<ProcessFlatBatchOutput>, RpcResult<ProcessFlatBatchOutput>> getStepFunction() {
         return stepFunction;
     }
-
 }
index 4028d432a3e3a896f77bfed9ae51aea93bd56be3..1bc2e2406f5e84bb4477830d7d4d9ffc585c5eab 100644 (file)
@@ -13,15 +13,15 @@ package org.opendaylight.openflowplugin.impl.services.batch;
  */
 public enum BatchStepType {
 
-    /** flow add operation */FLOW_ADD,
-    /** flow remove operation */FLOW_REMOVE,
-    /** flow update operation */FLOW_UPDATE,
+    /** Flow add operation. */FLOW_ADD,
+    /** Flow remove operation. */FLOW_REMOVE,
+    /** Flow update operation. */FLOW_UPDATE,
 
-    /** group add operation */GROUP_ADD,
-    /** group remove operation */GROUP_REMOVE,
-    /** group update operation */GROUP_UPDATE,
+    /** Group add operation. */GROUP_ADD,
+    /** Group remove operation. */GROUP_REMOVE,
+    /** Group update operation. */GROUP_UPDATE,
 
-    /** meter add operation */METER_ADD,
-    /** meter remove operation */METER_REMOVE,
-    /** meter update operation */METER_UPDATE
+    /** Meter add operation. */METER_ADD,
+    /** Meter remove operation. */METER_REMOVE,
+    /** Meter update operation. */METER_UPDATE
 }
index 48309a2f9f9d995725fcbbeb32c25a8682aa4616..fda05b75394a98ca2cda8d8f025eb78182286cbb 100644 (file)
@@ -54,9 +54,11 @@ public class FlatBatchFlowAdapters {
     }
 
     /**
+     * Adapt flat batch add flow.
      * @param planStep batch step containing changes of the same type
      * @param node     pointer for RPC routing
-     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.SalFlowsBatchService#addFlowsBatch(AddFlowsBatchInput)}
+     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn
+     * .opendaylight.flows.service.rev160314.SalFlowsBatchService#addFlowsBatch(AddFlowsBatchInput)}
      */
     public static AddFlowsBatchInput adaptFlatBatchAddFlow(final BatchPlanStep planStep, final NodeRef node) {
         final List<BatchAddFlows> batchFlows = new ArrayList<>();
@@ -75,9 +77,11 @@ public class FlatBatchFlowAdapters {
     }
 
     /**
+     * Adapt flat batch remove flow.
      * @param planStep batch step containing changes of the same type
      * @param node     pointer for RPC routing
-     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.SalFlowsBatchService#removeFlowsBatch(RemoveFlowsBatchInput)}
+     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn
+     * .opendaylight.flows.service.rev160314.SalFlowsBatchService#removeFlowsBatch(RemoveFlowsBatchInput)}
      */
     public static RemoveFlowsBatchInput adaptFlatBatchRemoveFlow(final BatchPlanStep planStep, final NodeRef node) {
         final List<BatchRemoveFlows> batchFlows = new ArrayList<>();
@@ -96,9 +100,11 @@ public class FlatBatchFlowAdapters {
     }
 
     /**
+     * Adapt flat batch update flow.
      * @param planStep batch step containing changes of the same type
      * @param node     pointer for RPC routing
-     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.SalFlowsBatchService#updateFlowsBatch(UpdateFlowsBatchInput)}
+     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn
+     * .opendaylight.flows.service.rev160314.SalFlowsBatchService#updateFlowsBatch(UpdateFlowsBatchInput)}
      */
     public static UpdateFlowsBatchInput adaptFlatBatchUpdateFlow(final BatchPlanStep planStep, final NodeRef node) {
         final List<BatchUpdateFlows> batchFlows = new ArrayList<>();
@@ -116,18 +122,20 @@ public class FlatBatchFlowAdapters {
     }
 
     /**
+     * Convert batch result.
      * @param stepOffset offset of current batch plan step
      * @return converted {@link ProcessFlatBatchOutput} RPC result
      */
     @VisibleForTesting
     static <T extends BatchFlowOutputListGrouping> Function<RpcResult<T>, RpcResult<ProcessFlatBatchOutput>>
-    convertBatchFlowResult(final int stepOffset) {
+        convertBatchFlowResult(final int stepOffset) {
         return new Function<RpcResult<T>, RpcResult<ProcessFlatBatchOutput>>() {
             @Nullable
             @Override
             public RpcResult<ProcessFlatBatchOutput> apply(@Nullable final RpcResult<T> input) {
                 List<BatchFailure> batchFailures = wrapBatchFlowFailuresForFlat(input, stepOffset);
-                ProcessFlatBatchOutputBuilder outputBuilder = new ProcessFlatBatchOutputBuilder().setBatchFailure(batchFailures);
+                ProcessFlatBatchOutputBuilder outputBuilder =
+                        new ProcessFlatBatchOutputBuilder().setBatchFailure(batchFailures);
                 return RpcResultBuilder.<ProcessFlatBatchOutput>status(input.isSuccessful())
                                        .withRpcErrors(input.getErrors())
                                        .withResult(outputBuilder.build())
@@ -154,7 +162,7 @@ public class FlatBatchFlowAdapters {
     }
 
     /**
-     * shortcut for {@link #convertBatchFlowResult(int)} with conversion {@link ListenableFuture}
+     * Shortcut for {@link #convertBatchFlowResult(int)} with conversion {@link ListenableFuture}.
      *
      * @param <T>                    exact type of batch flow output
      * @param resultUpdateFlowFuture batch flow rpc-result (add/remove/update)
@@ -162,7 +170,7 @@ public class FlatBatchFlowAdapters {
      * @return ListenableFuture with converted result {@link ProcessFlatBatchOutput}
      */
     public static <T extends BatchFlowOutputListGrouping> ListenableFuture<RpcResult<ProcessFlatBatchOutput>>
-    convertFlowBatchFutureForChain(final Future<RpcResult<T>> resultUpdateFlowFuture,
+        convertFlowBatchFutureForChain(final Future<RpcResult<T>> resultUpdateFlowFuture,
                                    final int currentOffset) {
         return Futures.transform(JdkFutureAdapters.listenInPoolThread(resultUpdateFlowFuture),
                 FlatBatchFlowAdapters.<T>convertBatchFlowResult(currentOffset));
index 3ba5d322f36000e59a61e1f26a399bbcbb0ee057..2bb12186f3541d6000ee1208f346b20815f2b074 100644 (file)
@@ -53,9 +53,11 @@ public class FlatBatchGroupAdapters {
     }
 
     /**
+     * Adapt flat batch add group.
      * @param planStep batch step containing changes of the same type
      * @param node     pointer for RPC routing
-     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.SalGroupsBatchService#addGroupsBatch(AddGroupsBatchInput)}
+     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn
+     * .opendaylight.groups.service.rev160315.SalGroupsBatchService#addGroupsBatch(AddGroupsBatchInput)}
      */
     public static AddGroupsBatchInput adaptFlatBatchAddGroup(final BatchPlanStep planStep, final NodeRef node) {
         final List<BatchAddGroups> batchGroups = new ArrayList<>();
@@ -74,9 +76,11 @@ public class FlatBatchGroupAdapters {
     }
 
     /**
+     * Adapt flat batch remove group.
      * @param planStep batch step containing changes of the same type
      * @param node     pointer for RPC routing
-     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.SalGroupsBatchService#removeGroupsBatch(RemoveGroupsBatchInput)}
+     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn
+     * .opendaylight.groups.service.rev160315.SalGroupsBatchService#removeGroupsBatch(RemoveGroupsBatchInput)}
      */
     public static RemoveGroupsBatchInput adaptFlatBatchRemoveGroup(final BatchPlanStep planStep, final NodeRef node) {
         final List<BatchRemoveGroups> batchGroups = new ArrayList<>();
@@ -95,9 +99,11 @@ public class FlatBatchGroupAdapters {
     }
 
     /**
+     * Adapt flat batch update group.
      * @param planStep batch step containing changes of the same type
      * @param node     pointer for RPC routing
-     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.SalGroupsBatchService#updateGroupsBatch(UpdateGroupsBatchInput)}
+     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn
+     * .opendaylight.groups.service.rev160315.SalGroupsBatchService#updateGroupsBatch(UpdateGroupsBatchInput)}
      */
     public static UpdateGroupsBatchInput adaptFlatBatchUpdateGroup(final BatchPlanStep planStep, final NodeRef node) {
         final List<BatchUpdateGroups> batchGroups = new ArrayList<>();
@@ -115,18 +121,20 @@ public class FlatBatchGroupAdapters {
     }
 
     /**
+     * Convert batch group result.
      * @param stepOffset offset of current batch plan step
      * @return converted {@link ProcessFlatBatchOutput} RPC result
      */
     @VisibleForTesting
     static <T extends BatchGroupOutputListGrouping> Function<RpcResult<T>, RpcResult<ProcessFlatBatchOutput>>
-    convertBatchGroupResult(final int stepOffset) {
+        convertBatchGroupResult(final int stepOffset) {
         return new Function<RpcResult<T>, RpcResult<ProcessFlatBatchOutput>>() {
             @Nullable
             @Override
             public RpcResult<ProcessFlatBatchOutput> apply(@Nullable final RpcResult<T> input) {
                 List<BatchFailure> batchFailures = wrapBatchGroupFailuresForFlat(input, stepOffset);
-                ProcessFlatBatchOutputBuilder outputBuilder = new ProcessFlatBatchOutputBuilder().setBatchFailure(batchFailures);
+                ProcessFlatBatchOutputBuilder outputBuilder =
+                        new ProcessFlatBatchOutputBuilder().setBatchFailure(batchFailures);
                 return RpcResultBuilder.<ProcessFlatBatchOutput>status(input.isSuccessful())
                                        .withRpcErrors(input.getErrors())
                                        .withResult(outputBuilder.build())
@@ -153,7 +161,7 @@ public class FlatBatchGroupAdapters {
     }
 
     /**
-     * shortcut for {@link #convertBatchGroupResult(int)} with conversion {@link ListenableFuture}
+     * Shortcut for {@link #convertBatchGroupResult(int)} with conversion {@link ListenableFuture}.
      *
      * @param <T>                     exact type of batch flow output
      * @param resultUpdateGroupFuture batch group rpc-result (add/remove/update)
@@ -161,7 +169,7 @@ public class FlatBatchGroupAdapters {
      * @return ListenableFuture with converted result {@link ProcessFlatBatchOutput}
      */
     public static <T extends BatchGroupOutputListGrouping> ListenableFuture<RpcResult<ProcessFlatBatchOutput>>
-    convertGroupBatchFutureForChain(final Future<RpcResult<T>> resultUpdateGroupFuture,
+        convertGroupBatchFutureForChain(final Future<RpcResult<T>> resultUpdateGroupFuture,
                                     final int currentOffset) {
         return Futures.transform(JdkFutureAdapters.listenInPoolThread(resultUpdateGroupFuture),
                 FlatBatchGroupAdapters.<T>convertBatchGroupResult(currentOffset));
index 48ee4fbd6fe8a9387ad6230f2122ba54c2056e32..c1140f727fa77cef8834097b9c7e7d8368faa2a1 100644 (file)
@@ -53,9 +53,11 @@ public class FlatBatchMeterAdapters {
     }
 
     /**
+     * Adapt flat batch add meter.
      * @param planStep batch step containing changes of the same type
      * @param node     pointer for RPC routing
-     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.SalMetersBatchService#addMetersBatch(AddMetersBatchInput)}
+     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn
+     * .opendaylight.meters.service.rev160316.SalMetersBatchService#addMetersBatch(AddMetersBatchInput)}
      */
     public static AddMetersBatchInput adaptFlatBatchAddMeter(final BatchPlanStep planStep, final NodeRef node) {
         final List<BatchAddMeters> batchMeters = new ArrayList<>();
@@ -74,9 +76,11 @@ public class FlatBatchMeterAdapters {
     }
 
     /**
+     * Adapt flat batch remove meter.
      * @param planStep batch step containing changes of the same type
      * @param node     pointer for RPC routing
-     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.SalMetersBatchService#removeMetersBatch(RemoveMetersBatchInput)}
+     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn
+     * .opendaylight.meters.service.rev160316.SalMetersBatchService#removeMetersBatch(RemoveMetersBatchInput)}
      */
     public static RemoveMetersBatchInput adaptFlatBatchRemoveMeter(final BatchPlanStep planStep, final NodeRef node) {
         final List<BatchRemoveMeters> batchMeters = new ArrayList<>();
@@ -95,9 +99,11 @@ public class FlatBatchMeterAdapters {
     }
 
     /**
+     * Adapt flat batch update meter.
      * @param planStep batch step containing changes of the same type
      * @param node     pointer for RPC routing
-     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.SalMetersBatchService#updateMetersBatch(UpdateMetersBatchInput)}
+     * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn
+     * .opendaylight.meters.service.rev160316.SalMetersBatchService#updateMetersBatch(UpdateMetersBatchInput)}
      */
     public static UpdateMetersBatchInput adaptFlatBatchUpdateMeter(final BatchPlanStep planStep, final NodeRef node) {
         final List<BatchUpdateMeters> batchMeters = new ArrayList<>();
@@ -115,18 +121,20 @@ public class FlatBatchMeterAdapters {
     }
 
     /**
+     * Convert meter batch result.
      * @param stepOffset offset of current batch plan step
      * @return converted {@link ProcessFlatBatchOutput} RPC result
      */
     @VisibleForTesting
     static <T extends BatchMeterOutputListGrouping> Function<RpcResult<T>, RpcResult<ProcessFlatBatchOutput>>
-    convertBatchMeterResult(final int stepOffset) {
+        convertBatchMeterResult(final int stepOffset) {
         return new Function<RpcResult<T>, RpcResult<ProcessFlatBatchOutput>>() {
             @Nullable
             @Override
             public RpcResult<ProcessFlatBatchOutput> apply(@Nullable final RpcResult<T> input) {
                 List<BatchFailure> batchFailures = wrapBatchMeterFailuresForFlat(input, stepOffset);
-                ProcessFlatBatchOutputBuilder outputBuilder = new ProcessFlatBatchOutputBuilder().setBatchFailure(batchFailures);
+                ProcessFlatBatchOutputBuilder outputBuilder =
+                        new ProcessFlatBatchOutputBuilder().setBatchFailure(batchFailures);
                 return RpcResultBuilder.<ProcessFlatBatchOutput>status(input.isSuccessful())
                         .withRpcErrors(input.getErrors())
                         .withResult(outputBuilder.build())
@@ -153,7 +161,7 @@ public class FlatBatchMeterAdapters {
     }
 
     /**
-     * shortcut for {@link #convertBatchMeterResult(int)} with conversion {@link ListenableFuture}
+     * Shortcut for {@link #convertBatchMeterResult(int)} with conversion {@link ListenableFuture}.
      *
      * @param <T>                     exact type of batch flow output
      * @param resultUpdateMeterFuture batch group rpc-result (add/remove/update)
@@ -161,7 +169,7 @@ public class FlatBatchMeterAdapters {
      * @return ListenableFuture with converted result {@link ProcessFlatBatchOutput}
      */
     public static <T extends BatchMeterOutputListGrouping> ListenableFuture<RpcResult<ProcessFlatBatchOutput>>
-    convertMeterBatchFutureForChain(final Future<RpcResult<T>> resultUpdateMeterFuture,
+        convertMeterBatchFutureForChain(final Future<RpcResult<T>> resultUpdateMeterFuture,
                                     final int currentOffset) {
         return Futures.transform(JdkFutureAdapters.listenInPoolThread(resultUpdateMeterFuture),
                 FlatBatchMeterAdapters.<T>convertBatchMeterResult(currentOffset));
index 15b1bc14df7edc2dcc2582e32a12133a4cded528..0e1043c9011ede0d10e118ad54f33d6acfb3913c 100644 (file)
@@ -58,8 +58,11 @@ public class MultiLayerAggregateFlowMultipartService extends AbstractAggregateFl
 
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) throws ServiceException {
-        final MultipartRequestAggregateCaseBuilder multipartRequestAggregateCaseBuilder = new MultipartRequestAggregateCaseBuilder();
+    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);
         mprAggregateRequestBuilder.setTableId(tableId);
@@ -72,13 +75,15 @@ public class MultiLayerAggregateFlowMultipartService extends AbstractAggregateFl
             if (input.getCookie() == null) {
                 mprAggregateRequestBuilder.setCookie(OFConstants.DEFAULT_COOKIE);
             } else {
-                mprAggregateRequestBuilder.setCookie(MoreObjects.firstNonNull(input.getCookie().getValue(), OFConstants.DEFAULT_COOKIE));
+                mprAggregateRequestBuilder
+                        .setCookie(MoreObjects.firstNonNull(input.getCookie().getValue(), OFConstants.DEFAULT_COOKIE));
             }
 
             if (input.getCookieMask() == null) {
                 mprAggregateRequestBuilder.setCookieMask(OFConstants.DEFAULT_COOKIE_MASK);
             } else {
-                mprAggregateRequestBuilder.setCookieMask(MoreObjects.firstNonNull(input.getCookieMask().getValue(), OFConstants.DEFAULT_COOKIE_MASK));
+                mprAggregateRequestBuilder.setCookieMask(MoreObjects.firstNonNull(input.getCookieMask().getValue(),
+                                                                                  OFConstants.DEFAULT_COOKIE_MASK));
             }
             long outGroup = MoreObjects.firstNonNull(input.getOutGroup(), OFConstants.OFPG_ANY);
             mprAggregateRequestBuilder.setOutGroup(outGroup);
@@ -105,11 +110,14 @@ public class MultiLayerAggregateFlowMultipartService extends AbstractAggregateFl
     }
 
     @Override
-    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>> handleAndReply(final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) {
+    public Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>>
+        handleAndReply(final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) {
         return Futures.transform(handleServiceCall(input),
-            (Function<RpcResult<List<MultipartReply>>, RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>>) result -> {
+            (Function<RpcResult<List<MultipartReply>>,
+             RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>>) result -> {
                 if (Preconditions.checkNotNull(result).isSuccessful()) {
-                    final MessageTranslator<MultipartReply, AggregatedFlowStatistics> messageTranslator = translatorLibrary
+                    final MessageTranslator<MultipartReply, AggregatedFlowStatistics> messageTranslator =
+                        translatorLibrary
                         .lookupTranslator(new TranslatorKey(getVersion(), MultipartReplyAggregateCase.class.getName()));
 
                     return RpcResultBuilder
@@ -129,5 +137,4 @@ public class MultiLayerAggregateFlowMultipartService extends AbstractAggregateFl
                     .build();
             });
     }
-
 }
index befaf4ac2689f877433f9b454d5433cc9d1adf3a..233bc00e2cc303aae6ecd081b2fbcd2340a7d2b7 100644 (file)
@@ -21,8 +21,8 @@ import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
 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.extension.api.ConvertorMessageFromOFJava;
 import org.opendaylight.openflowplugin.extension.api.ConverterMessageToOFJava;
+import org.opendaylight.openflowplugin.extension.api.ConvertorMessageFromOFJava;
 import org.opendaylight.openflowplugin.extension.api.TypeVersionKey;
 import org.opendaylight.openflowplugin.extension.api.core.extension.ExtensionConverterProvider;
 import org.opendaylight.openflowplugin.extension.api.exception.ConversionException;
@@ -103,15 +103,19 @@ public class MultiLayerExperimenterMultipartService extends AbstractExperimenter
                     final List<MultipartReply> multipartReplies = result.getResult();
                     if (multipartReplies.isEmpty()) {
                         LOG.warn("Multipart reply to Experimenter-Mp request shouldn't be empty list.");
-                        finalFuture.set(RpcResultBuilder.<SendExperimenterMpRequestOutput>failed().withError(ErrorType.RPC, "Multipart reply list is empty.").build());
+                        finalFuture.set(RpcResultBuilder.<SendExperimenterMpRequestOutput>failed()
+                                .withError(ErrorType.RPC, "Multipart reply list is empty.").build());
                     } else {
                         LOG.debug(
-                                "OnSuccess, rpc result successful, multipart response for rpc sendExperimenterMpRequest with xid {} obtained.",
+                                "OnSuccess, rpc result successful,"
+                                        + " multipart response for rpc sendExperimenterMpRequest with xid {} obtained.",
                                 multipartReplies.get(0).getXid());
-                        final SendExperimenterMpRequestOutputBuilder sendExpMpReqOutputBuilder = new SendExperimenterMpRequestOutputBuilder();
+                        final SendExperimenterMpRequestOutputBuilder sendExpMpReqOutputBuilder =
+                                new SendExperimenterMpRequestOutputBuilder();
                         final List<ExperimenterCoreMessageItem> expCoreMessageItem = new ArrayList<>();
-                        for(MultipartReply multipartReply : multipartReplies){
-                            final MultipartReplyExperimenterCase caseBody = (MultipartReplyExperimenterCase)multipartReply.getMultipartReplyBody();
+                        for (MultipartReply multipartReply : multipartReplies) {
+                            final MultipartReplyExperimenterCase caseBody =
+                                    (MultipartReplyExperimenterCase)multipartReply.getMultipartReplyBody();
                             final MultipartReplyExperimenter replyBody = caseBody.getMultipartReplyExperimenter();
                             final ExperimenterDataOfChoice vendorData = replyBody.getExperimenterDataOfChoice();
                             final MessageTypeKey<? extends ExperimenterDataOfChoice> key = new MessageTypeKey<>(
@@ -123,17 +127,22 @@ public class MultiLayerExperimenterMultipartService extends AbstractExperimenter
                                 LOG.warn("Custom converter for {}[OF:{}] not found",
                                         vendorData.getImplementedInterface(),
                                         getVersion());
-                                finalFuture.set(RpcResultBuilder.<SendExperimenterMpRequestOutput>failed().withError(ErrorType.RPC, "Custom converter not found.").build());
+                                finalFuture.set(RpcResultBuilder.<SendExperimenterMpRequestOutput>failed()
+                                        .withError(ErrorType.RPC, "Custom converter not found.").build());
                                 return;
                             }
                             try {
-                                final ExperimenterMessageOfChoice messageOfChoice = messageConverter.convert(vendorData, MessagePath.MPMESSAGE_RPC_OUTPUT);
-                                final ExperimenterCoreMessageItemBuilder expCoreMessageItemBuilder = new ExperimenterCoreMessageItemBuilder();
+                                final ExperimenterMessageOfChoice messageOfChoice =
+                                        messageConverter.convert(vendorData, MessagePath.MPMESSAGE_RPC_OUTPUT);
+                                final ExperimenterCoreMessageItemBuilder expCoreMessageItemBuilder =
+                                        new ExperimenterCoreMessageItemBuilder();
                                 expCoreMessageItemBuilder.setExperimenterMessageOfChoice(messageOfChoice);
                                 expCoreMessageItem.add(expCoreMessageItemBuilder.build());
                             } catch (final ConversionException e) {
                                 LOG.error("Conversion of experimenter message reply failed. Exception: {}", e);
-                                finalFuture.set(RpcResultBuilder.<SendExperimenterMpRequestOutput>failed().withError(ErrorType.RPC, "Conversion of experimenter rpc output failed.").build());
+                                finalFuture.set(RpcResultBuilder.<SendExperimenterMpRequestOutput>failed()
+                                        .withError(ErrorType.RPC,
+                                                   "Conversion of experimenter rpc output failed.").build());
                                 return;
                             }
                         }
@@ -141,15 +150,18 @@ public class MultiLayerExperimenterMultipartService extends AbstractExperimenter
                         finalFuture.set(RpcResultBuilder.success(sendExpMpReqOutputBuilder.build()).build());
                     }
                 } else {
-                    LOG.warn("OnSuccess, rpc result unsuccessful, multipart response for rpc sendExperimenterMpRequest was unsuccessful.");
-                    finalFuture.set(RpcResultBuilder.<SendExperimenterMpRequestOutput>failed().withRpcErrors(result.getErrors()).build());
+                    LOG.warn("OnSuccess, rpc result unsuccessful,"
+                            + " multipart response for rpc sendExperimenterMpRequest was unsuccessful.");
+                    finalFuture.set(RpcResultBuilder.<SendExperimenterMpRequestOutput>failed()
+                            .withRpcErrors(result.getErrors()).build());
                 }
             }
 
             @Override
-            public void onFailure(final Throwable t) {
-                LOG.warn("Failure multipart response for Experimenter-Mp request. Exception: {}", t);
-                finalFuture.set(RpcResultBuilder.<SendExperimenterMpRequestOutput>failed().withError(ErrorType.RPC, "Future error", t).build());
+            public void onFailure(final Throwable throwable) {
+                LOG.warn("Failure multipart response for Experimenter-Mp request. Exception: {}", throwable);
+                finalFuture.set(RpcResultBuilder.<SendExperimenterMpRequestOutput>failed()
+                        .withError(ErrorType.RPC, "Future error", throwable).build());
             }
         }
 
index f084cf08f8d0ad2ca988aa130b008c9fca1f339e..276b33fbba88e48217e1506e81cfbfa7f306b7d3 100644 (file)
@@ -19,7 +19,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 
-public class MultiLayerFlowMultipartRequestOnTheFlyCallback<T extends OfHeader> extends AbstractMultipartRequestOnTheFlyCallback<T> {
+public class MultiLayerFlowMultipartRequestOnTheFlyCallback<T extends OfHeader>
+                                                        extends AbstractMultipartRequestOnTheFlyCallback<T> {
 
     public MultiLayerFlowMultipartRequestOnTheFlyCallback(final RequestContext<List<T>> context,
                                                           final Class<?> requestType,
@@ -45,5 +46,4 @@ public class MultiLayerFlowMultipartRequestOnTheFlyCallback<T extends OfHeader>
     protected MultipartType getMultipartType() {
         return MultipartType.OFPMPFLOW;
     }
-
 }
index c26638fae92fc88802ea5c6c99f704c9ca74c44f..cc2c1995000a78a61010b2787c16b9a1427b27ef 100644 (file)
@@ -36,7 +36,10 @@ public final class MultiLayerFlowService<O extends DataObject> extends AbstractS
     private final ConvertorExecutor convertorExecutor;
     private final VersionDatapathIdConvertorData data;
 
-    public MultiLayerFlowService(final RequestContextStack requestContextStack, final DeviceContext deviceContext, final Class<O> clazz, final ConvertorExecutor convertorExecutor) {
+    public MultiLayerFlowService(final RequestContextStack requestContextStack,
+                                 final DeviceContext deviceContext,
+                                 final Class<O> clazz,
+                                 final ConvertorExecutor convertorExecutor) {
         super(requestContextStack, deviceContext, clazz);
         this.convertorExecutor = convertorExecutor;
         data = new VersionDatapathIdConvertorData(getVersion());
@@ -88,7 +91,7 @@ public final class MultiLayerFlowService<O extends DataObject> extends AbstractS
             }
 
             @Override
-            public void onFailure(final Throwable t) {
+            public void onFailure(final Throwable throwable) {
                 RpcResultBuilder<O> rpcResultBuilder = RpcResultBuilder.failed();
                 finalFuture.set(rpcResultBuilder.build());
             }
@@ -96,5 +99,4 @@ public final class MultiLayerFlowService<O extends DataObject> extends AbstractS
 
         return finalFuture;
     }
-
 }
index c2a3355e8809908d3d2a43b28c0b617dfde4180b..c942676852bdbe2ed8957d7f756b4c4d72236146 100644 (file)
@@ -25,7 +25,10 @@ public final class MultiLayerGroupService<I extends Group, O extends DataObject>
     private final ConvertorExecutor convertorExecutor;
     private final VersionDatapathIdConvertorData data;
 
-    public MultiLayerGroupService(final RequestContextStack requestContextStack, final DeviceContext deviceContext, final Class<O> clazz, final ConvertorExecutor convertorExecutor) {
+    public MultiLayerGroupService(final RequestContextStack requestContextStack,
+                                  final DeviceContext deviceContext,
+                                  final Class<O> clazz,
+                                  final ConvertorExecutor convertorExecutor) {
         super(requestContextStack, deviceContext, clazz);
         this.convertorExecutor = convertorExecutor;
         data = new VersionDatapathIdConvertorData(getVersion());
index 9ef9d0b9b1393df71abd4e17e51d11145e933460..0a09f08cfeaa915a9f9dc6911d0fc56d4e812f37 100644 (file)
@@ -26,7 +26,10 @@ public final class MultiLayerMeterService<I extends Meter, O extends DataObject>
     private final ConvertorExecutor convertorExecutor;
     private final VersionConvertorData data;
 
-    public MultiLayerMeterService(final RequestContextStack requestContextStack, final DeviceContext deviceContext, final Class<O> clazz, final ConvertorExecutor convertorExecutor) {
+    public MultiLayerMeterService(final RequestContextStack requestContextStack,
+                                  final DeviceContext deviceContext,
+                                  final Class<O> clazz,
+                                  final ConvertorExecutor convertorExecutor) {
         super(requestContextStack, deviceContext, clazz);
         this.convertorExecutor = convertorExecutor;
         data = new VersionConvertorData(getVersion());
index f41e7f9fbffa35fcd4bd807fab9999eb55263118..d6253718b172ffa1e835e2b353a28d01beb6654e 100644 (file)
@@ -15,8 +15,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 
 public class MultiLayerMultipartCollectorService extends AbstractMultipartCollectorService<MultipartReply> {
 
-    public MultiLayerMultipartCollectorService(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
+    public MultiLayerMultipartCollectorService(final RequestContextStack requestContextStack,
+                                               final DeviceContext deviceContext) {
         super(requestContextStack, deviceContext);
     }
-
 }
index d8bf0b12d9883acdb40283362c2e6ad5d38ab341..2218580f4a5500bebe000441e2ea2fa7e3940d30 100644 (file)
@@ -20,7 +20,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 
 public class MultiLayerMultipartRequestCallback<T extends OfHeader> extends AbstractMultipartRequestCallback<T> {
 
-    public MultiLayerMultipartRequestCallback(RequestContext<List<T>> context, Class<?> requestType, DeviceContext deviceContext, EventIdentifier eventIdentifier) {
+    public MultiLayerMultipartRequestCallback(RequestContext<List<T>> context, Class<?> requestType,
+                                              DeviceContext deviceContext,
+                                              EventIdentifier eventIdentifier) {
         super(context, requestType, deviceContext, eventIdentifier);
     }
 
@@ -34,5 +36,4 @@ public class MultiLayerMultipartRequestCallback<T extends OfHeader> extends Abst
         final MultipartRequestFlags flags = MultipartReply.class.cast(result).getFlags();
         return Objects.nonNull(flags) && flags.isOFPMPFREQMORE();
     }
-
 }
index cfcfd88e739e825f5b1f7871aab3b7aa6e44789b..727c417f803f49b0055ddb70746c083ba3506a0d 100644 (file)
@@ -65,7 +65,8 @@ public class MultiLayerTableMultipartService extends AbstractTableMultipartServi
     protected OfHeader buildRequest(final Xid xid, final UpdateTableInput input) throws ServiceException {
         final Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart
                 .request.multipart.request.body.multipart.request.table.features._case.multipart.request
-                .table.features.TableFeatures>> tableFeatures = convertorExecutor.convert(input.getUpdatedTable(), data);
+                .table.features.TableFeatures>> tableFeatures =
+                convertorExecutor.convert(input.getUpdatedTable(), data);
 
         return RequestInputUtils.createMultipartHeader(MultipartType.OFPMPTABLEFEATURES, xid.getValue(), getVersion())
                 .setMultipartRequestBody(new MultipartRequestTableFeaturesCaseBuilder()
@@ -78,12 +79,14 @@ public class MultiLayerTableMultipartService extends AbstractTableMultipartServi
     }
 
     @Override
+
     public Future<RpcResult<UpdateTableOutput>> handleAndReply(UpdateTableInput input) {
         final ListenableFuture<RpcResult<List<MultipartReply>>> multipartFuture = handleServiceCall(input);
         final SettableFuture<RpcResult<UpdateTableOutput>> finalFuture = SettableFuture.create();
 
         class CallBackImpl implements FutureCallback<RpcResult<List<MultipartReply>>> {
             @Override
+            @SuppressWarnings("checkstyle:IllegalCatch")
             public void onSuccess(final RpcResult<List<MultipartReply>> result) {
 
                 if (result.isSuccessful()) {
@@ -95,7 +98,8 @@ public class MultiLayerTableMultipartService extends AbstractTableMultipartServi
                     } else {
                         final Long xid = multipartReplies.get(0).getXid();
                         LOG.debug(
-                            "OnSuccess, rpc result successful, multipart response for rpc update-table with xid {} obtained.",
+                            "OnSuccess, rpc result successful,"
+                                    + " multipart response for rpc update-table with xid {} obtained.",
                             xid);
                         final UpdateTableOutputBuilder updateTableOutputBuilder = new UpdateTableOutputBuilder();
                         updateTableOutputBuilder.setTransactionId(new TransactionId(BigInteger.valueOf(xid)));
@@ -107,17 +111,18 @@ public class MultiLayerTableMultipartService extends AbstractTableMultipartServi
                         }
                     }
                 } else {
-                    LOG.debug("OnSuccess, rpc result unsuccessful, multipart response for rpc update-table was unsuccessful.");
+                    LOG.debug("OnSuccess, rpc result unsuccessful,"
+                            + " multipart response for rpc update-table was unsuccessful.");
                     finalFuture.set(RpcResultBuilder.<UpdateTableOutput>failed().withRpcErrors(result.getErrors())
                         .build());
                 }
             }
 
             @Override
-            public void onFailure(final Throwable t) {
-                LOG.error("Failure multipart response for table features request. Exception: {}", t);
+            public void onFailure(final Throwable throwable) {
+                LOG.error("Failure multipart response for table features request. Exception: {}", throwable);
                 finalFuture.set(RpcResultBuilder.<UpdateTableOutput>failed()
-                    .withError(ErrorType.RPC, "Future error", t).build());
+                    .withError(ErrorType.RPC, "Future error", throwable).build());
             }
         }
 
@@ -126,14 +131,18 @@ public class MultiLayerTableMultipartService extends AbstractTableMultipartServi
         return finalFuture;
     }
 
-    protected List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures> convertToSalTableFeatures(
+    protected List<org.opendaylight.yang.gen.v1.urn
+            .opendaylight.table.types.rev131026.table.features.TableFeatures> convertToSalTableFeatures(
             final List<MultipartReply> multipartReplies) {
-        final List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures> salTableFeaturesAll = new ArrayList<>();
+        final List<org.opendaylight.yang.gen.v1.urn
+                .opendaylight.table.types.rev131026.table.features.TableFeatures> salTableFeaturesAll =
+                new ArrayList<>();
         for (final MultipartReply multipartReply : multipartReplies) {
             if (multipartReply.getType().equals(MultipartType.OFPMPTABLEFEATURES)) {
                 final MultipartReplyBody multipartReplyBody = multipartReply.getMultipartReplyBody();
                 if (multipartReplyBody instanceof MultipartReplyTableFeaturesCase) {
-                    final MultipartReplyTableFeaturesCase tableFeaturesCase = ((MultipartReplyTableFeaturesCase) multipartReplyBody);
+                    final MultipartReplyTableFeaturesCase tableFeaturesCase =
+                            ((MultipartReplyTableFeaturesCase) multipartReplyBody);
                     final MultipartReplyTableFeatures salTableFeatures = tableFeaturesCase
                             .getMultipartReplyTableFeatures();
 
index 38c05cdc41f99a2d528fcfdb619c83fcf7146ac5..9374657928331b2db6d397eeb4d17cb3a2da8046 100644 (file)
@@ -19,8 +19,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
-public class FlowCapableTransactionServiceImpl extends AbstractVoidService<SendBarrierInput> implements FlowCapableTransactionService {
-    public FlowCapableTransactionServiceImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
+public class FlowCapableTransactionServiceImpl extends AbstractVoidService<SendBarrierInput>
+                                               implements FlowCapableTransactionService {
+    public FlowCapableTransactionServiceImpl(final RequestContextStack requestContextStack,
+                                             final DeviceContext deviceContext) {
         super(requestContextStack, deviceContext);
     }
 
index 8e063fcbc7d4a2d22a5d2d07d6fea864de61c6a0..2e90a8cc08b9dc6512184a03e391d1d72b2fd372 100644 (file)
@@ -21,7 +21,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInputBuilder;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
-public final class NodeConfigServiceImpl extends AbstractSimpleService<SetConfigInput, SetConfigOutput> implements NodeConfigService {
+public final class NodeConfigServiceImpl extends AbstractSimpleService<SetConfigInput, SetConfigOutput>
+                                         implements NodeConfigService {
     public NodeConfigServiceImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
         super(requestContextStack, deviceContext, SetConfigOutput.class);
     }
index 7419940413b99ff134f5750e536fa0cd48b23fe4..efd81e438e92c7ad2f9232c1a817e5a70bf8194a 100644 (file)
@@ -23,11 +23,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.Pa
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInput;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
-public final class PacketProcessingServiceImpl extends AbstractVoidService<TransmitPacketInput> implements PacketProcessingService {
+public final class PacketProcessingServiceImpl extends AbstractVoidService<TransmitPacketInput>
+                                               implements PacketProcessingService {
 
     private final ConvertorExecutor convertorExecutor;
 
-    public PacketProcessingServiceImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext, final ConvertorExecutor convertorExecutor) {
+    public PacketProcessingServiceImpl(final RequestContextStack requestContextStack,
+                                       final DeviceContext deviceContext,
+                                       final ConvertorExecutor convertorExecutor) {
         super(requestContextStack, deviceContext);
         this.convertorExecutor = convertorExecutor;
     }
index b719ec417d79b78365aa43829a9d1b9e04900b3c..cb866fac5c49270ed71ae042c8a95cec64781a2e 100644 (file)
@@ -40,26 +40,28 @@ public final class SalEchoServiceImpl implements SalEchoService {
         return transform(echoService.handleServiceCall(echoInputBld));
     }
 
-    private Future<RpcResult<SendEchoOutput>> transform(final ListenableFuture<RpcResult<EchoOutput>> rpcResultListenableFuture) {
-        return Futures.transform(rpcResultListenableFuture, new Function<RpcResult<EchoOutput>, RpcResult<SendEchoOutput>>() {
-            @Nullable
-            @Override
-            public RpcResult<SendEchoOutput> apply(@Nullable final RpcResult<EchoOutput> input) {
-                Preconditions.checkNotNull(input, "echoOutput value is never expected to be NULL");
-                final RpcResult<SendEchoOutput> rpcOutput;
-                if (input.isSuccessful()) {
-                    final SendEchoOutput sendEchoOutput = new SendEchoOutputBuilder()
-                            .setData(input.getResult().getData())
-                            .build();
-                    rpcOutput = RpcResultBuilder.success(sendEchoOutput).build();
-                } else {
-                    rpcOutput = RpcResultBuilder.<SendEchoOutput>failed()
-                            .withRpcErrors(input.getErrors())
-                            .build();
+    private Future<RpcResult<SendEchoOutput>>
+            transform(final ListenableFuture<RpcResult<EchoOutput>> rpcResultListenableFuture) {
+        return Futures.transform(rpcResultListenableFuture,
+                                 new Function<RpcResult<EchoOutput>,
+                                 RpcResult<SendEchoOutput>>() {
+                @Nullable
+                @Override
+                public RpcResult<SendEchoOutput> apply(@Nullable final RpcResult<EchoOutput> input) {
+                    Preconditions.checkNotNull(input, "echoOutput value is never expected to be NULL");
+                    final RpcResult<SendEchoOutput> rpcOutput;
+                    if (input.isSuccessful()) {
+                        final SendEchoOutput sendEchoOutput = new SendEchoOutputBuilder()
+                                .setData(input.getResult().getData())
+                                .build();
+                        rpcOutput = RpcResultBuilder.success(sendEchoOutput).build();
+                    } else {
+                        rpcOutput = RpcResultBuilder.<SendEchoOutput>failed()
+                                .withRpcErrors(input.getErrors())
+                                .build();
+                    }
+                    return rpcOutput;
                 }
-                return rpcOutput;
-            }
-        });
+            });
     }
-
 }
index 33eb588a438117d6735c977517022da37dad8c16..aab332a83fa5d6a0ff822bd073ba87f13a0f5d07 100644 (file)
@@ -28,7 +28,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
 
-public class SalExperimenterMessageServiceImpl extends AbstractVoidService<SendExperimenterInput> implements SalExperimenterMessageService {
+public class SalExperimenterMessageServiceImpl extends AbstractVoidService<SendExperimenterInput>
+                                               implements SalExperimenterMessageService {
 
     private final ExtensionConverterProvider extensionConverterProvider;
 
@@ -41,7 +42,8 @@ public class SalExperimenterMessageServiceImpl extends AbstractVoidService<SendE
 
     @Override
     protected OfHeader buildRequest(Xid xid, SendExperimenterInput input) throws ServiceException {
-        final TypeVersionKey key = new TypeVersionKey(input.getExperimenterMessageOfChoice().getImplementedInterface(), getVersion());
+        final TypeVersionKey key =
+                new TypeVersionKey(input.getExperimenterMessageOfChoice().getImplementedInterface(), getVersion());
         final ConverterMessageToOFJava<ExperimenterMessageOfChoice, ExperimenterDataOfChoice> messageConverter =
                 extensionConverterProvider.getMessageConverter(key);
 
index a0761fdb5bbd966cb35aaa8174a06c8812a97550..ea00fc7e0db3f16623040297fc5f7223a19da091 100755 (executable)
@@ -33,10 +33,10 @@ public class SalExperimenterMpMessageServiceImpl implements SalExperimenterMpMes
     }
 
     @Override
-    public Future<RpcResult<SendExperimenterMpRequestOutput>> sendExperimenterMpRequest(SendExperimenterMpRequestInput input) {
+    public Future<RpcResult<SendExperimenterMpRequestOutput>>
+        sendExperimenterMpRequest(SendExperimenterMpRequestInput input) {
         return singleLayerService.canUseSingleLayerSerialization()
             ? singleLayerService.handleAndReply(input)
             : multiLayerService.handleAndReply(input);
     }
-
 }
index 430b6d3a1c91fa77e4784f2106afe858d548909b..7d37eb7e9a08c57b1f72222949803083c29561f8 100644 (file)
@@ -53,7 +53,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * default implementation of {@link SalFlowsBatchService} - delegates work to {@link SalFlowService}
+ * Default implementation of {@link SalFlowsBatchService} - delegates work to {@link SalFlowService}.
  */
 public class SalFlatBatchServiceImpl implements SalFlatBatchService {
     private static final Logger LOG = LoggerFactory.getLogger(SalFlatBatchServiceImpl.class);
@@ -66,19 +66,24 @@ public class SalFlatBatchServiceImpl implements SalFlatBatchService {
                                    final SalGroupsBatchService salGroupsBatchService,
                                    final SalMetersBatchService salMetersBatchService) {
         this.salFlowService = Preconditions.checkNotNull(salFlowBatchService, "delegate flow service must not be null");
-        this.salGroupService = Preconditions.checkNotNull(salGroupsBatchService, "delegate group service must not be null");
-        this.salMeterService = Preconditions.checkNotNull(salMetersBatchService, "delegate meter service must not be null");
+        this.salGroupService =
+                Preconditions.checkNotNull(salGroupsBatchService, "delegate group service must not be null");
+        this.salMeterService =
+                Preconditions.checkNotNull(salMetersBatchService, "delegate meter service must not be null");
     }
 
     @Override
     public Future<RpcResult<ProcessFlatBatchOutput>> processFlatBatch(final ProcessFlatBatchInput input) {
-        LOG.trace("processing flat batch @ {} : {}", PathUtil.extractNodeId(input.getNode()).getValue(), input.getBatch().size());
+        LOG.trace("processing flat batch @ {} : {}",
+                  PathUtil.extractNodeId(input.getNode()).getValue(),
+                  input.getBatch().size());
         // create plan
         final List<BatchPlanStep> batchPlan = FlatBatchUtil.assembleBatchPlan(input.getBatch());
         // add barriers where needed
         FlatBatchUtil.markBarriersWhereNeeded(batchPlan);
         // prepare chain elements
-        final List<BatchStepJob> batchChainElements = prepareBatchChain(batchPlan, input.getNode(), input.isExitOnFirstError());
+        final List<BatchStepJob> batchChainElements =
+                prepareBatchChain(batchPlan, input.getNode(), input.isExitOnFirstError());
         // execute plan with barriers and collect outputs chain correspondingly, collect results
         return executeBatchPlan(batchChainElements);
     }
@@ -95,7 +100,7 @@ public class SalFlatBatchServiceImpl implements SalFlatBatchService {
             // wire actual job with chain
             firedJobs.add(Futures.transformAsync(chainSummaryResult, batchJob.getStepFunction()));
             // if barrier after actual job is needed or it is the last job -> merge fired job results with chain result
-            if ((batchJob.getPlanStep().isBarrierAfter()) || (i == batchJobsChain.size()-1)) {
+            if ((batchJob.getPlanStep().isBarrierAfter()) || (i == batchJobsChain.size() - 1)) {
                 firedJobs.add(0, chainSummaryResult);
                 chainSummaryResult = FlatBatchUtil.mergeJobsResultsFutures(firedJobs);
                 firedJobs.clear();
@@ -105,7 +110,9 @@ public class SalFlatBatchServiceImpl implements SalFlatBatchService {
     }
 
     @VisibleForTesting
-    List<BatchStepJob> prepareBatchChain(final List<BatchPlanStep> batchPlan, final NodeRef node, final boolean exitOnFirstError) {
+    List<BatchStepJob> prepareBatchChain(final List<BatchPlanStep> batchPlan,
+                                         final NodeRef node,
+                                         final boolean exitOnFirstError) {
         // create batch API calls based on plan steps
         final List<BatchStepJob> chainJobs = new ArrayList<>();
         int stepOffset = 0;
@@ -133,49 +140,75 @@ public class SalFlatBatchServiceImpl implements SalFlatBatchService {
 
         switch (planStep.getStepType()) {
             case FLOW_ADD:
-                final AddFlowsBatchInput addFlowsBatchInput = FlatBatchFlowAdapters.adaptFlatBatchAddFlow(planStep, node);
-                final Future<RpcResult<AddFlowsBatchOutput>> resultAddFlowFuture = salFlowService.addFlowsBatch(addFlowsBatchInput);
+                final AddFlowsBatchInput addFlowsBatchInput =
+                        FlatBatchFlowAdapters.adaptFlatBatchAddFlow(planStep, node);
+                final Future<RpcResult<AddFlowsBatchOutput>> resultAddFlowFuture =
+                        salFlowService.addFlowsBatch(addFlowsBatchInput);
                 chainOutput = FlatBatchFlowAdapters.convertFlowBatchFutureForChain(resultAddFlowFuture, currentOffset);
                 break;
             case FLOW_REMOVE:
-                final RemoveFlowsBatchInput removeFlowsBatchInput = FlatBatchFlowAdapters.adaptFlatBatchRemoveFlow(planStep, node);
-                final Future<RpcResult<RemoveFlowsBatchOutput>> resultRemoveFlowFuture = salFlowService.removeFlowsBatch(removeFlowsBatchInput);
-                chainOutput = FlatBatchFlowAdapters.convertFlowBatchFutureForChain(resultRemoveFlowFuture, currentOffset);
+                final RemoveFlowsBatchInput removeFlowsBatchInput =
+                        FlatBatchFlowAdapters.adaptFlatBatchRemoveFlow(planStep, node);
+                final Future<RpcResult<RemoveFlowsBatchOutput>> resultRemoveFlowFuture =
+                        salFlowService.removeFlowsBatch(removeFlowsBatchInput);
+                chainOutput =
+                        FlatBatchFlowAdapters.convertFlowBatchFutureForChain(resultRemoveFlowFuture, currentOffset);
                 break;
             case FLOW_UPDATE:
-                final UpdateFlowsBatchInput updateFlowsBatchInput = FlatBatchFlowAdapters.adaptFlatBatchUpdateFlow(planStep, node);
-                final Future<RpcResult<UpdateFlowsBatchOutput>> resultUpdateFlowFuture = salFlowService.updateFlowsBatch(updateFlowsBatchInput);
-                chainOutput = FlatBatchFlowAdapters.convertFlowBatchFutureForChain(resultUpdateFlowFuture, currentOffset);
+                final UpdateFlowsBatchInput updateFlowsBatchInput =
+                        FlatBatchFlowAdapters.adaptFlatBatchUpdateFlow(planStep, node);
+                final Future<RpcResult<UpdateFlowsBatchOutput>> resultUpdateFlowFuture =
+                        salFlowService.updateFlowsBatch(updateFlowsBatchInput);
+                chainOutput =
+                        FlatBatchFlowAdapters.convertFlowBatchFutureForChain(resultUpdateFlowFuture, currentOffset);
                 break;
             case GROUP_ADD:
-                final AddGroupsBatchInput addGroupsBatchInput = FlatBatchGroupAdapters.adaptFlatBatchAddGroup(planStep, node);
-                final Future<RpcResult<AddGroupsBatchOutput>> resultAddGroupFuture = salGroupService.addGroupsBatch(addGroupsBatchInput);
-                chainOutput = FlatBatchGroupAdapters.convertGroupBatchFutureForChain(resultAddGroupFuture, currentOffset);
+                final AddGroupsBatchInput addGroupsBatchInput =
+                        FlatBatchGroupAdapters.adaptFlatBatchAddGroup(planStep, node);
+                final Future<RpcResult<AddGroupsBatchOutput>> resultAddGroupFuture =
+                        salGroupService.addGroupsBatch(addGroupsBatchInput);
+                chainOutput =
+                        FlatBatchGroupAdapters.convertGroupBatchFutureForChain(resultAddGroupFuture, currentOffset);
                 break;
             case GROUP_REMOVE:
-                final RemoveGroupsBatchInput removeGroupsBatchInput = FlatBatchGroupAdapters.adaptFlatBatchRemoveGroup(planStep, node);
-                final Future<RpcResult<RemoveGroupsBatchOutput>> resultRemoveGroupFuture = salGroupService.removeGroupsBatch(removeGroupsBatchInput);
-                chainOutput = FlatBatchGroupAdapters.convertGroupBatchFutureForChain(resultRemoveGroupFuture, currentOffset);
+                final RemoveGroupsBatchInput removeGroupsBatchInput =
+                        FlatBatchGroupAdapters.adaptFlatBatchRemoveGroup(planStep, node);
+                final Future<RpcResult<RemoveGroupsBatchOutput>> resultRemoveGroupFuture =
+                        salGroupService.removeGroupsBatch(removeGroupsBatchInput);
+                chainOutput =
+                        FlatBatchGroupAdapters.convertGroupBatchFutureForChain(resultRemoveGroupFuture, currentOffset);
                 break;
             case GROUP_UPDATE:
-                final UpdateGroupsBatchInput updateGroupsBatchInput = FlatBatchGroupAdapters.adaptFlatBatchUpdateGroup(planStep, node);
-                final Future<RpcResult<UpdateGroupsBatchOutput>> resultUpdateGroupFuture = salGroupService.updateGroupsBatch(updateGroupsBatchInput);
-                chainOutput = FlatBatchGroupAdapters.convertGroupBatchFutureForChain(resultUpdateGroupFuture, currentOffset);
+                final UpdateGroupsBatchInput updateGroupsBatchInput =
+                        FlatBatchGroupAdapters.adaptFlatBatchUpdateGroup(planStep, node);
+                final Future<RpcResult<UpdateGroupsBatchOutput>> resultUpdateGroupFuture =
+                        salGroupService.updateGroupsBatch(updateGroupsBatchInput);
+                chainOutput =
+                        FlatBatchGroupAdapters.convertGroupBatchFutureForChain(resultUpdateGroupFuture, currentOffset);
                 break;
             case METER_ADD:
-                final AddMetersBatchInput addMetersBatchInput = FlatBatchMeterAdapters.adaptFlatBatchAddMeter(planStep, node);
-                final Future<RpcResult<AddMetersBatchOutput>> resultAddMeterFuture = salMeterService.addMetersBatch(addMetersBatchInput);
-                chainOutput = FlatBatchMeterAdapters.convertMeterBatchFutureForChain(resultAddMeterFuture, currentOffset);
+                final AddMetersBatchInput addMetersBatchInput =
+                        FlatBatchMeterAdapters.adaptFlatBatchAddMeter(planStep, node);
+                final Future<RpcResult<AddMetersBatchOutput>> resultAddMeterFuture =
+                        salMeterService.addMetersBatch(addMetersBatchInput);
+                chainOutput =
+                        FlatBatchMeterAdapters.convertMeterBatchFutureForChain(resultAddMeterFuture, currentOffset);
                 break;
             case METER_REMOVE:
-                final RemoveMetersBatchInput removeMetersBatchInput = FlatBatchMeterAdapters.adaptFlatBatchRemoveMeter(planStep, node);
-                final Future<RpcResult<RemoveMetersBatchOutput>> resultRemoveMeterFuture = salMeterService.removeMetersBatch(removeMetersBatchInput);
-                chainOutput = FlatBatchMeterAdapters.convertMeterBatchFutureForChain(resultRemoveMeterFuture, currentOffset);
+                final RemoveMetersBatchInput removeMetersBatchInput =
+                        FlatBatchMeterAdapters.adaptFlatBatchRemoveMeter(planStep, node);
+                final Future<RpcResult<RemoveMetersBatchOutput>> resultRemoveMeterFuture =
+                        salMeterService.removeMetersBatch(removeMetersBatchInput);
+                chainOutput =
+                        FlatBatchMeterAdapters.convertMeterBatchFutureForChain(resultRemoveMeterFuture, currentOffset);
                 break;
             case METER_UPDATE:
-                final UpdateMetersBatchInput updateMetersBatchInput = FlatBatchMeterAdapters.adaptFlatBatchUpdateMeter(planStep, node);
-                final Future<RpcResult<UpdateMetersBatchOutput>> resultUpdateMeterFuture = salMeterService.updateMetersBatch(updateMetersBatchInput);
-                chainOutput = FlatBatchMeterAdapters.convertMeterBatchFutureForChain(resultUpdateMeterFuture, currentOffset);
+                final UpdateMetersBatchInput updateMetersBatchInput =
+                        FlatBatchMeterAdapters.adaptFlatBatchUpdateMeter(planStep, node);
+                final Future<RpcResult<UpdateMetersBatchOutput>> resultUpdateMeterFuture =
+                        salMeterService.updateMetersBatch(updateMetersBatchInput);
+                chainOutput =
+                        FlatBatchMeterAdapters.convertMeterBatchFutureForChain(resultUpdateMeterFuture, currentOffset);
                 break;
             default:
                 LOG.warn("Unsupported plan-step type occurred: {} -> OMITTING", planStep.getStepType());
index 0332e2d8de22def8761eb2c71186236c37ff4ed9..d55499802b1252e7e437d86257e1bb06f99023a0 100644 (file)
@@ -27,8 +27,8 @@ import org.opendaylight.openflowplugin.api.openflow.rpc.ItemLifeCycleSource;
 import org.opendaylight.openflowplugin.api.openflow.rpc.listener.ItemLifecycleListener;
 import org.opendaylight.openflowplugin.impl.registry.flow.FlowDescriptorFactory;
 import org.opendaylight.openflowplugin.impl.registry.flow.FlowRegistryKeyFactory;
-import org.opendaylight.openflowplugin.impl.services.singlelayer.SingleLayerFlowService;
 import org.opendaylight.openflowplugin.impl.services.multilayer.MultiLayerFlowService;
+import org.opendaylight.openflowplugin.impl.services.singlelayer.SingleLayerFlowService;
 import org.opendaylight.openflowplugin.impl.util.ErrorUtil;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
 import org.opendaylight.openflowplugin.openflow.md.util.FlowCreatorUtil;
@@ -70,14 +70,25 @@ public class SalFlowServiceImpl implements SalFlowService, ItemLifeCycleSource {
     private final DeviceContext deviceContext;
     private ItemLifecycleListener itemLifecycleListener;
 
-    public SalFlowServiceImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext, final ConvertorExecutor convertorExecutor) {
+    public SalFlowServiceImpl(final RequestContextStack requestContextStack,
+                              final DeviceContext deviceContext,
+                              final ConvertorExecutor convertorExecutor) {
         this.deviceContext = deviceContext;
-        flowRemove = new MultiLayerFlowService<>(requestContextStack, deviceContext, RemoveFlowOutput.class, convertorExecutor);
-        flowAdd = new MultiLayerFlowService<>(requestContextStack, deviceContext, AddFlowOutput.class, convertorExecutor);
-        flowUpdate = new MultiLayerFlowService<>(requestContextStack, deviceContext, UpdateFlowOutput.class, convertorExecutor);
+        flowRemove = new MultiLayerFlowService<>(requestContextStack,
+                                                 deviceContext,
+                                                 RemoveFlowOutput.class,
+                                                 convertorExecutor);
+        flowAdd = new MultiLayerFlowService<>(requestContextStack,
+                                              deviceContext,
+                                              AddFlowOutput.class,
+                                              convertorExecutor);
+        flowUpdate = new MultiLayerFlowService<>(requestContextStack,
+                                                 deviceContext,
+                                                 UpdateFlowOutput.class,
+                                                 convertorExecutor);
         flowAddMessage = new SingleLayerFlowService<>(requestContextStack, deviceContext, AddFlowOutput.class);
         flowUpdateMessage = new SingleLayerFlowService<>(requestContextStack, deviceContext, UpdateFlowOutput.class);
-        flowRemoveMessage= new SingleLayerFlowService<>(requestContextStack, deviceContext, RemoveFlowOutput.class);
+        flowRemoveMessage = new SingleLayerFlowService<>(requestContextStack, deviceContext, RemoveFlowOutput.class);
     }
 
     @Override
@@ -87,7 +98,8 @@ public class SalFlowServiceImpl implements SalFlowService, ItemLifeCycleSource {
 
     @Override
     public Future<RpcResult<AddFlowOutput>> addFlow(final AddFlowInput input) {
-        final FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(deviceContext.getDeviceInfo().getVersion(), input);
+        final FlowRegistryKey flowRegistryKey =
+                FlowRegistryKeyFactory.create(deviceContext.getDeviceInfo().getVersion(), input);
         final ListenableFuture<RpcResult<AddFlowOutput>> future;
 
         if (flowAddMessage.canUseSingleLayerSerialization()) {
@@ -131,9 +143,9 @@ public class SalFlowServiceImpl implements SalFlowService, ItemLifeCycleSource {
             if (!FlowCreatorUtil.canModifyFlow(original, updated, flowUpdateMessage.getVersion())) {
                 final SettableFuture<RpcResult<UpdateFlowOutput>> objectSettableFuture = SettableFuture.create();
 
-                final ListenableFuture<List<RpcResult<UpdateFlowOutput>>> listListenableFuture = Futures.successfulAsList(
-                        flowUpdateMessage.handleServiceCall(input.getOriginalFlow()),
-                        flowUpdateMessage.handleServiceCall(input.getUpdatedFlow()));
+                final ListenableFuture<List<RpcResult<UpdateFlowOutput>>> listListenableFuture =
+                        Futures.successfulAsList(flowUpdateMessage.handleServiceCall(input.getOriginalFlow()),
+                                                 flowUpdateMessage.handleServiceCall(input.getUpdatedFlow()));
 
                 Futures.addCallback(listListenableFuture, new FutureCallback<List<RpcResult<UpdateFlowOutput>>>() {
                     @Override
@@ -160,7 +172,7 @@ public class SalFlowServiceImpl implements SalFlowService, ItemLifeCycleSource {
                     }
 
                     @Override
-                    public void onFailure(final Throwable t) {
+                    public void onFailure(final Throwable throwable) {
                         RpcResultBuilder<UpdateFlowOutput> rpcResultBuilder = RpcResultBuilder.failed();
                         objectSettableFuture.set(rpcResultBuilder.build());
                     }
@@ -195,8 +207,9 @@ public class SalFlowServiceImpl implements SalFlowService, ItemLifeCycleSource {
     }
 
     @VisibleForTesting
-    private static KeyedInstanceIdentifier<Flow, FlowKey> createFlowPath(FlowDescriptor flowDescriptor,
-                                                                         KeyedInstanceIdentifier<Node, NodeKey> nodePath) {
+    private static KeyedInstanceIdentifier<Flow, FlowKey> createFlowPath(
+                                                                    FlowDescriptor flowDescriptor,
+                                                                    KeyedInstanceIdentifier<Node, NodeKey> nodePath) {
         return nodePath.augmentation(FlowCapableNode.class)
                 .child(Table.class, flowDescriptor.getTableKey())
                 .child(Flow.class, new FlowKey(flowDescriptor.getFlowId()));
@@ -263,11 +276,13 @@ public class SalFlowServiceImpl implements SalFlowService, ItemLifeCycleSource {
                 if (LOG.isDebugEnabled()) {
                     LOG.debug("Flow remove finished without error for flow={}", input);
                 }
-                FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(deviceContext.getDeviceInfo().getVersion(), input);
+                FlowRegistryKey flowRegistryKey =
+                        FlowRegistryKeyFactory.create(deviceContext.getDeviceInfo().getVersion(), input);
                 deviceContext.getDeviceFlowRegistry().addMark(flowRegistryKey);
 
                 if (itemLifecycleListener != null) {
-                    final FlowDescriptor flowDescriptor = deviceContext.getDeviceFlowRegistry().retrieveDescriptor(flowRegistryKey);
+                    final FlowDescriptor flowDescriptor =
+                            deviceContext.getDeviceFlowRegistry().retrieveDescriptor(flowRegistryKey);
 
                     if (flowDescriptor != null) {
                         KeyedInstanceIdentifier<Flow, FlowKey> flowPath = createFlowPath(flowDescriptor,
@@ -297,20 +312,24 @@ public class SalFlowServiceImpl implements SalFlowService, ItemLifeCycleSource {
         }
 
         @Override
-        public void onSuccess(final RpcResult<UpdateFlowOutput> o) {
+        public void onSuccess(final RpcResult<UpdateFlowOutput> updateFlowOutputRpcResult) {
             final DeviceFlowRegistry deviceFlowRegistry = deviceContext.getDeviceFlowRegistry();
 
             final UpdatedFlow updated = input.getUpdatedFlow();
             final OriginalFlow original = input.getOriginalFlow();
-            final FlowRegistryKey origFlowRegistryKey = FlowRegistryKeyFactory.create(deviceContext.getDeviceInfo().getVersion(), original);
-            final FlowRegistryKey updatedFlowRegistryKey = FlowRegistryKeyFactory.create(deviceContext.getDeviceInfo().getVersion(), updated);
+            final FlowRegistryKey origFlowRegistryKey =
+                    FlowRegistryKeyFactory.create(deviceContext.getDeviceInfo().getVersion(), original);
+            final FlowRegistryKey updatedFlowRegistryKey =
+                    FlowRegistryKeyFactory.create(deviceContext.getDeviceInfo().getVersion(), updated);
             final FlowDescriptor origFlowDescriptor = deviceFlowRegistry.retrieveDescriptor(origFlowRegistryKey);
 
             final boolean isUpdate = Objects.nonNull(origFlowDescriptor);
             final FlowDescriptor updatedFlowDescriptor;
 
             if (Objects.nonNull(input.getFlowRef())) {
-                updatedFlowDescriptor = FlowDescriptorFactory.create(updated.getTableId(), input.getFlowRef().getValue().firstKeyOf(Flow.class).getId());
+                updatedFlowDescriptor =
+                        FlowDescriptorFactory.create(updated.getTableId(),
+                                                     input.getFlowRef().getValue().firstKeyOf(Flow.class).getId());
             } else {
                 if (isUpdate) {
                     updatedFlowDescriptor = origFlowDescriptor;
index 73ca65df3bfd4a72d0dff6766a18ee54b6d8d303..c266e0747e1cca15caf01c06c9a3d9becb162a70 100644 (file)
@@ -61,12 +61,15 @@ public class SalFlowsBatchServiceImpl implements SalFlowsBatchService {
     public SalFlowsBatchServiceImpl(final SalFlowService salFlowService,
                                     final FlowCapableTransactionService transactionService) {
         this.salFlowService = Preconditions.checkNotNull(salFlowService, "delegate flow service must not be null");
-        this.transactionService = Preconditions.checkNotNull(transactionService, "delegate transaction service must not be null");
+        this.transactionService =
+                Preconditions.checkNotNull(transactionService, "delegate transaction service must not be null");
     }
 
     @Override
     public Future<RpcResult<RemoveFlowsBatchOutput>> removeFlowsBatch(final RemoveFlowsBatchInput input) {
-        LOG.trace("Removing flows @ {} : {}", PathUtil.extractNodeId(input.getNode()), input.getBatchRemoveFlows().size());
+        LOG.trace("Removing flows @ {} : {}",
+                  PathUtil.extractNodeId(input.getNode()),
+                  input.getBatchRemoveFlows().size());
         final ArrayList<ListenableFuture<RpcResult<RemoveFlowOutput>>> resultsLot = new ArrayList<>();
         for (BatchFlowInputGrouping batchFlow : input.getBatchRemoveFlows()) {
             final RemoveFlowInput removeFlowInput = new RemoveFlowInputBuilder(batchFlow)
@@ -80,7 +83,8 @@ public class SalFlowsBatchServiceImpl implements SalFlowsBatchService {
                 Futures.transform(Futures.successfulAsList(resultsLot),
                         FlowUtil.<RemoveFlowOutput>createCumulatingFunction(input.getBatchRemoveFlows()));
 
-        ListenableFuture<RpcResult<RemoveFlowsBatchOutput>> removeFlowsBulkFuture = Futures.transform(commonResult, FlowUtil.FLOW_REMOVE_TRANSFORM);
+        ListenableFuture<RpcResult<RemoveFlowsBatchOutput>> removeFlowsBulkFuture =
+                Futures.transform(commonResult, FlowUtil.FLOW_REMOVE_TRANSFORM);
 
         if (input.isBarrierAfter()) {
             removeFlowsBulkFuture = BarrierUtil.chainBarrier(removeFlowsBulkFuture, input.getNode(),
@@ -129,7 +133,9 @@ public class SalFlowsBatchServiceImpl implements SalFlowsBatchService {
 
     @Override
     public Future<RpcResult<UpdateFlowsBatchOutput>> updateFlowsBatch(final UpdateFlowsBatchInput input) {
-        LOG.trace("Updating flows @ {} : {}", PathUtil.extractNodeId(input.getNode()), input.getBatchUpdateFlows().size());
+        LOG.trace("Updating flows @ {} : {}",
+                  PathUtil.extractNodeId(input.getNode()),
+                  input.getBatchUpdateFlows().size());
         final ArrayList<ListenableFuture<RpcResult<UpdateFlowOutput>>> resultsLot = new ArrayList<>();
         for (BatchUpdateFlows batchFlow : input.getBatchUpdateFlows()) {
             final UpdateFlowInput updateFlowInput = new UpdateFlowInputBuilder(input)
@@ -142,9 +148,11 @@ public class SalFlowsBatchServiceImpl implements SalFlowsBatchService {
         }
 
         final ListenableFuture<RpcResult<List<BatchFailedFlowsOutput>>> commonResult =
-                Futures.transform(Futures.successfulAsList(resultsLot), FlowUtil.<UpdateFlowOutput>createCumulatingFunction(input.getBatchUpdateFlows()));
+                Futures.transform(Futures.successfulAsList(resultsLot),
+                                  FlowUtil.<UpdateFlowOutput>createCumulatingFunction(input.getBatchUpdateFlows()));
 
-        ListenableFuture<RpcResult<UpdateFlowsBatchOutput>> updateFlowsBulkFuture = Futures.transform(commonResult, FlowUtil.FLOW_UPDATE_TRANSFORM);
+        ListenableFuture<RpcResult<UpdateFlowsBatchOutput>> updateFlowsBulkFuture =
+                Futures.transform(commonResult, FlowUtil.FLOW_UPDATE_TRANSFORM);
 
         if (input.isBarrierAfter()) {
             updateFlowsBulkFuture = BarrierUtil.chainBarrier(updateFlowsBulkFuture, input.getNode(),
@@ -153,5 +161,4 @@ public class SalFlowsBatchServiceImpl implements SalFlowsBatchService {
 
         return updateFlowsBulkFuture;
     }
-
 }
index b041541dbea3e24b956cfa0eb0617514addda88b..47a3970d0b0a189aaa8326be402239419e072466 100644 (file)
@@ -16,8 +16,8 @@ import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.rpc.ItemLifeCycleSource;
 import org.opendaylight.openflowplugin.api.openflow.rpc.listener.ItemLifecycleListener;
-import org.opendaylight.openflowplugin.impl.services.singlelayer.SingleLayerGroupService;
 import org.opendaylight.openflowplugin.impl.services.multilayer.MultiLayerGroupService;
+import org.opendaylight.openflowplugin.impl.services.singlelayer.SingleLayerGroupService;
 import org.opendaylight.openflowplugin.impl.util.ErrorUtil;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
@@ -51,11 +51,24 @@ public class SalGroupServiceImpl implements SalGroupService, ItemLifeCycleSource
     private final DeviceContext deviceContext;
     private ItemLifecycleListener itemLifecycleListener;
 
-    public SalGroupServiceImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext, final ConvertorExecutor convertorExecutor) {
+    public SalGroupServiceImpl(final RequestContextStack requestContextStack,
+                               final DeviceContext deviceContext,
+                               final ConvertorExecutor convertorExecutor) {
         this.deviceContext = deviceContext;
-        addGroup = new MultiLayerGroupService<>(requestContextStack, deviceContext, AddGroupOutput.class, convertorExecutor);
-        updateGroup = new MultiLayerGroupService<>(requestContextStack, deviceContext, UpdateGroupOutput.class, convertorExecutor);
-        removeGroup = new MultiLayerGroupService<>(requestContextStack, deviceContext, RemoveGroupOutput.class, convertorExecutor);
+        addGroup = new MultiLayerGroupService<>(requestContextStack,
+                                                deviceContext,
+                                                AddGroupOutput.class,
+                                                convertorExecutor);
+
+        updateGroup = new MultiLayerGroupService<>(requestContextStack,
+                                                   deviceContext,
+                                                   UpdateGroupOutput.class,
+                                                   convertorExecutor);
+
+        removeGroup = new MultiLayerGroupService<>(requestContextStack,
+                                                   deviceContext,
+                                                   RemoveGroupOutput.class,
+                                                   convertorExecutor);
 
         addGroupMessage = new SingleLayerGroupService<>(requestContextStack, deviceContext, AddGroupOutput.class);
         updateGroupMessage = new SingleLayerGroupService<>(requestContextStack, deviceContext, UpdateGroupOutput.class);
@@ -69,7 +82,8 @@ public class SalGroupServiceImpl implements SalGroupService, ItemLifeCycleSource
 
     @Override
     public Future<RpcResult<AddGroupOutput>> addGroup(final AddGroupInput input) {
-        final ListenableFuture<RpcResult<AddGroupOutput>> resultFuture = addGroupMessage.canUseSingleLayerSerialization()
+        final ListenableFuture<RpcResult<AddGroupOutput>> resultFuture =
+            addGroupMessage.canUseSingleLayerSerialization()
             ? addGroupMessage.handleServiceCall(input)
             : addGroup.handleServiceCall(input);
 
@@ -91,8 +105,10 @@ public class SalGroupServiceImpl implements SalGroupService, ItemLifeCycleSource
             }
 
             @Override
-            public void onFailure(Throwable t) {
-                LOG.warn("Service call for adding group={} failed, reason: {}", input.getGroupId().getValue(), t);
+            public void onFailure(Throwable throwable) {
+                LOG.warn("Service call for adding group={} failed, reason: {}",
+                          input.getGroupId().getValue(),
+                          throwable);
             }
         });
         return resultFuture;
@@ -101,7 +117,8 @@ public class SalGroupServiceImpl implements SalGroupService, ItemLifeCycleSource
 
     @Override
     public Future<RpcResult<UpdateGroupOutput>> updateGroup(final UpdateGroupInput input) {
-        final ListenableFuture<RpcResult<UpdateGroupOutput>> resultFuture = updateGroupMessage.canUseSingleLayerSerialization()
+        final ListenableFuture<RpcResult<UpdateGroupOutput>> resultFuture =
+            updateGroupMessage.canUseSingleLayerSerialization()
             ? updateGroupMessage.handleServiceCall(input.getUpdatedGroup())
             : updateGroup.handleServiceCall(input.getUpdatedGroup());
 
@@ -123,9 +140,9 @@ public class SalGroupServiceImpl implements SalGroupService, ItemLifeCycleSource
             }
 
             @Override
-            public void onFailure(Throwable t) {
+            public void onFailure(Throwable throwable) {
                 LOG.warn("Service call for updating group={} failed, reason: {}",
-                        input.getOriginalGroup().getGroupId(), t);
+                        input.getOriginalGroup().getGroupId(), throwable);
             }
         });
         return resultFuture;
@@ -133,7 +150,8 @@ public class SalGroupServiceImpl implements SalGroupService, ItemLifeCycleSource
 
     @Override
     public Future<RpcResult<RemoveGroupOutput>> removeGroup(final RemoveGroupInput input) {
-        final ListenableFuture<RpcResult<RemoveGroupOutput>> resultFuture = removeGroupMessage.canUseSingleLayerSerialization()
+        final ListenableFuture<RpcResult<RemoveGroupOutput>> resultFuture =
+            removeGroupMessage.canUseSingleLayerSerialization()
             ? removeGroupMessage.handleServiceCall(input)
             : removeGroup.handleServiceCall(input);
 
@@ -154,9 +172,9 @@ public class SalGroupServiceImpl implements SalGroupService, ItemLifeCycleSource
             }
 
             @Override
-            public void onFailure(Throwable t) {
+            public void onFailure(Throwable throwable) {
                 LOG.warn("Service call for removing group={} failed, reason: {}",
-                        input.getGroupId().getValue(), t);
+                        input.getGroupId().getValue(), throwable);
             }
         });
         return resultFuture;
@@ -164,25 +182,28 @@ public class SalGroupServiceImpl implements SalGroupService, ItemLifeCycleSource
 
     private void removeIfNecessaryFromDS(final GroupId groupId) {
         if (itemLifecycleListener != null) {
-            KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group, GroupKey> groupPath
+            KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn
+                    .opendaylight.group.types.rev131018.groups.Group, GroupKey> groupPath
                     = createGroupPath(groupId,
-                    deviceContext.getDeviceInfo().getNodeInstanceIdentifier());
+                                      deviceContext.getDeviceInfo().getNodeInstanceIdentifier());
             itemLifecycleListener.onRemoved(groupPath);
         }
     }
 
     private void addIfNecessaryToDS(final GroupId groupId, final Group data) {
         if (itemLifecycleListener != null) {
-            KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group, GroupKey> groupPath
+            KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn
+                    .opendaylight.group.types.rev131018.groups.Group, GroupKey> groupPath
                     = createGroupPath(groupId,
-                    deviceContext.getDeviceInfo().getNodeInstanceIdentifier());
+                                      deviceContext.getDeviceInfo().getNodeInstanceIdentifier());
             itemLifecycleListener.onAdded(groupPath, new GroupBuilder(data).build());
         }
     }
 
-    private static KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group, GroupKey>
-    createGroupPath(final GroupId groupId, final KeyedInstanceIdentifier<Node, NodeKey> nodePath) {
-        return nodePath.augmentation(FlowCapableNode.class).
-                child(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group.class, new GroupKey(groupId));
+    private static KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn
+            .opendaylight.group.types.rev131018.groups.Group, GroupKey>
+        createGroupPath(final GroupId groupId, final KeyedInstanceIdentifier<Node, NodeKey> nodePath) {
+        return nodePath.augmentation(FlowCapableNode.class).child(org.opendaylight.yang.gen.v1.urn
+                .opendaylight.group.types.rev131018.groups.Group.class, new GroupKey(groupId));
     }
 }
index ebe4dac6279eeffbeb3bfdcacbe6f49b9b1ad1ec..e84f69c7559f052eac397ece7d4519922be5bc3b 100644 (file)
@@ -64,7 +64,8 @@ public class SalGroupsBatchServiceImpl implements SalGroupsBatchService {
     private final SalGroupService salGroupService;
     private final FlowCapableTransactionService transactionService;
 
-    public SalGroupsBatchServiceImpl(final SalGroupService salGroupService, final FlowCapableTransactionService transactionService) {
+    public SalGroupsBatchServiceImpl(final SalGroupService salGroupService,
+                                     final FlowCapableTransactionService transactionService) {
         this.salGroupService = Preconditions.checkNotNull(salGroupService);
         this.transactionService = Preconditions.checkNotNull(transactionService);
     }
@@ -86,12 +87,12 @@ public class SalGroupsBatchServiceImpl implements SalGroupsBatchService {
         }
 
         final Iterable<Group> groups = Iterables.transform(batchUpdateGroups, new Function<BatchUpdateGroups, Group>() {
-                    @Nullable
-                    @Override
-                    public Group apply(@Nullable final BatchUpdateGroups input) {
-                        return input.getUpdatedBatchedGroup();
-                    }
+                @Nullable
+                @Override
+                public Group apply(@Nullable final BatchUpdateGroups input) {
+                    return input.getUpdatedBatchedGroup();
                 }
+            }
         );
 
         final ListenableFuture<RpcResult<List<BatchFailedGroupsOutput>>> commonResult =
@@ -138,7 +139,9 @@ public class SalGroupsBatchServiceImpl implements SalGroupsBatchService {
 
     @Override
     public Future<RpcResult<RemoveGroupsBatchOutput>> removeGroupsBatch(final RemoveGroupsBatchInput input) {
-        LOG.trace("Removing groups @ {} : {}", PathUtil.extractNodeId(input.getNode()), input.getBatchRemoveGroups().size());
+        LOG.trace("Removing groups @ {} : {}",
+                  PathUtil.extractNodeId(input.getNode()),
+                  input.getBatchRemoveGroups().size());
         final ArrayList<ListenableFuture<RpcResult<RemoveGroupOutput>>> resultsLot = new ArrayList<>();
         for (BatchRemoveGroups addGroup : input.getBatchRemoveGroups()) {
             final RemoveGroupInput removeGroupInput = new RemoveGroupInputBuilder(addGroup)
index 2c646251bcb7dce099b6df883e62e5f38ac5b14a..993b4bc7d8d975415d501390ab5a3990ced359fb 100644 (file)
@@ -16,8 +16,8 @@ import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.rpc.ItemLifeCycleSource;
 import org.opendaylight.openflowplugin.api.openflow.rpc.listener.ItemLifecycleListener;
-import org.opendaylight.openflowplugin.impl.services.singlelayer.SingleLayerMeterService;
 import org.opendaylight.openflowplugin.impl.services.multilayer.MultiLayerMeterService;
+import org.opendaylight.openflowplugin.impl.services.singlelayer.SingleLayerMeterService;
 import org.opendaylight.openflowplugin.impl.util.ErrorUtil;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
@@ -51,11 +51,24 @@ public class SalMeterServiceImpl implements SalMeterService, ItemLifeCycleSource
     private ItemLifecycleListener itemLifecycleListener;
     private final DeviceContext deviceContext;
 
-    public SalMeterServiceImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext, final ConvertorExecutor convertorExecutor) {
+    public SalMeterServiceImpl(final RequestContextStack requestContextStack,
+                               final DeviceContext deviceContext,
+                               final ConvertorExecutor convertorExecutor) {
         this.deviceContext = deviceContext;
-        addMeter = new MultiLayerMeterService<>(requestContextStack, deviceContext, AddMeterOutput.class, convertorExecutor);
-        updateMeter = new MultiLayerMeterService<>(requestContextStack, deviceContext, UpdateMeterOutput.class, convertorExecutor);
-        removeMeter = new MultiLayerMeterService<>(requestContextStack, deviceContext, RemoveMeterOutput.class, convertorExecutor);
+        addMeter = new MultiLayerMeterService<>(requestContextStack,
+                                                deviceContext,
+                                                AddMeterOutput.class,
+                                                convertorExecutor);
+
+        updateMeter = new MultiLayerMeterService<>(requestContextStack,
+                                                   deviceContext,
+                                                   UpdateMeterOutput.class,
+                                                   convertorExecutor);
+
+        removeMeter = new MultiLayerMeterService<>(requestContextStack,
+                                                   deviceContext,
+                                                   RemoveMeterOutput.class,
+                                                   convertorExecutor);
 
         addMeterMessage = new SingleLayerMeterService<>(requestContextStack, deviceContext, AddMeterOutput.class);
         updateMeterMessage = new SingleLayerMeterService<>(requestContextStack, deviceContext, UpdateMeterOutput.class);
@@ -69,7 +82,8 @@ public class SalMeterServiceImpl implements SalMeterService, ItemLifeCycleSource
 
     @Override
     public Future<RpcResult<AddMeterOutput>> addMeter(final AddMeterInput input) {
-        final ListenableFuture<RpcResult<AddMeterOutput>> resultFuture = addMeterMessage.canUseSingleLayerSerialization()
+        final ListenableFuture<RpcResult<AddMeterOutput>> resultFuture =
+            addMeterMessage.canUseSingleLayerSerialization()
             ? addMeterMessage.handleServiceCall(input)
             : addMeter.handleServiceCall(input);
 
@@ -91,8 +105,8 @@ public class SalMeterServiceImpl implements SalMeterService, ItemLifeCycleSource
             }
 
             @Override
-            public void onFailure(Throwable t) {
-                 LOG.warn("Service call for adding meter={} failed, reason: {}", input.getMeterId(), t);
+            public void onFailure(Throwable throwable) {
+                LOG.warn("Service call for adding meter={} failed, reason: {}", input.getMeterId(), throwable);
             }
         });
         return resultFuture;
@@ -100,7 +114,8 @@ public class SalMeterServiceImpl implements SalMeterService, ItemLifeCycleSource
 
     @Override
     public Future<RpcResult<UpdateMeterOutput>> updateMeter(final UpdateMeterInput input) {
-        final ListenableFuture<RpcResult<UpdateMeterOutput>> resultFuture = updateMeterMessage.canUseSingleLayerSerialization()
+        final ListenableFuture<RpcResult<UpdateMeterOutput>> resultFuture =
+            updateMeterMessage.canUseSingleLayerSerialization()
             ? updateMeterMessage.handleServiceCall(input.getUpdatedMeter())
             : updateMeter.handleServiceCall(input.getUpdatedMeter());
 
@@ -110,7 +125,8 @@ public class SalMeterServiceImpl implements SalMeterService, ItemLifeCycleSource
             public void onSuccess(RpcResult<UpdateMeterOutput> result) {
                 if (result.isSuccessful()) {
                     if (LOG.isDebugEnabled()) {
-                        LOG.debug("Meter update with id={} finished without error", input.getOriginalMeter().getMeterId());
+                        LOG.debug("Meter update with id={} finished without error",
+                                  input.getOriginalMeter().getMeterId());
                     }
                     if (itemLifecycleListener != null) {
                         removeIfNecessaryFromDS(input.getOriginalMeter().getMeterId());
@@ -124,9 +140,9 @@ public class SalMeterServiceImpl implements SalMeterService, ItemLifeCycleSource
             }
 
             @Override
-            public void onFailure(Throwable t) {
+            public void onFailure(Throwable throwable) {
                 LOG.warn("Service call for updating meter={} failed, reason: {}",
-                        input.getOriginalMeter().getMeterId(),t);
+                        input.getOriginalMeter().getMeterId(),throwable);
             }
         });
         return resultFuture;
@@ -134,7 +150,8 @@ public class SalMeterServiceImpl implements SalMeterService, ItemLifeCycleSource
 
     @Override
     public Future<RpcResult<RemoveMeterOutput>> removeMeter(final RemoveMeterInput input) {
-        final ListenableFuture<RpcResult<RemoveMeterOutput>> resultFuture = removeMeterMessage.canUseSingleLayerSerialization()
+        final ListenableFuture<RpcResult<RemoveMeterOutput>> resultFuture =
+            removeMeterMessage.canUseSingleLayerSerialization()
             ? removeMeterMessage.handleServiceCall(input)
             : removeMeter.handleServiceCall(input);
 
@@ -155,8 +172,8 @@ public class SalMeterServiceImpl implements SalMeterService, ItemLifeCycleSource
             }
 
             @Override
-            public void onFailure(Throwable t) {
-                LOG.warn("Service call for removing meter={} failed, reason: {}",input.getMeterId(),t);
+            public void onFailure(Throwable throwable) {
+                LOG.warn("Service call for removing meter={} failed, reason: {}",input.getMeterId(),throwable);
             }
         });
         return resultFuture;
@@ -164,7 +181,8 @@ public class SalMeterServiceImpl implements SalMeterService, ItemLifeCycleSource
 
     private void removeIfNecessaryFromDS(final MeterId meterId) {
         if (itemLifecycleListener != null) {
-            KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter, MeterKey> meterPath
+            KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn
+                    .opendaylight.flow.inventory.rev130819.meters.Meter, MeterKey> meterPath
                     = createMeterPath(meterId, deviceContext.getDeviceInfo().getNodeInstanceIdentifier());
             itemLifecycleListener.onRemoved(meterPath);
         }
@@ -172,13 +190,19 @@ public class SalMeterServiceImpl implements SalMeterService, ItemLifeCycleSource
 
     private void addIfNecessaryToDS(final MeterId meterId, final Meter data) {
         if (itemLifecycleListener != null) {
-            KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter, MeterKey> groupPath
+            KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn
+                    .opendaylight.flow.inventory.rev130819.meters.Meter, MeterKey> groupPath
                     = createMeterPath(meterId, deviceContext.getDeviceInfo().getNodeInstanceIdentifier());
             itemLifecycleListener.onAdded(groupPath, new MeterBuilder(data).build());
         }
     }
 
-    private static KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter, MeterKey> createMeterPath(final MeterId meterId, final KeyedInstanceIdentifier<Node, NodeKey> nodePath) {
-        return nodePath.augmentation(FlowCapableNode.class).child(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter.class, new MeterKey(meterId));
+    private static KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn
+            .opendaylight.flow.inventory.rev130819.meters.Meter, MeterKey> createMeterPath(
+                                                            final MeterId meterId,
+                                                            final KeyedInstanceIdentifier<Node, NodeKey> nodePath) {
+        return nodePath.augmentation(FlowCapableNode.class)
+                .child(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter.class,
+                       new MeterKey(meterId));
     }
 }
index 9a9a00b2c1abf21e6ecbd24fab55053a7a1d850e..ea0361423d22104abe7753b5dbe4543cb5f79e88 100644 (file)
@@ -64,7 +64,8 @@ public class SalMetersBatchServiceImpl implements SalMetersBatchService {
     private final SalMeterService salMeterService;
     private final FlowCapableTransactionService transactionService;
 
-    public SalMetersBatchServiceImpl(final SalMeterService salMeterService, final FlowCapableTransactionService transactionService) {
+    public SalMetersBatchServiceImpl(final SalMeterService salMeterService,
+                                     final FlowCapableTransactionService transactionService) {
         this.salMeterService = Preconditions.checkNotNull(salMeterService);
         this.transactionService = Preconditions.checkNotNull(transactionService);
     }
@@ -86,12 +87,12 @@ public class SalMetersBatchServiceImpl implements SalMetersBatchService {
         }
 
         final Iterable<Meter> meters = Iterables.transform(batchUpdateMeters, new Function<BatchUpdateMeters, Meter>() {
-                    @Nullable
-                    @Override
-                    public Meter apply(@Nullable final BatchUpdateMeters input) {
-                        return input.getUpdatedBatchedMeter();
-                    }
+                @Nullable
+                @Override
+                public Meter apply(@Nullable final BatchUpdateMeters input) {
+                    return input.getUpdatedBatchedMeter();
                 }
+            }
         );
 
         final ListenableFuture<RpcResult<List<BatchFailedMetersOutput>>> commonResult =
@@ -138,7 +139,9 @@ public class SalMetersBatchServiceImpl implements SalMetersBatchService {
 
     @Override
     public Future<RpcResult<RemoveMetersBatchOutput>> removeMetersBatch(final RemoveMetersBatchInput input) {
-        LOG.trace("Removing meters @ {} : {}", PathUtil.extractNodeId(input.getNode()), input.getBatchRemoveMeters().size());
+        LOG.trace("Removing meters @ {} : {}",
+                  PathUtil.extractNodeId(input.getNode()),
+                  input.getBatchRemoveMeters().size());
         final ArrayList<ListenableFuture<RpcResult<RemoveMeterOutput>>> resultsLot = new ArrayList<>();
         for (BatchRemoveMeters addMeter : input.getBatchRemoveMeters()) {
             final RemoveMeterInput removeMeterInput = new RemoveMeterInputBuilder(addMeter)
index 317a7cb101e8ea58159fc0006bd2f0c288ac862b..bf5e344ed5bafb9d18209a95622d64cc241c30d4 100644 (file)
@@ -27,12 +27,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.port.service.rev131107.Upda
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.service.rev131107.UpdatePortOutput;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
-public final class SalPortServiceImpl extends AbstractSimpleService<UpdatePortInput, UpdatePortOutput> implements SalPortService {
+public final class SalPortServiceImpl
+        extends AbstractSimpleService<UpdatePortInput, UpdatePortOutput> implements SalPortService {
     private final ConvertorExecutor convertorExecutor;
     private final VersionConvertorData data;
     private final SingleLayerPortService<UpdatePortOutput> portMessage;
 
-    public SalPortServiceImpl(final RequestContextStack requestContextStack, final DeviceContext deviceContext, final ConvertorExecutor convertorExecutor) {
+    public SalPortServiceImpl(final RequestContextStack requestContextStack,
+                              final DeviceContext deviceContext,
+                              final ConvertorExecutor convertorExecutor) {
         super(requestContextStack, deviceContext, UpdatePortOutput.class);
         this.convertorExecutor = convertorExecutor;
         data = new VersionConvertorData(getVersion());
index 8770d19c6ea97ac2c977c4b7c91bf7661dcbd552..5aadb52367da1ff3125f3541aefd9e2e629bf00b 100644 (file)
@@ -31,7 +31,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
-public final class SalRoleServiceImpl extends AbstractSimpleService<SetRoleInput, SetRoleOutput> implements SalRoleService  {
+public final class SalRoleServiceImpl extends AbstractSimpleService<SetRoleInput, SetRoleOutput>
+                                      implements SalRoleService  {
+
     private static final Logger LOG = LoggerFactory.getLogger(SalRoleServiceImpl.class);
     private static final BigInteger MAX_GENERATION_ID = new BigInteger("ffffffffffffffff", 16);
 
@@ -81,10 +83,13 @@ public final class SalRoleServiceImpl extends AbstractSimpleService<SetRoleInput
         final Future<BigInteger> generationFuture = roleService.getGenerationIdFromDevice(getVersion());
 
         return Futures.transformAsync(JdkFutureAdapters.listenInPoolThread(generationFuture), generationId -> {
-            LOG.debug("RoleChangeTask, GenerationIdFromDevice from device {} is {}", getDeviceInfo().getNodeId().getValue(), generationId);
+            LOG.debug("RoleChangeTask, GenerationIdFromDevice from device {} is {}",
+                    getDeviceInfo().getNodeId().getValue(), generationId);
             final BigInteger nextGenerationId = getNextGenerationId(generationId);
-            LOG.debug("nextGenerationId received from device:{} is {}", getDeviceInfo().getNodeId().getValue(), nextGenerationId);
-            final Future<RpcResult<SetRoleOutput>> submitRoleFuture = roleService.submitRoleChange(role, getVersion(), nextGenerationId);
+            LOG.debug("nextGenerationId received from device:{} is {}",
+                    getDeviceInfo().getNodeId().getValue(), nextGenerationId);
+            final Future<RpcResult<SetRoleOutput>> submitRoleFuture =
+                    roleService.submitRoleChange(role, getVersion(), nextGenerationId);
             return JdkFutureAdapters.listenInPoolThread(submitRoleFuture);
         });
     }
index 2bd7c6f26a7adc720287468290330ac6182eab30..0fe78315a604b6997f743df348f298804cd06e0b 100644 (file)
@@ -28,8 +28,13 @@ public final class SalTableServiceImpl implements SalTableService {
                                final DeviceContext deviceContext,
                                final ConvertorExecutor convertorExecutor,
                                final MultipartWriterProvider multipartWriterProvider) {
-        singleLayerService = new SingleLayerTableMultipartService(requestContextStack, deviceContext, multipartWriterProvider);
-        multiLayerService = new MultiLayerTableMultipartService(requestContextStack, deviceContext, convertorExecutor, multipartWriterProvider);
+        singleLayerService = new SingleLayerTableMultipartService(requestContextStack,
+                                                                  deviceContext,
+                                                                  multipartWriterProvider);
+        multiLayerService = new MultiLayerTableMultipartService(requestContextStack,
+                                                                deviceContext,
+                                                                convertorExecutor,
+                                                                multipartWriterProvider);
     }
 
     @Override
@@ -38,5 +43,4 @@ public final class SalTableServiceImpl implements SalTableService {
             ? singleLayerService.handleAndReply(input)
             : multiLayerService.handleAndReply(input);
     }
-
 }
index 4b8fdb65c0426ba8a42d4ca089142d9291bdfcfa..aa36d96cb494c9e7f19ea3cf8944e4a82a5af589 100644 (file)
@@ -38,7 +38,9 @@ public class SingleLayerAggregateFlowMultipartService
     }
 
     @Override
-    protected OfHeader buildRequest(final Xid xid, final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input) throws ServiceException {
+    protected OfHeader buildRequest(final Xid xid,
+                                    final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input)
+                                    throws ServiceException {
         return new MultipartRequestBuilder()
                 .setXid(xid.getValue())
                 .setVersion(getVersion())
@@ -61,7 +63,8 @@ public class SingleLayerAggregateFlowMultipartService
                                         .map(MultipartReply::getMultipartReplyBody)
                                         .filter(MultipartReplyFlowAggregateStats.class::isInstance)
                                         .map(multipartReplyBody ->
-                                                new AggregatedFlowStatisticsBuilder(MultipartReplyFlowAggregateStats.class
+                                                new AggregatedFlowStatisticsBuilder(
+                                                        MultipartReplyFlowAggregateStats.class
                                                         .cast(multipartReplyBody))
                                                         .build())
                                         .collect(Collectors.toList())))
@@ -74,5 +77,4 @@ public class SingleLayerAggregateFlowMultipartService
                     .build();
         });
     }
-
 }
index 01cf3dcae21229ef0c2d34f262e658754f59e83f..f3a55fc508b96a991eacc2ab3565533239f9927a 100644 (file)
@@ -77,19 +77,21 @@ public class SingleLayerExperimenterMultipartService extends AbstractExperimente
                             .build())
                         .build());
                 } else {
-                    LOG.warn("OnSuccess, rpc result unsuccessful, multipart response for rpc sendExperimenterMpRequest was unsuccessful.");
-                    future.set(RpcResultBuilder.<SendExperimenterMpRequestOutput>failed().withRpcErrors(result.getErrors()).build());
+                    LOG.warn("OnSuccess, rpc result unsuccessful,"
+                            + " multipart response for rpc sendExperimenterMpRequest was unsuccessful.");
+                    future.set(RpcResultBuilder.<SendExperimenterMpRequestOutput>failed()
+                            .withRpcErrors(result.getErrors()).build());
                 }
             }
 
             @Override
-            public void onFailure(final Throwable t) {
-                LOG.warn("Failure multipart response for Experimenter-Mp request. Exception: {}", t);
-                future.set(RpcResultBuilder.<SendExperimenterMpRequestOutput>failed().withError(ErrorType.RPC, "Future error", t).build());
+            public void onFailure(final Throwable throwable) {
+                LOG.warn("Failure multipart response for Experimenter-Mp request. Exception: {}", throwable);
+                future.set(RpcResultBuilder.<SendExperimenterMpRequestOutput>failed()
+                        .withError(ErrorType.RPC, "Future error", throwable).build());
             }
         });
 
         return future;
     }
-
 }
index 7744c4d6f288c35732eaa1b66c38d95d5c340dc3..5da63e8b35b42db715d45617190062a15dc54edd 100644 (file)
@@ -19,7 +19,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.M
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 
-public class SingleLayerFlowMultipartRequestOnTheFlyCallback<T extends OfHeader> extends AbstractMultipartRequestOnTheFlyCallback<T> {
+public class SingleLayerFlowMultipartRequestOnTheFlyCallback<T extends OfHeader>
+                                                    extends AbstractMultipartRequestOnTheFlyCallback<T> {
 
     public SingleLayerFlowMultipartRequestOnTheFlyCallback(final RequestContext<List<T>> context,
                                                            final Class<?> requestType,
@@ -44,5 +45,4 @@ public class SingleLayerFlowMultipartRequestOnTheFlyCallback<T extends OfHeader>
     protected MultipartType getMultipartType() {
         return MultipartType.OFPMPFLOW;
     }
-
 }
index 6c924cd5ed403cda78818e30c32c46c2c315810c..4ef795644059ebcb3bc9c4982142f7de8fa56ad0 100644 (file)
@@ -25,7 +25,9 @@ import org.opendaylight.yangtools.yang.binding.DataContainer;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 
 public final class SingleLayerFlowService<O extends DataObject> extends AbstractSilentErrorService<Flow, O> {
-    public SingleLayerFlowService(final RequestContextStack requestContextStack, final DeviceContext deviceContext, final Class<O> clazz) {
+    public SingleLayerFlowService(final RequestContextStack requestContextStack,
+                                  final DeviceContext deviceContext,
+                                  final Class<O> clazz) {
         super(requestContextStack, deviceContext, clazz);
     }
 
@@ -49,5 +51,4 @@ public final class SingleLayerFlowService<O extends DataObject> extends Abstract
                 .setXid(xid.getValue())
                 .build();
     }
-
 }
index 2d1b7837f8eac898b95c648ae1c0887ee6ef4916..320b75e4025766ce7f82006b832fb1613497a27a 100644 (file)
@@ -15,8 +15,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.M
 
 public class SingleLayerMultipartCollectorService extends AbstractMultipartCollectorService<MultipartReply> {
 
-    public SingleLayerMultipartCollectorService(final RequestContextStack requestContextStack, final DeviceContext deviceContext) {
+    public SingleLayerMultipartCollectorService(final RequestContextStack requestContextStack,
+                                                final DeviceContext deviceContext) {
         super(requestContextStack, deviceContext);
     }
-
 }
index 407637ddd03dc25143994bfd48dc93ce1eb95b85..1869715ec964560b010d37219e74b6b4af93e5ff 100644 (file)
@@ -18,7 +18,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 
 public class SingleLayerMultipartRequestCallback<T extends OfHeader> extends AbstractMultipartRequestCallback<T> {
 
-    public SingleLayerMultipartRequestCallback(RequestContext<List<T>> context, Class<?> requestType, DeviceContext deviceContext, EventIdentifier eventIdentifier) {
+    public SingleLayerMultipartRequestCallback(RequestContext<List<T>> context,
+                                               Class<?> requestType,
+                                               DeviceContext deviceContext,
+                                               EventIdentifier eventIdentifier) {
         super(context, requestType, deviceContext, eventIdentifier);
     }
 
@@ -31,5 +34,4 @@ public class SingleLayerMultipartRequestCallback<T extends OfHeader> extends Abs
     protected boolean isReqMore(T result) {
         return MultipartReply.class.cast(result).isRequestMore();
     }
-
 }
index 1818f6cf4f788f48cd8b803b560f861328b7a462..3d08bfd541365ae66f79aec949649bf266aeb80c 100644 (file)
@@ -64,6 +64,7 @@ public class SingleLayerTableMultipartService extends AbstractTableMultipartServ
 
         Futures.addCallback(handleServiceCall(input), new FutureCallback<RpcResult<List<MultipartReply>>>() {
             @Override
+            @SuppressWarnings("checkstyle:IllegalCatch")
             public void onSuccess(final RpcResult<List<MultipartReply>> result) {
                 if (result.isSuccessful()) {
                     final List<MultipartReply> multipartReplies = result.getResult();
@@ -74,7 +75,8 @@ public class SingleLayerTableMultipartService extends AbstractTableMultipartServ
                     } else {
                         finalFuture.set(RpcResultBuilder
                             .success(new UpdateTableOutputBuilder()
-                                .setTransactionId(new TransactionId(BigInteger.valueOf(multipartReplies.get(0).getXid())))
+                                .setTransactionId(
+                                        new TransactionId(BigInteger.valueOf(multipartReplies.get(0).getXid())))
                                 .build())
                             .build());
 
@@ -93,21 +95,21 @@ public class SingleLayerTableMultipartService extends AbstractTableMultipartServ
                         }
                     }
                 } else {
-                    LOG.debug("OnSuccess, rpc result unsuccessful, multipart response for rpc update-table was unsuccessful.");
+                    LOG.debug("OnSuccess, rpc result unsuccessful,"
+                            + " multipart response for rpc update-table was unsuccessful.");
                     finalFuture.set(RpcResultBuilder.<UpdateTableOutput>failed().withRpcErrors(result.getErrors())
                         .build());
                 }
             }
 
             @Override
-            public void onFailure(Throwable t) {
-                LOG.error("Failure multipart response for table features request. Exception: {}", t);
+            public void onFailure(Throwable throwable) {
+                LOG.error("Failure multipart response for table features request. Exception: {}", throwable);
                 finalFuture.set(RpcResultBuilder.<UpdateTableOutput>failed()
-                    .withError(ErrorType.RPC, "Future error", t).build());
+                    .withError(ErrorType.RPC, "Future error", throwable).build());
             }
         });
 
         return finalFuture;
     }
-
 }
\ No newline at end of file
index ebd788404d7fe7efb524084d0357d003d3192791..490e38646b226cb8bba15373e0358d45abd6c8b5 100644 (file)
@@ -23,8 +23,9 @@ public final class RequestContextUtil {
     }
 
 
-    public static <T> ListenableFuture<RpcResult<T>> closeRequestContextWithRpcError(final RequestContext<T> requestContext,
-                                                                                     final String errorMessage) {
+    public static <T> ListenableFuture<RpcResult<T>> closeRequestContextWithRpcError(
+                                                                                final RequestContext<T> requestContext,
+                                                                                final String errorMessage) {
         RpcResultBuilder<T> rpcResultBuilder = RpcResultBuilder.<T>failed().withRpcError(RpcResultBuilder
                 .newError(RpcError.ErrorType.APPLICATION, "", errorMessage));
         requestContext.setResult(rpcResultBuilder.build());
@@ -32,6 +33,7 @@ public final class RequestContextUtil {
         return requestContext.getFuture();
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public static void closeRequestContext(final RequestContext<?> requestContext) {
         try {
             requestContext.close();
index 56c8c12df93e749c98232656ee35fbcbcb089c54..aabd5bf6632a768a36c91dbdaaaf71b5f8c3e1d3 100644 (file)
@@ -9,7 +9,8 @@
 package org.opendaylight.openflowplugin.impl.services.util;
 
 /**
- * Exception thrown by {@link org.opendaylight.openflowplugin.impl.services.AbstractService#buildRequest(org.opendaylight.openflowplugin.api.openflow.device.Xid, Object)}
+ * 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) {
index f4896d5ea5be1b4c3db0a378ad66be96f0a97185..80303a02d79135802a5c297991d2a286fe2d028f 100644 (file)
@@ -71,28 +71,23 @@ public class DeviceInitializationUtil {
      * @param deviceInfo device info
      * @param nrOfTables number of tables
      */
-    @SuppressWarnings("checkstyle:IllegalCatch")
     public static void makeEmptyTables(final TxFacade txFacade, final DeviceInfo deviceInfo, final short nrOfTables) {
         if (LOG.isDebugEnabled()) {
             LOG.debug("About to create {} empty tables for node {}.", nrOfTables, deviceInfo.getLOGValue());
         }
 
         for (int i = 0; i < nrOfTables; i++) {
-            try {
-                txFacade.writeToTransaction(LogicalDatastoreType.OPERATIONAL,
-                        deviceInfo
-                                .getNodeInstanceIdentifier()
-                                .augmentation(FlowCapableNode.class)
-                                .child(Table.class, new TableKey((short) i)),
-                        new TableBuilder()
-                                .setId((short) i)
-                                .addAugmentation(
-                                        FlowTableStatisticsData.class,
-                                        new FlowTableStatisticsDataBuilder().build())
-                                .build());
-            } catch (final Exception e) {
-                LOG.debug("makeEmptyTables: Failed to write node {} to DS ", deviceInfo.getLOGValue(), e);
-            }
+            txFacade.writeToTransaction(LogicalDatastoreType.OPERATIONAL,
+                    deviceInfo
+                            .getNodeInstanceIdentifier()
+                            .augmentation(FlowCapableNode.class)
+                            .child(Table.class, new TableKey((short) i)),
+                    new TableBuilder()
+                            .setId((short) i)
+                            .addAugmentation(
+                                    FlowTableStatisticsData.class,
+                                    new FlowTableStatisticsDataBuilder().build())
+                            .build());
         }
     }
 
index 8f900720de3a212b7b77e1c8ac297cf88587f83e..0eca53826ba4a0af2b2be896d5af8c62b740a7e3 100644 (file)
@@ -28,7 +28,8 @@ public class AbstractRequestCallbackTest {
     private static final Class<?> DUMMY_REQUEST_TYPE = String.class;
     private static final String DUMMY_DEVICE_ID = "DEVICE ID";
     private static final String DUMMY_EVENT_NAME = "EVENT NAME";
-    private static final EventIdentifier DUMMY_EVENT_IDENTIFIER = new EventIdentifier(DUMMY_EVENT_NAME, DUMMY_DEVICE_ID);
+    private static final EventIdentifier DUMMY_EVENT_IDENTIFIER =
+            new EventIdentifier(DUMMY_EVENT_NAME, DUMMY_DEVICE_ID);
     private static final String DUMMY_EXCEPTION_DESCRIPTION = "dummy exception description";
     private static final Long DUMMY_XID = 100L;
     private static final String DUMMY_MESSAGE_ILLEGAL_STATE_EXCEPTION = "dummy illegal state exception";
@@ -49,7 +50,7 @@ public class AbstractRequestCallbackTest {
                 DUMMY_REQUEST_TYPE, new MessageIntelligenceAgencyImpl(),
                 DUMMY_EVENT_IDENTIFIER) {
             @Override
-            public void onSuccess(Object o) {
+            public void onSuccess(Object object) {
 
             }
 
@@ -60,7 +61,8 @@ public class AbstractRequestCallbackTest {
     @Test
     public void testOnFailureWithDeviceRequestFailedException() throws Exception {
         ErrorMessage dummyErrorMessage = new ErrorMessageBuilder().build();
-        abstractRequestCallback.onFailure(new DeviceRequestFailedException(DUMMY_EXCEPTION_DESCRIPTION, dummyErrorMessage));
+        abstractRequestCallback
+                .onFailure(new DeviceRequestFailedException(DUMMY_EXCEPTION_DESCRIPTION, dummyErrorMessage));
         final ListenableFuture futureResult = dummyRequestContext.getFuture();
 
         RpcError rpcError = provideRpcError(futureResult);
@@ -69,16 +71,15 @@ public class AbstractRequestCallbackTest {
 
     @Test
     public void testOnFailure() throws Exception {
-        ErrorMessage dummyErrorMessage = new ErrorMessageBuilder().build();
         abstractRequestCallback.onFailure(new IllegalStateException(DUMMY_MESSAGE_ILLEGAL_STATE_EXCEPTION));
         final ListenableFuture futureResult = dummyRequestContext.getFuture();
 
         RpcError rpcError = provideRpcError(futureResult);
         assertEquals(DUMMY_MESSAGE_ILLEGAL_STATE_EXCEPTION, rpcError.getMessage());
-
     }
 
-    private RpcError provideRpcError(ListenableFuture futureResult) throws InterruptedException, java.util.concurrent.ExecutionException {
+    private RpcError provideRpcError(ListenableFuture futureResult) throws InterruptedException,
+                                                                           java.util.concurrent.ExecutionException {
         final Object result = futureResult.get();
         assertTrue(result instanceof RpcResult);
         RpcResult rpcResult = (RpcResult) result;
@@ -88,6 +89,4 @@ public class AbstractRequestCallbackTest {
         assertTrue(error instanceof RpcError);
         return (RpcError) error;
     }
-
-
 }
index e7b2488f15ea1593c7938bbd1bf4c2965522f215..81c22459b1f1e1f90d19a3c9e65302a1e763de43 100644 (file)
@@ -60,13 +60,14 @@ public class MultipartRequestCallbackTest {
         final OngoingStubbing<MultiMsgCollector<MultipartReply>> when =
             Mockito.when(deviceContext.getMultiMsgCollector(Matchers.any()));
         when.thenReturn(multiMsgCollector);
-        multipartRequestCallback = new MultiLayerMultipartRequestCallback<>(requestContext, MultipartRequestInput.class, deviceContext, null);
+        multipartRequestCallback = new MultiLayerMultipartRequestCallback<>(requestContext,
+                                                                            MultipartRequestInput.class,
+                                                                            deviceContext,
+                                                                            null);
     }
 
     /**
-     * end collecting
-     *
-     * @throws Exception
+     * End collecting.
      */
     @Test
     public void testOnSuccess1() throws Exception {
@@ -75,9 +76,7 @@ public class MultipartRequestCallbackTest {
     }
 
     /**
-     * fail adding to collection
-     *
-     * @throws Exception
+     * Fail adding to collection.
      */
     @Test
     public void testOnSuccess2() throws Exception {
@@ -88,14 +87,13 @@ public class MultipartRequestCallbackTest {
     }
 
     /**
-     * successfully added to collection
-     *
-     * @throws Exception
+     * Successfully added to collection.
      */
     @Test
     public void testOnSuccess3() throws Exception {
         final MultipartReplyMessage replyMessage = new MultipartReplyMessageBuilder().build();
         multipartRequestCallback.onSuccess(replyMessage);
-        Mockito.verify(multiMsgCollector).addMultipartMsg(Matchers.eq(replyMessage), Matchers.eq(false), Matchers.any());
+        Mockito.verify(multiMsgCollector)
+                .addMultipartMsg(Matchers.eq(replyMessage), Matchers.eq(false), Matchers.any());
     }
 }
index f8ecdd4eac7203cb82acacf6a01fc3b7fe035feb..bf4a5bfeba5d09a473431014ac03638199f2339c 100644 (file)
@@ -22,7 +22,6 @@ import com.google.common.util.concurrent.Futures;
 import java.math.BigInteger;
 import java.util.Collections;
 import java.util.List;
-import java.util.concurrent.ExecutionException;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -38,7 +37,6 @@ import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
-import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
 import org.opendaylight.openflowplugin.api.openflow.registry.flow.DeviceFlowRegistry;
 import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowDescriptor;
 import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowRegistryKey;
@@ -91,8 +89,6 @@ public class MultipartRequestOnTheFlyCallbackTest {
     @Mock
     private DeviceContext mockedDeviceContext;
     @Mock
-    private RequestContext<List<MultipartReply>> mockedRequestContext;
-    @Mock
     private ConnectionContext mockedPrimaryConnection;
     @Mock
     private NodeId mockedNodeId;
@@ -138,13 +134,16 @@ public class MultipartRequestOnTheFlyCallbackTest {
         when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
         when(mockedDeviceContext.getDeviceInfo()).thenReturn(mockedDeviceInfo);
         when(mockedDeviceContext.getDeviceFlowRegistry()).thenReturn(mockedFlowRegistry);
-        when(mockedFlowRegistry.retrieveDescriptor(Matchers.any(FlowRegistryKey.class))).thenReturn(mockedFlowDescriptor);
+        when(mockedFlowRegistry.retrieveDescriptor(Matchers.any(FlowRegistryKey.class)))
+                .thenReturn(mockedFlowDescriptor);
 
-        final InstanceIdentifier<FlowCapableNode> nodePath = mockedDeviceInfo.getNodeInstanceIdentifier().augmentation(FlowCapableNode.class);
+        final InstanceIdentifier<FlowCapableNode> nodePath =
+                mockedDeviceInfo.getNodeInstanceIdentifier().augmentation(FlowCapableNode.class);
         final FlowCapableNodeBuilder flowNodeBuilder = new FlowCapableNodeBuilder();
-        flowNodeBuilder.setTable(Collections.<Table> emptyList());
+        flowNodeBuilder.setTable(Collections.<Table>emptyList());
         final Optional<FlowCapableNode> flowNodeOpt = Optional.of(flowNodeBuilder.build());
-        final CheckedFuture<Optional<FlowCapableNode>, ReadFailedException> flowNodeFuture = Futures.immediateCheckedFuture(flowNodeOpt);
+        final CheckedFuture<Optional<FlowCapableNode>, ReadFailedException> flowNodeFuture =
+                Futures.immediateCheckedFuture(flowNodeOpt);
         when(mockedReadOnlyTx.read(LogicalDatastoreType.OPERATIONAL, nodePath)).thenReturn(flowNodeFuture);
         when(mockedDeviceContext.getReadTransaction()).thenReturn(mockedReadOnlyTx);
 
@@ -170,7 +169,8 @@ public class MultipartRequestOnTheFlyCallbackTest {
     @Test
     public void testOnSuccessWithNull() throws Exception {
         multipartRequestOnTheFlyCallback.onSuccess(null);
-        final RpcResult<List<MultipartReply>> expectedRpcResult = RpcResultBuilder.success(Collections.<MultipartReply>emptyList()).build();
+        final RpcResult<List<MultipartReply>> expectedRpcResult =
+                RpcResultBuilder.success(Collections.<MultipartReply>emptyList()).build();
         final RpcResult<List<MultipartReply>> actualResult = dummyRequestContext.getFuture().get();
         assertEquals(expectedRpcResult.getErrors(), actualResult.getErrors());
         assertEquals(expectedRpcResult.getResult(), actualResult.getResult());
@@ -190,21 +190,21 @@ public class MultipartRequestOnTheFlyCallbackTest {
         assertEquals(1, actualResult.getErrors().size());
 
         final RpcError actualError = actualResult.getErrors().iterator().next();
-        assertEquals(actualError.getMessage(), String.format("Unexpected response type received: %s.", mockedHelloMessage.getClass()));
+        assertEquals(actualError.getMessage(),
+                     String.format("Unexpected response type received: %s.",
+                     mockedHelloMessage.getClass()));
         assertEquals(actualError.getErrorType(),RpcError.ErrorType.APPLICATION);
         assertEquals(expectedRpcResult.getResult(), actualResult.getResult());
         assertEquals(expectedRpcResult.isSuccessful(), actualResult.isSuccessful());
 
-        Mockito.verify(mockedDeviceContext, Mockito.never()).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
+        Mockito.verify(mockedDeviceContext, Mockito.never())
+                .writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
                 Matchers.<InstanceIdentifier>any(), Matchers.<DataObject>any());
         Mockito.verify(mockedDeviceContext).submitTransaction();
     }
 
     /**
-     * not the last reply
-     *
-     * @throws ExecutionException
-     * @throws InterruptedException
+     * Not the last reply.
      */
     @Test
     public void testOnSuccessWithValidMultipart1() throws Exception {
@@ -251,10 +251,7 @@ public class MultipartRequestOnTheFlyCallbackTest {
     }
 
     /**
-     * the last reply
-     *
-     * @throws ExecutionException
-     * @throws InterruptedException
+     * The last reply.
      */
     @Test
     public void testOnSuccessWithValidMultipart2() throws Exception {
@@ -270,7 +267,8 @@ public class MultipartRequestOnTheFlyCallbackTest {
         assertNotNull(actualResult.getErrors());
         assertFalse(actualResult.getErrors().isEmpty());
         Mockito.verify(mockedFlowRegistry, Mockito.never()).store(Matchers.any());
-        Mockito.verify(mockedDeviceContext, Mockito.never()).writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
+        Mockito.verify(mockedDeviceContext, Mockito.never())
+                .writeToTransaction(Matchers.eq(LogicalDatastoreType.OPERATIONAL),
                 Matchers.<InstanceIdentifier>any(), Matchers.<DataObject>any());
     }
 }
index fc75bc4029edff52fa89d19b5ab74907003ece17..71d3b210627da3843781f620bb817abdb7f0efb6 100644 (file)
@@ -118,7 +118,8 @@ public abstract class ServiceMocking {
 
         when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockedPrimConnectionContext);
         when(mockedDeviceContext.getMessageSpy()).thenReturn(mockedMessagSpy);
-        when(mockedDeviceContext.getDeviceFlowRegistry()).thenReturn(new DeviceFlowRegistryImpl(DUMMY_VERSION, dataBroker, DUMMY_NODE_II));
+        when(mockedDeviceContext.getDeviceFlowRegistry())
+                .thenReturn(new DeviceFlowRegistryImpl(DUMMY_VERSION, dataBroker, DUMMY_NODE_II));
         when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
         when(mockedDeviceContext.getDeviceInfo()).thenReturn(mockedDeviceInfo);
         when(mockedDeviceContext.getMultiMsgCollector(Matchers.any())).thenReturn(multiMessageCollector);
@@ -131,7 +132,8 @@ public abstract class ServiceMocking {
     }
 
     protected  <T> void mockSuccessfulFuture() {
-        ListenableFuture<RpcResult<T>> dummySuccessfulFuture = Futures.immediateFuture(RpcResultBuilder.success((T) null).build());
+        ListenableFuture<RpcResult<T>> dummySuccessfulFuture =
+                Futures.immediateFuture(RpcResultBuilder.success((T) null).build());
         when(mockedRequestContext.getFuture()).thenReturn(dummySuccessfulFuture);
     }
 
index c604817978f44ee131bbcf25f78ff84448f2c87a..8bb15ded98d68e210c59e26c5762e16b86d77456 100644 (file)
@@ -92,7 +92,8 @@ public class FlatBatchFlowAdaptersTest {
                 createRemoveFlowBatch("1"),
                 createRemoveFlowBatch("2")));
 
-        final RemoveFlowsBatchInput removeFlowsBatchInput = FlatBatchFlowAdapters.adaptFlatBatchRemoveFlow(planStep, NODE_REF);
+        final RemoveFlowsBatchInput removeFlowsBatchInput =
+                FlatBatchFlowAdapters.adaptFlatBatchRemoveFlow(planStep, NODE_REF);
 
         Assert.assertTrue(removeFlowsBatchInput.isBarrierAfter());
         Assert.assertEquals(2, removeFlowsBatchInput.getBatchRemoveFlows().size());
@@ -108,7 +109,8 @@ public class FlatBatchFlowAdaptersTest {
                 createUpdateFlowBatch("1"),
                 createUpdateFlowBatch("2")));
 
-        final UpdateFlowsBatchInput updateFlowsBatchInput = FlatBatchFlowAdapters.adaptFlatBatchUpdateFlow(planStep, NODE_REF);
+        final UpdateFlowsBatchInput updateFlowsBatchInput =
+                FlatBatchFlowAdapters.adaptFlatBatchUpdateFlow(planStep, NODE_REF);
 
         Assert.assertTrue(updateFlowsBatchInput.isBarrierAfter());
         Assert.assertEquals(2, updateFlowsBatchInput.getBatchUpdateFlows().size());
@@ -136,7 +138,9 @@ public class FlatBatchFlowAdaptersTest {
         Assert.assertEquals(2, rpcResult.getResult().getBatchFailure().size());
         Assert.assertEquals(3, rpcResult.getResult().getBatchFailure().get(0).getBatchOrder().intValue());
         Assert.assertEquals(4, rpcResult.getResult().getBatchFailure().get(1).getBatchOrder().intValue());
-        Assert.assertEquals("f2", ((FlatBatchFailureFlowIdCase) rpcResult.getResult().getBatchFailure().get(1).getBatchItemIdChoice()).getFlowId().getValue());
+        Assert.assertEquals("f2",
+                ((FlatBatchFailureFlowIdCase) rpcResult.getResult().getBatchFailure().get(1).getBatchItemIdChoice())
+                        .getFlowId().getValue());
     }
 
     @Test
index 42228173799d9241fd17c0fe99311c0bb4f379d0..98e1374dd4da553555b48b7ee31a9e8c75a389e8 100644 (file)
@@ -60,7 +60,8 @@ public class FlatBatchGroupAdaptersTest {
                 createAddGroupBatch(1L),
                 createAddGroupBatch(2L)));
 
-        final AddGroupsBatchInput addGroupsBatchInput = FlatBatchGroupAdapters.adaptFlatBatchAddGroup(planStep, NODE_REF);
+        final AddGroupsBatchInput addGroupsBatchInput =
+                FlatBatchGroupAdapters.adaptFlatBatchAddGroup(planStep, NODE_REF);
 
         Assert.assertTrue(addGroupsBatchInput.isBarrierAfter());
         Assert.assertEquals(2, addGroupsBatchInput.getBatchAddGroups().size());
@@ -99,12 +100,15 @@ public class FlatBatchGroupAdaptersTest {
                 createRemoveGroupBatch(1L),
                 createRemoveGroupBatch(2L)));
 
-        final RemoveGroupsBatchInput removeGroupsBatchInput = FlatBatchGroupAdapters.adaptFlatBatchRemoveGroup(planStep, NODE_REF);
+        final RemoveGroupsBatchInput removeGroupsBatchInput =
+                FlatBatchGroupAdapters.adaptFlatBatchRemoveGroup(planStep, NODE_REF);
 
         Assert.assertTrue(removeGroupsBatchInput.isBarrierAfter());
         Assert.assertEquals(2, removeGroupsBatchInput.getBatchRemoveGroups().size());
-        Assert.assertEquals(1L, removeGroupsBatchInput.getBatchRemoveGroups().get(0).getGroupId().getValue().longValue());
-        Assert.assertEquals(2L, removeGroupsBatchInput.getBatchRemoveGroups().get(1).getGroupId().getValue().longValue());
+        Assert.assertEquals(1L,
+                removeGroupsBatchInput.getBatchRemoveGroups().get(0).getGroupId().getValue().longValue());
+        Assert.assertEquals(2L,
+                removeGroupsBatchInput.getBatchRemoveGroups().get(1).getGroupId().getValue().longValue());
     }
 
     @Test
@@ -115,12 +119,15 @@ public class FlatBatchGroupAdaptersTest {
                 createUpdateGroupBatch(1L),
                 createUpdateGroupBatch(2L)));
 
-        final UpdateGroupsBatchInput updateGroupsBatchInput = FlatBatchGroupAdapters.adaptFlatBatchUpdateGroup(planStep, NODE_REF);
+        final UpdateGroupsBatchInput updateGroupsBatchInput =
+                FlatBatchGroupAdapters.adaptFlatBatchUpdateGroup(planStep, NODE_REF);
 
         Assert.assertTrue(updateGroupsBatchInput.isBarrierAfter());
         Assert.assertEquals(2, updateGroupsBatchInput.getBatchUpdateGroups().size());
-        Assert.assertEquals(1L, updateGroupsBatchInput.getBatchUpdateGroups().get(0).getUpdatedBatchedGroup().getGroupId().getValue().longValue());
-        Assert.assertEquals(2L, updateGroupsBatchInput.getBatchUpdateGroups().get(1).getUpdatedBatchedGroup().getGroupId().getValue().longValue());
+        Assert.assertEquals(1L, updateGroupsBatchInput.getBatchUpdateGroups().get(0)
+                .getUpdatedBatchedGroup().getGroupId().getValue().longValue());
+        Assert.assertEquals(2L, updateGroupsBatchInput.getBatchUpdateGroups().get(1)
+                .getUpdatedBatchedGroup().getGroupId().getValue().longValue());
     }
 
     @Test
@@ -143,7 +150,8 @@ public class FlatBatchGroupAdaptersTest {
         Assert.assertEquals(2, rpcResult.getResult().getBatchFailure().size());
         Assert.assertEquals(3, rpcResult.getResult().getBatchFailure().get(0).getBatchOrder().intValue());
         Assert.assertEquals(4, rpcResult.getResult().getBatchFailure().get(1).getBatchOrder().intValue());
-        Assert.assertEquals(2L, ((FlatBatchFailureGroupIdCase) rpcResult.getResult().getBatchFailure().get(1).getBatchItemIdChoice()).getGroupId().getValue().longValue());
+        Assert.assertEquals(2L, ((FlatBatchFailureGroupIdCase) rpcResult.getResult().getBatchFailure().get(1)
+                .getBatchItemIdChoice()).getGroupId().getValue().longValue());
     }
 
     @Test
index 7ef5d07adb691cd2014fed8611fac0cbb55d2593..16c5763162eacf3078304663ac2ef22a7bc6c9d4 100644 (file)
@@ -60,7 +60,8 @@ public class FlatBatchMeterAdaptersTest {
                 createAddMeterBatch(1L),
                 createAddMeterBatch(2L)));
 
-        final AddMetersBatchInput addMetersBatchInput = FlatBatchMeterAdapters.adaptFlatBatchAddMeter(planStep, NODE_REF);
+        final AddMetersBatchInput addMetersBatchInput =
+                FlatBatchMeterAdapters.adaptFlatBatchAddMeter(planStep, NODE_REF);
 
         Assert.assertTrue(addMetersBatchInput.isBarrierAfter());
         Assert.assertEquals(2, addMetersBatchInput.getBatchAddMeters().size());
@@ -99,12 +100,15 @@ public class FlatBatchMeterAdaptersTest {
                 createRemoveMeterBatch(1L),
                 createRemoveMeterBatch(2L)));
 
-        final RemoveMetersBatchInput removeMetersBatchInput = FlatBatchMeterAdapters.adaptFlatBatchRemoveMeter(planStep, NODE_REF);
+        final RemoveMetersBatchInput removeMetersBatchInput =
+                FlatBatchMeterAdapters.adaptFlatBatchRemoveMeter(planStep, NODE_REF);
 
         Assert.assertTrue(removeMetersBatchInput.isBarrierAfter());
         Assert.assertEquals(2, removeMetersBatchInput.getBatchRemoveMeters().size());
-        Assert.assertEquals(1L, removeMetersBatchInput.getBatchRemoveMeters().get(0).getMeterId().getValue().longValue());
-        Assert.assertEquals(2L, removeMetersBatchInput.getBatchRemoveMeters().get(1).getMeterId().getValue().longValue());
+        Assert.assertEquals(1L,
+                removeMetersBatchInput.getBatchRemoveMeters().get(0).getMeterId().getValue().longValue());
+        Assert.assertEquals(2L,
+                removeMetersBatchInput.getBatchRemoveMeters().get(1).getMeterId().getValue().longValue());
     }
 
     @Test
@@ -115,12 +119,15 @@ public class FlatBatchMeterAdaptersTest {
                 createUpdateMeterBatch(1L),
                 createUpdateMeterBatch(2L)));
 
-        final UpdateMetersBatchInput updateMetersBatchInput = FlatBatchMeterAdapters.adaptFlatBatchUpdateMeter(planStep, NODE_REF);
+        final UpdateMetersBatchInput updateMetersBatchInput =
+                FlatBatchMeterAdapters.adaptFlatBatchUpdateMeter(planStep, NODE_REF);
 
         Assert.assertTrue(updateMetersBatchInput.isBarrierAfter());
         Assert.assertEquals(2, updateMetersBatchInput.getBatchUpdateMeters().size());
-        Assert.assertEquals(1L, updateMetersBatchInput.getBatchUpdateMeters().get(0).getUpdatedBatchedMeter().getMeterId().getValue().longValue());
-        Assert.assertEquals(2L, updateMetersBatchInput.getBatchUpdateMeters().get(1).getUpdatedBatchedMeter().getMeterId().getValue().longValue());
+        Assert.assertEquals(1L, updateMetersBatchInput.getBatchUpdateMeters().get(0)
+                .getUpdatedBatchedMeter().getMeterId().getValue().longValue());
+        Assert.assertEquals(2L, updateMetersBatchInput.getBatchUpdateMeters().get(1)
+                .getUpdatedBatchedMeter().getMeterId().getValue().longValue());
     }
 
     @Test
@@ -143,7 +150,8 @@ public class FlatBatchMeterAdaptersTest {
         Assert.assertEquals(2, rpcResult.getResult().getBatchFailure().size());
         Assert.assertEquals(3, rpcResult.getResult().getBatchFailure().get(0).getBatchOrder().intValue());
         Assert.assertEquals(4, rpcResult.getResult().getBatchFailure().get(1).getBatchOrder().intValue());
-        Assert.assertEquals(2L, ((FlatBatchFailureMeterIdCase) rpcResult.getResult().getBatchFailure().get(1).getBatchItemIdChoice()).getMeterId().getValue().longValue());
+        Assert.assertEquals(2L, ((FlatBatchFailureMeterIdCase) rpcResult.getResult().getBatchFailure().get(1)
+                .getBatchItemIdChoice()).getMeterId().getValue().longValue());
     }
 
     @Test
index 0cc267318347fffdedef74e8967dcdbe500d4754..d79d1d3bc2c68405979c705cf51d7a203186f905 100644 (file)
@@ -15,7 +15,6 @@ import static org.mockito.Mockito.verify;
 import org.junit.Test;
 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
 import org.opendaylight.openflowplugin.impl.services.ServiceMocking;
-import org.opendaylight.openflowplugin.impl.services.sal.FlowCapableTransactionServiceImpl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
@@ -32,7 +31,8 @@ public class FlowCapableTransactionServiceImplTest extends ServiceMocking {
 
     @Override
     protected void setup() {
-        flowCapableTransactionService = new FlowCapableTransactionServiceImpl(mockedRequestContextStack, mockedDeviceContext);
+        flowCapableTransactionService =
+                new FlowCapableTransactionServiceImpl(mockedRequestContextStack, mockedDeviceContext);
     }
 
     @Test
index e9b1a3c8a4bb866fe2da196b985557a87247d566..6d3523005897b5b79d6aa028ca9cf423513f5adb 100644 (file)
@@ -15,7 +15,6 @@ import static org.mockito.Mockito.verify;
 import org.junit.Test;
 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
 import org.opendaylight.openflowplugin.impl.services.ServiceMocking;
-import org.opendaylight.openflowplugin.impl.services.sal.NodeConfigServiceImpl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.SetConfigInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.module.config.rev141015.SetConfigInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.SwitchConfigFlag;
@@ -41,7 +40,8 @@ public class NodeConfigServiceImplTest extends ServiceMocking {
         nodeConfigService = new NodeConfigServiceImpl(mockedRequestContextStack, mockedDeviceContext);
         final OfHeader request = nodeConfigService.buildRequest(new Xid(DUMMY_XID_VALUE), dummyConfigInput());
 
-        assertTrue(request instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput);
+        assertTrue(request instanceof org.opendaylight.yang.gen.v1.urn
+                .opendaylight.openflow.protocol.rev130731.SetConfigInput);
         org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput setConfigInput
                 = (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput) request;
         assertEquals(DUMMY_FLAG,setConfigInput.getFlags());
@@ -49,7 +49,7 @@ public class NodeConfigServiceImplTest extends ServiceMocking {
         assertEquals(DUMMY_XID_VALUE, setConfigInput.getXid());
     }
 
-    private SetConfigInput dummyConfigInput(){
+    private SetConfigInput dummyConfigInput() {
         SetConfigInputBuilder setConfigInputBuilder = new SetConfigInputBuilder();
         setConfigInputBuilder.setFlag(DUMMY_FLAG_STR);
         setConfigInputBuilder.setMissSearchLength(DUMMY_MISS_SEARCH_LENGTH);
index 01473b12a424fa55df8fe22aa457c2001b64c1f3..74a19aee56bb809f39b2bb1c8d3fe9aed1ef7ec5 100644 (file)
@@ -48,7 +48,8 @@ public class PacketProcessingServiceImplTest extends ServiceMocking {
     @Override
     protected void setup() {
         final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
-        packetProcessingService = new PacketProcessingServiceImpl(mockedRequestContextStack, mockedDeviceContext, convertorManager);
+        packetProcessingService =
+                new PacketProcessingServiceImpl(mockedRequestContextStack, mockedDeviceContext, convertorManager);
         pathToNodeconnector = KeyedInstanceIdentifier.create(Nodes.class)
                 .child(Node.class, new NodeKey(new NodeId("ofp-ut:123")))
                 .child(NodeConnector.class, new NodeConnectorKey(new NodeConnectorId("ofp-ut:123:1")));
index 17197e74337f892c303f4ca7948f3e4aafa04e2d..683abf9093f3721135247adb33b454a8cc603570 100644 (file)
@@ -19,7 +19,6 @@ import org.junit.Test;
 import org.mockito.Matchers;
 import org.mockito.Mockito;
 import org.opendaylight.openflowplugin.impl.services.ServiceMocking;
-import org.opendaylight.openflowplugin.impl.services.sal.SalEchoServiceImpl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.echo.service.rev150305.SendEchoInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.echo.service.rev150305.SendEchoInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.echo.service.rev150305.SendEchoOutput;
@@ -57,6 +56,7 @@ public class SalEchoServiceImplTest extends ServiceMocking {
         Assert.assertTrue(echoOutput.isDone());
         Assert.assertTrue(echoOutput.get().isSuccessful());
         verify(mockedRequestContextStack).createRequestContext();
-        verify(mockedOutboundQueue).commitEntry(Matchers.eq(2121L), Matchers.<OfHeader>any(), Matchers.<FutureCallback<OfHeader>>any());
+        verify(mockedOutboundQueue)
+                .commitEntry(Matchers.eq(2121L), Matchers.<OfHeader>any(), Matchers.<FutureCallback<OfHeader>>any());
     }
 }
index 23d41b8733d2e9576e47424c4edb1096c01b3a0c..f17e82a5498933f533ebca01df8645c95f0d9c45 100644 (file)
@@ -44,7 +44,9 @@ public class SalExperimenterMessageServiceImplTest extends ServiceMocking {
 
     @Override
     protected void setup() {
-        salExperimenterMessageService = new SalExperimenterMessageServiceImpl(mockedRequestContextStack, mockedDeviceContext, extensionConverterProvider);
+        salExperimenterMessageService = new SalExperimenterMessageServiceImpl(mockedRequestContextStack,
+                                                                              mockedDeviceContext,
+                                                                              extensionConverterProvider);
         Mockito.when(extensionConverterProvider.getMessageConverter(Matchers.<TypeVersionKey>any()))
                 .thenReturn(extensionConverter);
         Mockito.when(extensionConverter.getExperimenterId()).thenReturn(new ExperimenterId(43L));
@@ -62,7 +64,8 @@ public class SalExperimenterMessageServiceImplTest extends ServiceMocking {
     public void testBuildRequest() throws Exception {
         SendExperimenterInput sendExperimenterInput = buildSendExperimenterInput();
 
-        final OfHeader request = salExperimenterMessageService.buildRequest(new Xid(DUMMY_XID_VALUE), sendExperimenterInput);
+        final OfHeader request =
+                salExperimenterMessageService.buildRequest(new Xid(DUMMY_XID_VALUE), sendExperimenterInput);
         assertEquals(DUMMY_XID_VALUE, request.getXid());
         assertTrue(request instanceof ExperimenterInput);
         final ExperimenterInput input = (ExperimenterInput) request;
@@ -85,5 +88,4 @@ public class SalExperimenterMessageServiceImplTest extends ServiceMocking {
             return DummyExperimenter.class;
         }
     }
-
 }
index 14df452cb1cb2bcfe538888c34a50685a51927e2..385d3d2e33656f90d2b04aebc7edbdb46eab5ff1 100644 (file)
@@ -125,7 +125,8 @@ public class SalFlatBatchServiceImplTest {
 
     @Before
     public void setUp() throws Exception {
-        salFlatBatchService = new SalFlatBatchServiceImpl(salFlowsBatchService, salGroupsBatchService, salMetersBatchService);
+        salFlatBatchService =
+                new SalFlatBatchServiceImpl(salFlowsBatchService, salGroupsBatchService, salMetersBatchService);
 
     }
 
@@ -176,7 +177,8 @@ public class SalFlatBatchServiceImplTest {
                 .setExitOnFirstError(true)
                 .build();
 
-        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture = salFlatBatchService.processFlatBatch(batchInput);
+        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture =
+                salFlatBatchService.processFlatBatch(batchInput);
         Assert.assertTrue(rpcResultFuture.isDone());
         final RpcResult<ProcessFlatBatchOutput> rpcResult = rpcResultFuture.get();
         Assert.assertTrue(rpcResult.isSuccessful());
@@ -220,7 +222,8 @@ public class SalFlatBatchServiceImplTest {
                 .setExitOnFirstError(true)
                 .build();
 
-        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture = salFlatBatchService.processFlatBatch(batchInput);
+        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture =
+                salFlatBatchService.processFlatBatch(batchInput);
         Assert.assertTrue(rpcResultFuture.isDone());
         final RpcResult<ProcessFlatBatchOutput> rpcResult = rpcResultFuture.get();
         Assert.assertFalse(rpcResult.isSuccessful());
@@ -258,7 +261,8 @@ public class SalFlatBatchServiceImplTest {
                 .setExitOnFirstError(false)
                 .build();
 
-        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture = salFlatBatchService.processFlatBatch(batchInput);
+        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture =
+                salFlatBatchService.processFlatBatch(batchInput);
         Assert.assertTrue(rpcResultFuture.isDone());
         final RpcResult<ProcessFlatBatchOutput> rpcResult = rpcResultFuture.get();
         Assert.assertFalse(rpcResult.isSuccessful());
@@ -437,8 +441,10 @@ public class SalFlatBatchServiceImplTest {
     public void testExecuteBatchPlan() throws Exception {
         BatchStepJob batchStepJob1 = Mockito.mock(BatchStepJob.class);
         BatchStepJob batchStepJob2 = Mockito.mock(BatchStepJob.class);
-        AsyncFunction<RpcResult<ProcessFlatBatchOutput>, RpcResult<ProcessFlatBatchOutput>> function1 = Mockito.mock(AsyncFunction.class);
-        AsyncFunction<RpcResult<ProcessFlatBatchOutput>, RpcResult<ProcessFlatBatchOutput>> function2 = Mockito.mock(AsyncFunction.class);
+        AsyncFunction<RpcResult<ProcessFlatBatchOutput>, RpcResult<ProcessFlatBatchOutput>> function1 =
+                Mockito.mock(AsyncFunction.class);
+        AsyncFunction<RpcResult<ProcessFlatBatchOutput>, RpcResult<ProcessFlatBatchOutput>> function2 =
+                Mockito.mock(AsyncFunction.class);
         Mockito.when(batchStepJob1.getStepFunction()).thenReturn(function1);
         Mockito.when(batchStepJob2.getStepFunction()).thenReturn(function2);
         BatchPlanStep batchPlanStep1 = new BatchPlanStep(BatchStepType.GROUP_ADD);
@@ -448,11 +454,13 @@ public class SalFlatBatchServiceImplTest {
         Mockito.when(batchStepJob1.getPlanStep()).thenReturn(batchPlanStep1);
         Mockito.when(batchStepJob2.getPlanStep()).thenReturn(batchPlanStep2);
 
-        final ListenableFuture<RpcResult<ProcessFlatBatchOutput>> succeededChainOutput = FlatBatchUtil.createEmptyRpcBatchResultFuture(true);
+        final ListenableFuture<RpcResult<ProcessFlatBatchOutput>> succeededChainOutput =
+                FlatBatchUtil.createEmptyRpcBatchResultFuture(true);
         final ListenableFuture<RpcResult<ProcessFlatBatchOutput>> failedChainOutput =
                 RpcResultBuilder.<ProcessFlatBatchOutput>failed()
                         .withError(RpcError.ErrorType.APPLICATION, "ut-chainError")
-                        .withResult(createFlatBatchOutput(createFlowBatchFailure(0, "f1"), createFlowBatchFailure(1, "f2")))
+                        .withResult(createFlatBatchOutput(createFlowBatchFailure(0, "f1"),
+                                    createFlowBatchFailure(1, "f2")))
                         .buildFuture();
 
         Mockito.when(batchStepJob1.getStepFunction().apply(Matchers.<RpcResult<ProcessFlatBatchOutput>>any()))
@@ -461,14 +469,17 @@ public class SalFlatBatchServiceImplTest {
                 .thenReturn(failedChainOutput);
 
         final List<BatchStepJob> batchChainElements = Lists.newArrayList(batchStepJob1, batchStepJob2);
-        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture = salFlatBatchService.executeBatchPlan(batchChainElements);
+        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture =
+                salFlatBatchService.executeBatchPlan(batchChainElements);
 
         Assert.assertTrue(rpcResultFuture.isDone());
         final RpcResult<ProcessFlatBatchOutput> rpcResult = rpcResultFuture.get();
         Assert.assertFalse(rpcResult.isSuccessful());
         Assert.assertEquals(1, rpcResult.getErrors().size());
         Assert.assertEquals(2, rpcResult.getResult().getBatchFailure().size());
-        Assert.assertEquals("f2", ((FlatBatchFailureFlowIdCase) rpcResult.getResult().getBatchFailure().get(1).getBatchItemIdChoice()).getFlowId().getValue());
+        Assert.assertEquals("f2",
+                ((FlatBatchFailureFlowIdCase) rpcResult.getResult().getBatchFailure().get(1).getBatchItemIdChoice())
+                        .getFlowId().getValue());
     }
 
     private BatchFailure createFlowBatchFailure(final int batchOrder, final String flowIdValue) {
@@ -504,7 +515,8 @@ public class SalFlatBatchServiceImplTest {
                         .success(new AddFlowsBatchOutputBuilder().build())
                         .buildFuture());
 
-        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture = salFlatBatchService.executeBatchPlan(batchChain);
+        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture =
+                salFlatBatchService.executeBatchPlan(batchChain);
         Assert.assertTrue(rpcResultFuture.isDone());
         final RpcResult<ProcessFlatBatchOutput> rpcResult = rpcResultFuture.get();
         Assert.assertTrue(rpcResult.isSuccessful());
@@ -545,7 +557,8 @@ public class SalFlatBatchServiceImplTest {
                         .withError(RpcError.ErrorType.APPLICATION, "ut-addFlowBatchError")
                         .buildFuture());
 
-        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture = salFlatBatchService.executeBatchPlan(batchChain);
+        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture =
+                salFlatBatchService.executeBatchPlan(batchChain);
         Assert.assertTrue(rpcResultFuture.isDone());
         final RpcResult<ProcessFlatBatchOutput> rpcResult = rpcResultFuture.get();
         Assert.assertFalse(rpcResult.isSuccessful());
index 528fd6b178b8430c7453b0120bd71e1ebb473a5c..8865220bccdc8e9f5c827b2bc5b286f27d4ab500 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.openflowplugin.impl.services.sal;
 
-
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.when;
@@ -173,7 +172,8 @@ public class SalFlowServiceImplTest extends TestCase {
                 .when(requestContext).getFuture();
 
         mockingFlowRegistryLookup();
-        final Future<RpcResult<AddFlowOutput>> rpcResultFuture = mockSalFlowService(version).addFlow(mockedAddFlowInput);
+        final Future<RpcResult<AddFlowOutput>> rpcResultFuture =
+                mockSalFlowService(version).addFlow(mockedAddFlowInput);
 
         assertNotNull(rpcResultFuture);
         final RpcResult<?> addFlowOutputRpcResult = rpcResultFuture.get();
@@ -200,7 +200,8 @@ public class SalFlowServiceImplTest extends TestCase {
         Mockito.doReturn(Futures.<RequestContext<Object>>immediateFailedFuture(new Exception("ut-failed-response")))
                 .when(requestContext).getFuture();
 
-        final Future<RpcResult<RemoveFlowOutput>> rpcResultFuture = mockSalFlowService(version).removeFlow(mockedRemoveFlowInput);
+        final Future<RpcResult<RemoveFlowOutput>> rpcResultFuture =
+                mockSalFlowService(version).removeFlow(mockedRemoveFlowInput);
 
         assertNotNull(rpcResultFuture);
         final RpcResult<?> removeFlowOutputRpcResult = rpcResultFuture.get();
@@ -214,7 +215,8 @@ public class SalFlowServiceImplTest extends TestCase {
         addFlow(mock(ItemLifecycleListener.class), OFConstants.OFP_VERSION_1_3);
     }
 
-    private void addFlow(final ItemLifecycleListener itemLifecycleListener, short version) throws ExecutionException, InterruptedException {
+    private void addFlow(final ItemLifecycleListener itemLifecycleListener, short version) throws ExecutionException,
+                                                                                                  InterruptedException {
         AddFlowInput mockedAddFlowInput = new AddFlowInputBuilder()
                 .setMatch(match)
                 .setTableId((short)1)
@@ -225,7 +227,8 @@ public class SalFlowServiceImplTest extends TestCase {
         mockingFlowRegistryLookup();
         verifyOutput(salFlowService.addFlow(mockedAddFlowInput));
         if (itemLifecycleListener != null) {
-            Mockito.verify(itemLifecycleListener).onAdded(Matchers.<KeyedInstanceIdentifier<Flow, FlowKey>>any(), Matchers.<Flow>any());
+            Mockito.verify(itemLifecycleListener)
+                    .onAdded(Matchers.<KeyedInstanceIdentifier<Flow, FlowKey>>any(), Matchers.<Flow>any());
         }
     }
 
@@ -292,7 +295,8 @@ public class SalFlowServiceImplTest extends TestCase {
         when(mockedUpdateFlowInput1.getUpdatedFlow()).thenReturn(mockedUpdateFlow1);
 
         FlowRef mockedFlowRef = mock(FlowRef.class);
-        Mockito.doReturn(TABLE_II.child(Flow.class, new FlowKey(new FlowId(DUMMY_FLOW_ID)))).when(mockedFlowRef).getValue();
+        Mockito.doReturn(TABLE_II.child(Flow.class,
+                         new FlowKey(new FlowId(DUMMY_FLOW_ID)))).when(mockedFlowRef).getValue();
         when(mockedUpdateFlowInput.getFlowRef()).thenReturn(mockedFlowRef);
         when(mockedUpdateFlowInput1.getFlowRef()).thenReturn(mockedFlowRef);
 
@@ -320,7 +324,8 @@ public class SalFlowServiceImplTest extends TestCase {
         verifyOutput(salFlowService.updateFlow(mockedUpdateFlowInput1));
 
         if (itemLifecycleListener != null) {
-            Mockito.verify(itemLifecycleListener, times(2)).onUpdated(Matchers.<KeyedInstanceIdentifier<Flow, FlowKey>>any(), Matchers.<Flow>any());
+            Mockito.verify(itemLifecycleListener, times(2))
+                    .onUpdated(Matchers.<KeyedInstanceIdentifier<Flow, FlowKey>>any(), Matchers.<Flow>any());
         }
 
     }
@@ -331,10 +336,12 @@ public class SalFlowServiceImplTest extends TestCase {
         when(mockedFlowDescriptor.getFlowId()).thenReturn(flowId);
         when(mockedFlowDescriptor.getTableKey()).thenReturn(new TableKey(DUMMY_TABLE_ID));
 
-        when(deviceFlowRegistry.retrieveDescriptor(Matchers.any(FlowRegistryKey.class))).thenReturn(mockedFlowDescriptor);
+        when(deviceFlowRegistry
+                .retrieveDescriptor(Matchers.any(FlowRegistryKey.class))).thenReturn(mockedFlowDescriptor);
     }
 
-    private <T extends DataObject> void verifyOutput(Future<RpcResult<T>> rpcResultFuture) throws ExecutionException, InterruptedException {
+    private <T extends DataObject> void verifyOutput(Future<RpcResult<T>> rpcResultFuture) throws ExecutionException,
+                                                                                                  InterruptedException {
         assertNotNull(rpcResultFuture);
         final RpcResult<?> addFlowOutputRpcResult = rpcResultFuture.get();
         assertNotNull(addFlowOutputRpcResult);
index bea9d1c9d8ceba148e3309442b402ebaef11db3b..e3927efea3f17debc732ee93796a528c488ebd20 100644 (file)
@@ -76,7 +76,8 @@ public class SalFlowsBatchServiceImplTest {
 
     public static final NodeId NODE_ID = new NodeId("ut-dummy-node");
     public static final NodeKey NODE_KEY = new NodeKey(NODE_ID);
-    public static final NodeRef NODE_REF = new NodeRef(InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY));
+    public static final NodeRef NODE_REF =
+            new NodeRef(InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY));
 
     @Mock
     private SalFlowService salFlowService;
@@ -239,7 +240,8 @@ public class SalFlowsBatchServiceImplTest {
     @Test
     public void testAddFlowsBatch_failed() throws Exception {
         Mockito.when(salFlowService.addFlow(Matchers.<AddFlowInput>any()))
-                .thenReturn(RpcResultBuilder.<AddFlowOutput>failed().withError(RpcError.ErrorType.APPLICATION, "ut-groupAddError")
+                .thenReturn(RpcResultBuilder
+                        .<AddFlowOutput>failed().withError(RpcError.ErrorType.APPLICATION, "ut-groupAddError")
                         .buildFuture());
 
         final AddFlowsBatchInput input = new AddFlowsBatchInputBuilder()
@@ -255,8 +257,10 @@ public class SalFlowsBatchServiceImplTest {
         Assert.assertTrue(resultFuture.isDone());
         Assert.assertFalse(resultFuture.get().isSuccessful());
         Assert.assertEquals(2, resultFuture.get().getResult().getBatchFailedFlowsOutput().size());
-        Assert.assertEquals(FLOW_ID_VALUE_1, resultFuture.get().getResult().getBatchFailedFlowsOutput().get(0).getFlowId().getValue());
-        Assert.assertEquals(FLOW_ID_VALUE_2, resultFuture.get().getResult().getBatchFailedFlowsOutput().get(1).getFlowId().getValue());
+        Assert.assertEquals(FLOW_ID_VALUE_1,
+                resultFuture.get().getResult().getBatchFailedFlowsOutput().get(0).getFlowId().getValue());
+        Assert.assertEquals(FLOW_ID_VALUE_2,
+                resultFuture.get().getResult().getBatchFailedFlowsOutput().get(1).getFlowId().getValue());
         Assert.assertEquals(2, resultFuture.get().getErrors().size());
 
         final InOrder inOrder = Mockito.inOrder(salFlowService, transactionService);
@@ -304,7 +308,8 @@ public class SalFlowsBatchServiceImplTest {
     @Test
     public void testUpdateFlowsBatch_failure() throws Exception {
         Mockito.when(salFlowService.updateFlow(Matchers.<UpdateFlowInput>any()))
-                .thenReturn(RpcResultBuilder.<UpdateFlowOutput>failed().withError(RpcError.ErrorType.APPLICATION, "ut-flowUpdateError")
+                .thenReturn(RpcResultBuilder.<UpdateFlowOutput>failed()
+                        .withError(RpcError.ErrorType.APPLICATION, "ut-flowUpdateError")
                         .buildFuture());
 
         final UpdateFlowsBatchInput input = new UpdateFlowsBatchInputBuilder()
@@ -321,8 +326,10 @@ public class SalFlowsBatchServiceImplTest {
         Assert.assertFalse(resultFuture.get().isSuccessful());
         Assert.assertFalse(resultFuture.get().isSuccessful());
         Assert.assertEquals(2, resultFuture.get().getResult().getBatchFailedFlowsOutput().size());
-        Assert.assertEquals(FLOW_ID_VALUE_1, resultFuture.get().getResult().getBatchFailedFlowsOutput().get(0).getFlowId().getValue());
-        Assert.assertEquals(FLOW_ID_VALUE_2, resultFuture.get().getResult().getBatchFailedFlowsOutput().get(1).getFlowId().getValue());
+        Assert.assertEquals(FLOW_ID_VALUE_1,
+                resultFuture.get().getResult().getBatchFailedFlowsOutput().get(0).getFlowId().getValue());
+        Assert.assertEquals(FLOW_ID_VALUE_2,
+                resultFuture.get().getResult().getBatchFailedFlowsOutput().get(1).getFlowId().getValue());
         Assert.assertEquals(2, resultFuture.get().getErrors().size());
 
         final InOrder inOrder = Mockito.inOrder(salFlowService, transactionService);
index 551aaf4ad05f6695e5b577ce4da81dd3c3b2f43c..a9b81e510fc232a20e6adf86f9966ca6c8c0e94f 100644 (file)
@@ -77,7 +77,8 @@ public class SalGroupServiceImplTest extends ServiceMocking {
         verify(mockedDeviceGroupRegistry).store(eq(dummyGroupId));
 
         if (itemLifecycleListener != null) {
-            verify(itemLifecycleListener).onAdded(Matchers.<KeyedInstanceIdentifier<Group, GroupKey>>any(),Matchers.<Group>any());
+            verify(itemLifecycleListener)
+                    .onAdded(Matchers.<KeyedInstanceIdentifier<Group, GroupKey>>any(),Matchers.<Group>any());
         }
     }
 
@@ -94,7 +95,8 @@ public class SalGroupServiceImplTest extends ServiceMocking {
     private void updateGroup(final ItemLifecycleListener itemLifecycleListener) {
         final UpdatedGroup updatedGroup = new UpdatedGroupBuilder().setGroupId(new GroupId(DUMMY_GROUP_ID)).build();
         final OriginalGroup originalGroup = new OriginalGroupBuilder().setGroupId(new GroupId(DUMMY_GROUP_ID)).build();
-        final UpdateGroupInput updateGroupInput = new UpdateGroupInputBuilder().setUpdatedGroup(updatedGroup).setOriginalGroup(originalGroup).build();
+        final UpdateGroupInput updateGroupInput =
+                new UpdateGroupInputBuilder().setUpdatedGroup(updatedGroup).setOriginalGroup(originalGroup).build();
 
         this.<UpdateGroupOutput>mockSuccessfulFuture();
 
@@ -104,7 +106,8 @@ public class SalGroupServiceImplTest extends ServiceMocking {
         verify(mockedRequestContextStack).createRequestContext();
 
         if (itemLifecycleListener != null) {
-            verify(itemLifecycleListener).onAdded(Matchers.<KeyedInstanceIdentifier<Group, GroupKey>>any(),Matchers.<Group>any());
+            verify(itemLifecycleListener)
+                    .onAdded(Matchers.<KeyedInstanceIdentifier<Group, GroupKey>>any(),Matchers.<Group>any());
             verify(itemLifecycleListener).onRemoved(Matchers.<KeyedInstanceIdentifier<Group, GroupKey>>any());
         }
     }
index 5341126ba72bfb2bb34c9f0d7bb156f6fbfb46e7..9146fb3a2d8fd0cc22d0a661a2522caf71f62a13 100644 (file)
@@ -23,7 +23,6 @@ import org.mockito.Matchers;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.openflowplugin.impl.services.sal.SalGroupsBatchServiceImpl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput;
@@ -72,7 +71,8 @@ public class SalGroupsBatchServiceImplTest {
 
     public static final NodeId NODE_ID = new NodeId("ut-dummy-node");
     public static final NodeKey NODE_KEY = new NodeKey(NODE_ID);
-    public static final NodeRef NODE_REF = new NodeRef(InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY));
+    public static final NodeRef NODE_REF =
+            new NodeRef(InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY));
 
     @Mock
     private SalGroupService salGroupService;
@@ -151,8 +151,10 @@ public class SalGroupsBatchServiceImplTest {
         Assert.assertTrue(resultFuture.isDone());
         Assert.assertFalse(resultFuture.get().isSuccessful());
         Assert.assertEquals(2, resultFuture.get().getResult().getBatchFailedGroupsOutput().size());
-        Assert.assertEquals(43L, resultFuture.get().getResult().getBatchFailedGroupsOutput().get(0).getGroupId().getValue().longValue());
-        Assert.assertEquals(45L, resultFuture.get().getResult().getBatchFailedGroupsOutput().get(1).getGroupId().getValue().longValue());
+        Assert.assertEquals(43L,
+                resultFuture.get().getResult().getBatchFailedGroupsOutput().get(0).getGroupId().getValue().longValue());
+        Assert.assertEquals(45L,
+                resultFuture.get().getResult().getBatchFailedGroupsOutput().get(1).getGroupId().getValue().longValue());
         Assert.assertEquals(2, resultFuture.get().getErrors().size());
 
 
@@ -200,7 +202,8 @@ public class SalGroupsBatchServiceImplTest {
     @Test
     public void testAddGroupsBatch_failure() throws Exception {
         Mockito.when(salGroupService.addGroup(Mockito.<AddGroupInput>any()))
-                .thenReturn(RpcResultBuilder.<AddGroupOutput>failed().withError(RpcError.ErrorType.APPLICATION, "ut-groupAddError")
+                .thenReturn(RpcResultBuilder.<AddGroupOutput>failed()
+                        .withError(RpcError.ErrorType.APPLICATION, "ut-groupAddError")
                         .buildFuture());
 
         final AddGroupsBatchInput input = new AddGroupsBatchInputBuilder()
@@ -216,8 +219,10 @@ public class SalGroupsBatchServiceImplTest {
         Assert.assertTrue(resultFuture.isDone());
         Assert.assertFalse(resultFuture.get().isSuccessful());
         Assert.assertEquals(2, resultFuture.get().getResult().getBatchFailedGroupsOutput().size());
-        Assert.assertEquals(42L, resultFuture.get().getResult().getBatchFailedGroupsOutput().get(0).getGroupId().getValue().longValue());
-        Assert.assertEquals(43L, resultFuture.get().getResult().getBatchFailedGroupsOutput().get(1).getGroupId().getValue().longValue());
+        Assert.assertEquals(42L,
+                resultFuture.get().getResult().getBatchFailedGroupsOutput().get(0).getGroupId().getValue().longValue());
+        Assert.assertEquals(43L,
+                resultFuture.get().getResult().getBatchFailedGroupsOutput().get(1).getGroupId().getValue().longValue());
         Assert.assertEquals(2, resultFuture.get().getErrors().size());
 
 
@@ -263,7 +268,8 @@ public class SalGroupsBatchServiceImplTest {
     @Test
     public void testRemoveGroupsBatch_failure() throws Exception {
         Mockito.when(salGroupService.removeGroup(Mockito.<RemoveGroupInput>any()))
-                .thenReturn(RpcResultBuilder.<RemoveGroupOutput>failed().withError(RpcError.ErrorType.APPLICATION, "ut-groupRemoveError")
+                .thenReturn(RpcResultBuilder.<RemoveGroupOutput>failed()
+                        .withError(RpcError.ErrorType.APPLICATION, "ut-groupRemoveError")
                         .buildFuture());
 
         final RemoveGroupsBatchInput input = new RemoveGroupsBatchInputBuilder()
@@ -279,8 +285,10 @@ public class SalGroupsBatchServiceImplTest {
         Assert.assertTrue(resultFuture.isDone());
         Assert.assertFalse(resultFuture.get().isSuccessful());
         Assert.assertEquals(2, resultFuture.get().getResult().getBatchFailedGroupsOutput().size());
-        Assert.assertEquals(42L, resultFuture.get().getResult().getBatchFailedGroupsOutput().get(0).getGroupId().getValue().longValue());
-        Assert.assertEquals(43L, resultFuture.get().getResult().getBatchFailedGroupsOutput().get(1).getGroupId().getValue().longValue());
+        Assert.assertEquals(42L,
+                resultFuture.get().getResult().getBatchFailedGroupsOutput().get(0).getGroupId().getValue().longValue());
+        Assert.assertEquals(43L,
+                resultFuture.get().getResult().getBatchFailedGroupsOutput().get(1).getGroupId().getValue().longValue());
         Assert.assertEquals(2, resultFuture.get().getErrors().size());
 
         final InOrder inOrder = Mockito.inOrder(salGroupService, transactionService);
@@ -308,8 +316,10 @@ public class SalGroupsBatchServiceImplTest {
 
     private static BatchUpdateGroups createEmptyBatchUpdateGroup(final long groupIdValue) {
         return new BatchUpdateGroupsBuilder()
-                .setOriginalBatchedGroup(new OriginalBatchedGroupBuilder(createEmptyBatchAddGroup(groupIdValue)).build())
-                .setUpdatedBatchedGroup(new UpdatedBatchedGroupBuilder(createEmptyBatchAddGroup(groupIdValue+1)).build())
+                .setOriginalBatchedGroup(
+                        new OriginalBatchedGroupBuilder(createEmptyBatchAddGroup(groupIdValue)).build())
+                .setUpdatedBatchedGroup(
+                        new UpdatedBatchedGroupBuilder(createEmptyBatchAddGroup(groupIdValue + 1)).build())
                 .build();
     }
 }
index 87a582f162e3ea2d87019c804de550e19b9754b1..a29c25e3d4454732a17b974befe55ffdc7b78d5f 100644 (file)
@@ -77,7 +77,8 @@ public class SalMeterServiceImplTest extends ServiceMocking {
         verify(mockedDeviceMeterRegistry).store(eq(dummyMeterId));
 
         if (itemLifecycleListener != null) {
-            verify(itemLifecycleListener).onAdded(Matchers.<KeyedInstanceIdentifier<Meter, MeterKey>>any(),Matchers.<Meter>any());
+            verify(itemLifecycleListener)
+                    .onAdded(Matchers.<KeyedInstanceIdentifier<Meter, MeterKey>>any(),Matchers.<Meter>any());
         }
     }
 
@@ -92,10 +93,13 @@ public class SalMeterServiceImplTest extends ServiceMocking {
     }
 
     private void updateMeter(final ItemLifecycleListener itemLifecycleListener) throws Exception {
-        final UpdatedMeter dummyUpdatedMeter = new UpdatedMeterBuilder().setMeterId(new MeterId(DUMMY_METTER_ID)).build();
-        final OriginalMeter dummyOriginalMeter = new OriginalMeterBuilder().setMeterId(new MeterId(DUMMY_METTER_ID)).build();
+        final UpdatedMeter dummyUpdatedMeter =
+                new UpdatedMeterBuilder().setMeterId(new MeterId(DUMMY_METTER_ID)).build();
+        final OriginalMeter dummyOriginalMeter =
+                new OriginalMeterBuilder().setMeterId(new MeterId(DUMMY_METTER_ID)).build();
 
-        final UpdateMeterInput updateMeterInput = new UpdateMeterInputBuilder().setUpdatedMeter(dummyUpdatedMeter).setOriginalMeter(dummyOriginalMeter).build();
+        final UpdateMeterInput updateMeterInput = new UpdateMeterInputBuilder()
+                .setUpdatedMeter(dummyUpdatedMeter).setOriginalMeter(dummyOriginalMeter).build();
 
         this.<AddMeterOutput>mockSuccessfulFuture();
 
@@ -105,7 +109,8 @@ public class SalMeterServiceImplTest extends ServiceMocking {
         verify(mockedRequestContextStack).createRequestContext();
 
         if (itemLifecycleListener != null) {
-            verify(itemLifecycleListener).onAdded(Matchers.<KeyedInstanceIdentifier<Meter, MeterKey>>any(),Matchers.<Meter>any());
+            verify(itemLifecycleListener)
+                    .onAdded(Matchers.<KeyedInstanceIdentifier<Meter, MeterKey>>any(),Matchers.<Meter>any());
             verify(itemLifecycleListener).onRemoved(Matchers.<KeyedInstanceIdentifier<Meter, MeterKey>>any());
         }
     }
index 3e8bed9c2a13a84ae18f51cd0b0c3a34606d657f..1524675b2eb9cc11451584017152f1087d3ddfa9 100644 (file)
@@ -23,7 +23,6 @@ import org.mockito.Matchers;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.openflowplugin.impl.services.sal.SalMetersBatchServiceImpl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
@@ -72,7 +71,8 @@ public class SalMetersBatchServiceImplTest {
 
     public static final NodeId NODE_ID = new NodeId("ut-dummy-node");
     public static final NodeKey NODE_KEY = new NodeKey(NODE_ID);
-    public static final NodeRef NODE_REF = new NodeRef(InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY));
+    public static final NodeRef NODE_REF =
+            new NodeRef(InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY));
 
     @Mock
     private SalMeterService salMeterService;
@@ -150,8 +150,10 @@ public class SalMetersBatchServiceImplTest {
         Assert.assertTrue(resultFuture.isDone());
         Assert.assertFalse(resultFuture.get().isSuccessful());
         Assert.assertEquals(2, resultFuture.get().getResult().getBatchFailedMetersOutput().size());
-        Assert.assertEquals(43L, resultFuture.get().getResult().getBatchFailedMetersOutput().get(0).getMeterId().getValue().longValue());
-        Assert.assertEquals(45L, resultFuture.get().getResult().getBatchFailedMetersOutput().get(1).getMeterId().getValue().longValue());
+        Assert.assertEquals(43L,
+                resultFuture.get().getResult().getBatchFailedMetersOutput().get(0).getMeterId().getValue().longValue());
+        Assert.assertEquals(45L,
+                resultFuture.get().getResult().getBatchFailedMetersOutput().get(1).getMeterId().getValue().longValue());
         Assert.assertEquals(2, resultFuture.get().getErrors().size());
 
 
@@ -199,7 +201,8 @@ public class SalMetersBatchServiceImplTest {
     @Test
     public void testAddMetersBatch_failure() throws Exception {
         Mockito.when(salMeterService.addMeter(Mockito.<AddMeterInput>any()))
-                .thenReturn(RpcResultBuilder.<AddMeterOutput>failed().withError(RpcError.ErrorType.APPLICATION, "ut-groupAddError")
+                .thenReturn(RpcResultBuilder.<AddMeterOutput>failed()
+                        .withError(RpcError.ErrorType.APPLICATION, "ut-groupAddError")
                         .buildFuture());
 
         final AddMetersBatchInput input = new AddMetersBatchInputBuilder()
@@ -215,8 +218,10 @@ public class SalMetersBatchServiceImplTest {
         Assert.assertTrue(resultFuture.isDone());
         Assert.assertFalse(resultFuture.get().isSuccessful());
         Assert.assertEquals(2, resultFuture.get().getResult().getBatchFailedMetersOutput().size());
-        Assert.assertEquals(42L, resultFuture.get().getResult().getBatchFailedMetersOutput().get(0).getMeterId().getValue().longValue());
-        Assert.assertEquals(43L, resultFuture.get().getResult().getBatchFailedMetersOutput().get(1).getMeterId().getValue().longValue());
+        Assert.assertEquals(42L,
+                resultFuture.get().getResult().getBatchFailedMetersOutput().get(0).getMeterId().getValue().longValue());
+        Assert.assertEquals(43L,
+                resultFuture.get().getResult().getBatchFailedMetersOutput().get(1).getMeterId().getValue().longValue());
         Assert.assertEquals(2, resultFuture.get().getErrors().size());
 
 
@@ -262,7 +267,8 @@ public class SalMetersBatchServiceImplTest {
     @Test
     public void testRemoveMetersBatch_failure() throws Exception {
         Mockito.when(salMeterService.removeMeter(Mockito.<RemoveMeterInput>any()))
-                .thenReturn(RpcResultBuilder.<RemoveMeterOutput>failed().withError(RpcError.ErrorType.APPLICATION, "ut-groupRemoveError")
+                .thenReturn(RpcResultBuilder.<RemoveMeterOutput>failed()
+                        .withError(RpcError.ErrorType.APPLICATION, "ut-groupRemoveError")
                         .buildFuture());
 
         final RemoveMetersBatchInput input = new RemoveMetersBatchInputBuilder()
@@ -278,8 +284,10 @@ public class SalMetersBatchServiceImplTest {
         Assert.assertTrue(resultFuture.isDone());
         Assert.assertFalse(resultFuture.get().isSuccessful());
         Assert.assertEquals(2, resultFuture.get().getResult().getBatchFailedMetersOutput().size());
-        Assert.assertEquals(42L, resultFuture.get().getResult().getBatchFailedMetersOutput().get(0).getMeterId().getValue().longValue());
-        Assert.assertEquals(43L, resultFuture.get().getResult().getBatchFailedMetersOutput().get(1).getMeterId().getValue().longValue());
+        Assert.assertEquals(42L,
+                resultFuture.get().getResult().getBatchFailedMetersOutput().get(0).getMeterId().getValue().longValue());
+        Assert.assertEquals(43L,
+                resultFuture.get().getResult().getBatchFailedMetersOutput().get(1).getMeterId().getValue().longValue());
         Assert.assertEquals(2, resultFuture.get().getErrors().size());
 
         final InOrder inOrder = Mockito.inOrder(salMeterService, transactionService);
@@ -307,8 +315,10 @@ public class SalMetersBatchServiceImplTest {
 
     private static BatchUpdateMeters createEmptyBatchUpdateMeter(final long groupIdValue) {
         return new BatchUpdateMetersBuilder()
-                .setOriginalBatchedMeter(new OriginalBatchedMeterBuilder(createEmptyBatchAddMeter(groupIdValue)).build())
-                .setUpdatedBatchedMeter(new UpdatedBatchedMeterBuilder(createEmptyBatchAddMeter(groupIdValue + 1)).build())
+                .setOriginalBatchedMeter(
+                        new OriginalBatchedMeterBuilder(createEmptyBatchAddMeter(groupIdValue)).build())
+                .setUpdatedBatchedMeter(
+                        new UpdatedBatchedMeterBuilder(createEmptyBatchAddMeter(groupIdValue + 1)).build())
                 .build();
     }
 }
index 8533623626d1b6d4faa83f46df9468e2061d2fe7..d026b4e5429fed1574aa06147c1bfc8c92752517 100644 (file)
@@ -55,11 +55,14 @@ public class SalPortServiceImplTest extends ServiceMocking {
         final OfHeader ofHeader = salPortService.buildRequest(new Xid(DUMMY_XID), dummyUpdatePortInput());
     }
 
-    private UpdatePortInput dummyUpdatePortInput(){
-        org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder concretePortBuilder
-                = new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder();
+    private UpdatePortInput dummyUpdatePortInput() {
+        org.opendaylight.yang.gen.v1.urn
+                .opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder concretePortBuilder
+                = new org.opendaylight.yang.gen.v1.urn
+                .opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder();
         concretePortBuilder.setConfiguration(new PortConfig(true, true, true, true));
-        concretePortBuilder.setAdvertisedFeatures(new PortFeatures(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true));
+        concretePortBuilder.setAdvertisedFeatures(new PortFeatures(true, true, true, true, true, true, true, true,
+                true, true, true, true, true, true, true, true));
         concretePortBuilder.setPortNumber(new PortNumberUni(DUMMY_PORT_NUMBER));
         concretePortBuilder.setHardwareAddress(new MacAddress(DUMMY_MAC_ADDRESS));
 
index 5a2a174e67dbb4c6aacb3363fb47ffc388e760a9..1209558252576ba06932a73c73aa5ff1df8155a5 100644 (file)
@@ -20,7 +20,6 @@ import org.junit.Test;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
-import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
 import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueue;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -49,9 +48,6 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 
-/**
- * Created by kramesha on 8/27/15.
- */
 public class SalRoleServiceImplTest {
 
     @Mock
@@ -60,9 +56,6 @@ public class SalRoleServiceImplTest {
     @Mock
     private DeviceContext mockDeviceContext;
 
-    @Mock
-    private ConnectionAdapter mockConnectionAdapter;
-
     @Mock
     private FeaturesReply mockFeaturesReply;
 
@@ -93,10 +86,10 @@ public class SalRoleServiceImplTest {
 
     private static long testXid = 100L;
 
-    private static final String ROLEREQUESTFAILED =
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ErrorType.ROLEREQUESTFAILED.name();
+    private static final String ROLEREQUESTFAILED = org.opendaylight.yang.gen.v1.urn
+            .opendaylight.openflow.common.types.rev130731.ErrorType.ROLEREQUESTFAILED.name();
 
-    private static final String ROLES_UNSUPPORTED = "Device reported error type "+ ROLEREQUESTFAILED +" code UNSUP";
+    private static final String ROLES_UNSUPPORTED = "Device reported error type " + ROLEREQUESTFAILED + " code UNSUP";
 
     private NodeRef nodeRef;
 
@@ -116,7 +109,8 @@ public class SalRoleServiceImplTest {
         Mockito.when(mockRequestContextStack.<RoleRequestOutput>createRequestContext()).thenReturn(mockRequestContext);
         Mockito.when(mockRequestContext.getXid()).thenReturn(new Xid(testXid));
         Mockito.when(mockConnectionContext.getOutboundQueueProvider()).thenReturn(mockOutboundQueue);
-        Mockito.when(mockDeviceContext.getPrimaryConnectionContext().getConnectionState()).thenReturn(ConnectionContext.CONNECTION_STATE.WORKING);
+        Mockito.when(mockDeviceContext.getPrimaryConnectionContext().getConnectionState())
+                .thenReturn(ConnectionContext.CONNECTION_STATE.WORKING);
 
         NodeKey key = new NodeKey(testNodeId);
         InstanceIdentifier<Node> path = InstanceIdentifier.<Nodes>builder(Nodes.class)
index 1810e8b429f91833b4a8d8cfc0c04aefb5165cdb..9563c89cba011af08e82d5a1c05ec146e1c76f49 100644 (file)
@@ -12,7 +12,6 @@ import static org.mockito.Mockito.when;
 
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.SettableFuture;
-import java.math.BigInteger;
 import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
@@ -25,7 +24,6 @@ import org.mockito.Mockito;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier;
 import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProviderFactory;
 import org.opendaylight.openflowplugin.impl.services.ServiceMocking;
@@ -49,10 +47,6 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 
 public class SalTableServiceImplTest extends ServiceMocking {
 
-    private static final BigInteger DUMMY_DATAPATH_ID = new BigInteger("444");
-    private static final Short DUMMY_VERSION = OFConstants.OFP_VERSION_1_3;
-    private static final int DUMMY_MAX_REQUEST = 88;
-
     @Mock
     RpcProviderRegistry mockedRpcProviderRegistry;
 
@@ -84,7 +78,8 @@ public class SalTableServiceImplTest extends ServiceMocking {
         Mockito.doAnswer(new Answer<Void>() {
             @Override
             public Void answer(InvocationOnMock invocation) throws Throwable {
-                final RpcResult<List<MultipartReply>> rpcResult = RpcResultBuilder.<List<MultipartReply>>failed().build();
+                final RpcResult<List<MultipartReply>> rpcResult =
+                        RpcResultBuilder.<List<MultipartReply>>failed().build();
                 handleResultFuture.set(rpcResult);
                 return null;
             }
@@ -100,7 +95,8 @@ public class SalTableServiceImplTest extends ServiceMocking {
         Mockito.doAnswer(new Answer<Void>() {
             @Override
             public Void answer(InvocationOnMock invocation) throws Throwable {
-                final RpcResult<List<MultipartReply>> rpcResult = RpcResultBuilder.success(Collections.<MultipartReply>emptyList())
+                final RpcResult<List<MultipartReply>> rpcResult =
+                        RpcResultBuilder.success(Collections.<MultipartReply>emptyList())
                         .build();
                 handleResultFuture.set(rpcResult);
                 return null;
index 8ef70a16035a7bc1931020e39756eed9fd593cdf..64f7dec7ea539448b782bb8a8448780d77d68173 100644 (file)
@@ -69,8 +69,8 @@ public class SingleLayerAggregateFlowMultipartServiceTest extends ServiceMocking
         final Future<RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>> rpcResultFuture = service
                 .handleAndReply(input);
 
-        final RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput> sendAggregateFlowMpRequestOutputRpcResult =
-                rpcResultFuture.get();
+        final RpcResult<GetAggregateFlowStatisticsFromFlowTableForGivenMatchOutput>
+                sendAggregateFlowMpRequestOutputRpcResult = rpcResultFuture.get();
 
         assertEquals(BYTE_COUNT, sendAggregateFlowMpRequestOutputRpcResult
                 .getResult()