Fix codestyle 83/62883/2
authorJozef Bacigal <jozef.bacigal@pantheon.tech>
Fri, 8 Sep 2017 08:35:39 +0000 (10:35 +0200)
committerJozef Bacigal <jozef.bacigal@pantheon.tech>
Fri, 8 Sep 2017 08:57:45 +0000 (08:57 +0000)
- Removed deprecated getLOGValue from deviceInfo

See also:Bug-8607

Change-Id: Ic9c11ea6e2ace4e802ddc8dd3e2445655e2a57fd
Signed-off-by: Jozef Bacigal <jozef.bacigal@pantheon.tech>
12 files changed:
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/common/MultipartReplyTranslatorUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/TransactionChainManager.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/initialization/AbstractDeviceInitializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/initialization/OF13DeviceInitializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractMultipartRequestOnTheFlyCallback.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsGatheringUtils.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/util/DeviceInitializationUtil.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/device/DeviceManagerImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/statistics/MultipartReplyTranslatorTest.java

index d046883da9590258866bff23315c6c6d90a7140c..67fa6fac2459bbeef60578e71b700e07319c5dbf 100644 (file)
@@ -181,7 +181,7 @@ public class MultipartReplyTranslatorUtil {
                 .MultipartReply.class.cast(message).getMultipartReplyBody());
         }
 
-        LOG.debug("Failed to translate {} for node {}.", message.getImplementedInterface(), deviceInfo.getLOGValue());
+        LOG.debug("Failed to translate {} for node {}.", message.getImplementedInterface(), deviceInfo);
         return Optional.empty();
     }
 
index 0ba9468a74f6ab712bef5a6a7044e67b23a64922..0630f8bae4858623b496174c2e3a004ef98b0160 100644 (file)
@@ -349,7 +349,7 @@ public class DeviceContextImpl implements DeviceContext, ExtensionConverterProvi
                 submitTransaction();
             } catch (final Exception e) {
                 LOG.warn("Error processing port status message for port {} on device {}",
-                        portStatus.getPortNo(), getDeviceInfo().getLOGValue(), e);
+                        portStatus.getPortNo(), getDeviceInfo(), e);
             }
         } else if (!hasState.get()) {
             primaryConnectionContext.handlePortStatusMessage(portStatus);
@@ -680,7 +680,7 @@ public class DeviceContextImpl implements DeviceContext, ExtensionConverterProvi
     void lazyTransactionManagerInitialization() {
         if (!this.initialized.get()) {
             if (LOG.isDebugEnabled()) {
-                LOG.debug("Transaction chain manager for node {} created", deviceInfo.getLOGValue());
+                LOG.debug("Transaction chain manager for node {} created", deviceInfo);
             }
             this.transactionChainManager = new TransactionChainManager(dataBroker, deviceInfo);
             this.deviceFlowRegistry = new DeviceFlowRegistryImpl(deviceInfo.getVersion(), dataBroker, deviceInfo
@@ -749,7 +749,7 @@ public class DeviceContextImpl implements DeviceContext, ExtensionConverterProvi
                         .count();
 
                 LOG.debug("Finished filling flow registry with {} flows for node: {}", flowCount, deviceInfo
-                        .getLOGValue());
+                        );
             }
             this.contextChainMastershipWatcher.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState
                     .INITIAL_FLOW_REGISTRY_FILL);
@@ -759,11 +759,11 @@ public class DeviceContextImpl implements DeviceContext, ExtensionConverterProvi
         public void onFailure(Throwable throwable) {
             if (deviceFlowRegistryFill.isCancelled()) {
                 if (LOG.isDebugEnabled()) {
-                    LOG.debug("Cancelled filling flow registry with flows for node: {}", deviceInfo.getLOGValue());
+                    LOG.debug("Cancelled filling flow registry with flows for node: {}", deviceInfo);
                 }
             } else {
                 LOG.warn("Failed filling flow registry with flows for node: {} with exception: {}", deviceInfo
-                        .getLOGValue(), throwable);
+                        , throwable);
             }
             contextChainMastershipWatcher.onNotAbleToStartMastership(
                     deviceInfo,
index 38a9d7a8ea135f2496c1f5633c207652e3b097d9..e06fbd2f2910ed6224ee8cd3119443282e6a3a15 100644 (file)
@@ -70,7 +70,7 @@ class TransactionChainManager implements TransactionChainListener, AutoCloseable
     TransactionChainManager(@Nonnull final DataBroker dataBroker,
                             @Nonnull final DeviceInfo deviceInfo) {
         this.dataBroker = dataBroker;
-        this.nodeId = deviceInfo.getLOGValue();
+        this.nodeId = deviceInfo.toString();
         this.lastSubmittedFuture = Futures.immediateFuture(null);
     }
 
index 7fad99e45ef0d18e8f8be3af7ff45b2aca1b6984..f07ca2f0cf7f997bfd37492201c24a67d082f64f 100644 (file)
@@ -45,7 +45,7 @@ public abstract class AbstractDeviceInitializer {
         Preconditions.checkNotNull(deviceContext);
 
         // Write node to datastore
-        LOG.debug("Initializing node information for node {}", deviceContext.getDeviceInfo().getLOGValue());
+        LOG.debug("Initializing node information for node {}", deviceContext.getDeviceInfo());
         try {
             deviceContext.writeToTransaction(LogicalDatastoreType.OPERATIONAL, deviceContext
                     .getDeviceInfo()
index 3d5b60b4074b906beb666a24d0894d0d7e7f78bc..040baf299caa6fbd4761806fa86a513a856dfd3f 100644 (file)
@@ -58,7 +58,7 @@ public class OF13DeviceInitializer extends AbstractDeviceInitializer {
         final DeviceState deviceState = Preconditions.checkNotNull(deviceContext.getDeviceState());
         final DeviceInfo deviceInfo = Preconditions.checkNotNull(deviceContext.getDeviceInfo());
         final Capabilities capabilities = connectionContext.getFeatures().getCapabilities();
-        LOG.debug("Setting capabilities for device {}", deviceInfo.getLOGValue());
+        LOG.debug("Setting capabilities for device {}", deviceInfo);
         DeviceStateUtil.setDeviceStateBasedOnV13Capabilities(deviceState, capabilities);
 
         // First process description reply, write data to DS and write consequent data if successful
@@ -89,7 +89,7 @@ public class OF13DeviceInitializer extends AbstractDeviceInitializer {
                         @Override
                         public Void apply(@Nullable final List<RpcResult<List<OfHeader>>> input) {
                             LOG.info("Static node {} successfully finished collecting",
-                                    deviceContext.getDeviceInfo().getLOGValue());
+                                    deviceContext.getDeviceInfo());
                             return null;
                         }
                     });
@@ -140,7 +140,7 @@ public class OF13DeviceInitializer extends AbstractDeviceInitializer {
             @Override
             public void onSuccess(final RpcResult<List<OfHeader>> result) {
                 if (Objects.nonNull(result.getResult())) {
-                    LOG.info("Static node {} info: {} collected", deviceContext.getDeviceInfo().getLOGValue(), type);
+                    LOG.info("Static node {} info: {} collected", deviceContext.getDeviceInfo(), type);
                     translateAndWriteResult(
                         type,
                         result.getResult(),
@@ -169,7 +169,7 @@ public class OF13DeviceInitializer extends AbstractDeviceInitializer {
             @Override
             public void onFailure(@Nonnull final Throwable throwable) {
                 LOG.warn("Request of type {} for static info of node {} failed.",
-                        type, deviceContext.getDeviceInfo().getLOGValue());
+                        type, deviceContext.getDeviceInfo());
             }
         });
     }
@@ -218,11 +218,11 @@ public class OF13DeviceInitializer extends AbstractDeviceInitializer {
                         });
                 });
             } catch (final Exception e) {
-                LOG.warn("Failed to write node {} to DS ", deviceContext.getDeviceInfo().getLOGValue(), e);
+                LOG.warn("Failed to write node {} to DS ", deviceContext.getDeviceInfo(), e);
             }
         } else {
             LOG.warn("Failed to write node {} to DS because we failed to gather device info.",
-                deviceContext.getDeviceInfo().getLOGValue());
+                deviceContext.getDeviceInfo());
         }
     }
 
index d8cc351b329af4dbc55b94806cf410247a274db4..f5794de7a772cc16363854ed1bc17f57938823b4 100644 (file)
@@ -84,7 +84,7 @@ public class RpcManagerImpl implements RpcManager {
     public void onDeviceRemoved(final DeviceInfo deviceInfo) {
         contexts.remove(deviceInfo);
         if (LOG.isDebugEnabled()) {
-            LOG.debug("Rpc context removed for node {}", deviceInfo.getLOGValue());
+            LOG.debug("Rpc context removed for node {}", deviceInfo);
         }
     }
 }
index a1b5e19d7d11e95f39dda3e7201eca813d45b985..6da5d83fd17ba9e86a4f2d244ea3d2f7785e8753 100644 (file)
@@ -96,7 +96,7 @@ public abstract class AbstractMultipartRequestOnTheFlyCallback<T extends OfHeade
                                         .ifPresent(writer -> writer.write(reply, false));
                             } catch (final Exception ex) {
                                 LOG.warn("Stats processing of type {} for node {} failed during write-to-tx step",
-                                        getMultipartType(), deviceInfo.getLOGValue(), ex);
+                                        getMultipartType(), deviceInfo, ex);
                             }
                         });
             } catch (final Exception ex) {
index 0d219eb42f25af3233d711f4977bc27e991bcbaf..e7ebc7c1be9737bc31e558b028266c9ee281828f 100644 (file)
@@ -265,7 +265,7 @@ class StatisticsContextImpl<T extends OfHeader> implements StatisticsContext {
         }
 
         return Futures.transformAsync(prevFuture, result -> {
-            LOG.debug("Status of previous stat iteration for node {}: {}", deviceInfo.getLOGValue(), result);
+            LOG.debug("Status of previous stat iteration for node {}: {}", deviceInfo, result);
             LOG.debug("Stats iterating to next type for node {} of type {}", deviceInfo, multipartType);
             final boolean onTheFly = MultipartType.OFPMPFLOW.equals(multipartType);
             final boolean supported = collectingStatType.contains(multipartType);
index 1183ff051a5881b03504a5811be0cd9f35ab3a5c..2c13b485f1b657b8c0c6f75d7b2ff3b1f7ab4e1b 100644 (file)
@@ -112,7 +112,7 @@ public final class StatisticsGatheringUtils {
                                 } catch (final Exception e) {
                                     LOG.warn("Stats processing of type {} for node {} "
                                                     + "failed during transformation step",
-                                            type, deviceInfo.getLOGValue(), e);
+                                            type, deviceInfo, e);
                                     return Futures.immediateFailedFuture(e);
                                 }
 
@@ -189,7 +189,7 @@ public final class StatisticsGatheringUtils {
         }
 
         LOG.warn("Stats processing of type {} for node {} "
-                + "failed during write-to-tx step", type, deviceInfo.getLOGValue());
+                + "failed during write-to-tx step", type, deviceInfo);
         return false;
     }
 
@@ -210,7 +210,7 @@ public final class StatisticsGatheringUtils {
             }));
         } catch (final Exception ex) {
             LOG.warn("Stats processing of type {} for node {} "
-                    + "failed during write-to-tx step", type, deviceInfo.getLOGValue(), ex);
+                    + "failed during write-to-tx step", type, deviceInfo, ex);
         }
 
         return result.get();
index 80303a02d79135802a5c297991d2a286fe2d028f..9c50540d5ca6688f8aee1c7ae726dfcb6dfe8ac8 100644 (file)
@@ -73,7 +73,7 @@ public class DeviceInitializationUtil {
      */
     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());
+            LOG.debug("About to create {} empty tables for node {}.", nrOfTables, deviceInfo);
         }
 
         for (int i = 0; i < nrOfTables; i++) {
index fbb1165834b90131d4708b36381d46b107dbe106..dd106cbb330e8031cdf9631334d3b60453f8d282 100644 (file)
@@ -168,7 +168,7 @@ public class DeviceManagerImplTest {
     public void removeDeviceFromOperationalDSException() throws Exception {
         final CheckedFuture<Void, TransactionCommitFailedException> failedFuture =
                 Futures.immediateFailedCheckedFuture(
-                        new TransactionCommitFailedException("Test failed transaction", null, null));
+                        new TransactionCommitFailedException("Test failed transaction"));
         Mockito.when(writeTransaction.submit()).thenReturn(failedFuture);
         final ListenableFuture<Void> future = deviceManager
                 .removeDeviceFromOperationalDS(DUMMY_IDENTIFIER);
index a61a3068d2d69fbdd059d5a6fb26dbf1fa958e0a..f6089fcfeff06c05fce8e0f98c900ad79401d1e1 100644 (file)
@@ -304,7 +304,6 @@ public class MultipartReplyTranslatorTest {
         DeviceInfo deviceInfo = mock(DeviceInfo.class);
         when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
         when(deviceInfo.getDatapathId()).thenReturn(DUMMY_DATAPATH_ID);
-        when(deviceInfo.getLOGValue()).thenReturn(DUMMY_DATAPATH_ID.toString());
         when(mockedDeviceContext.getDeviceInfo()).thenReturn(deviceInfo);
 
         when(mockedConnectionContext.getFeatures()).thenReturn(mockedFeaturesReply);