From 82bed7e296d006a1cde98c8ad62dba4218778622 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 24 Aug 2020 11:20:28 +0200 Subject: [PATCH] Make methods static There is a number of methods which do not touch object state, hence can be made static. Eliminate eclipse warnings by making them static. Change-Id: I6a714df82867c2e0bc303affba6be47fa7da999a Signed-off-by: Robert Varga --- .../HwvtepDataChangeListener.java | 14 ++--- .../HwvtepOperGlobalListener.java | 8 +-- .../TransactionHistoryCmd.java | 2 +- .../cli/HwvtepCacheDisplayCmd.java | 23 ++++---- .../HwvtepReconciliationManager.java | 4 +- .../transact/LogicalRouterUpdateCommand.java | 4 +- .../LogicalSwitchUcastsRemoveCommand.java | 2 +- .../McastMacsRemoteUpdateCommand.java | 6 +- .../transact/PhysicalPortUpdateCommand.java | 3 +- .../transact/PhysicalSwitchRemoveCommand.java | 2 +- .../transact/TransactCommandAggregator.java | 25 +++++---- .../md/HwvtepLogicalRouterUpdateCommand.java | 8 +-- .../md/HwvtepMacEntriesRemoveCommand.java | 2 +- .../HwvtepPhysicalLocatorUpdateCommand.java | 4 +- .../md/HwvtepPhysicalSwitchUpdateCommand.java | 8 +-- .../md/HwvtepTunnelUpdateCommand.java | 8 +-- .../HwvtepOperationalDataChangeListener.java | 10 ++-- .../TransactionInvokerImplTest.java | 2 +- .../southbound/OvsdbOperGlobalListener.java | 19 +++---- .../ovsdb/southbound/SouthboundProvider.java | 2 +- .../SouthboundProviderConfigurator.java | 10 ++-- .../transact/AutoAttachRemovedCommand.java | 8 +-- .../transact/AutoAttachUpdateCommand.java | 2 +- .../ovsdb/transact/QosUpdateCommand.java | 2 +- .../TerminationPointCreateCommand.java | 33 ++++++----- .../reconciliation/ReconciliationManager.java | 4 +- .../md/OpenVSwitchUpdateCommand.java | 10 ++-- .../md/OvsdbAutoAttachRemovedCommand.java | 2 +- .../md/OvsdbAutoAttachUpdateCommand.java | 2 +- .../md/OvsdbControllerRemovedCommand.java | 8 +-- .../md/OvsdbPortUpdateCommand.java | 18 +++--- .../md/OvsdbQosUpdateCommand.java | 14 ++--- .../md/OvsdbQueueUpdateCommand.java | 12 ++-- .../transact/ProtocolRemovedCommandTest.java | 2 +- .../TerminationPointCreateCommandTest.java | 2 +- .../ovsdb/transact/TransactUtilsTest.java | 2 +- .../BridgeConfigReconciliationTaskTest.java | 2 +- .../ovsdb/southbound/it/SouthboundIT.java | 56 +++++++++---------- .../southbound/utils/SouthboundUtils.java | 2 +- 39 files changed, 167 insertions(+), 180 deletions(-) diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepDataChangeListener.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepDataChangeListener.java index 232fdf56f..a7d583c44 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepDataChangeListener.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepDataChangeListener.java @@ -179,21 +179,21 @@ public class HwvtepDataChangeListener implements ClusteredDataTreeChangeListener } } - private Node getCreated(DataObjectModification mod) { + private static Node getCreated(DataObjectModification mod) { if (mod.getModificationType() == ModificationType.WRITE && mod.getDataBefore() == null) { return mod.getDataAfter(); } return null; } - private Node getRemoved(DataObjectModification mod) { + private static Node getRemoved(DataObjectModification mod) { if (mod.getModificationType() == ModificationType.DELETE) { return mod.getDataBefore(); } return null; } - private Node getUpdated(DataObjectModification mod) { + private static Node getUpdated(DataObjectModification mod) { Node node = null; switch (mod.getModificationType()) { case SUBTREE_MODIFIED: @@ -210,7 +210,7 @@ public class HwvtepDataChangeListener implements ClusteredDataTreeChangeListener return node; } - private Node getOriginal(DataObjectModification mod) { + private static Node getOriginal(DataObjectModification mod) { Node node = null; switch (mod.getModificationType()) { case SUBTREE_MODIFIED: @@ -228,12 +228,10 @@ public class HwvtepDataChangeListener implements ClusteredDataTreeChangeListener return node; } - private InstanceIdentifier getWildcardPath() { - InstanceIdentifier path = InstanceIdentifier - .create(NetworkTopology.class) + private static InstanceIdentifier getWildcardPath() { + return InstanceIdentifier.create(NetworkTopology.class) .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID)) .child(Node.class); - return path; } private Map>> changesByConnectionInstance( diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepOperGlobalListener.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepOperGlobalListener.java index 67e7cdac7..59356e471 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepOperGlobalListener.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepOperGlobalListener.java @@ -130,7 +130,7 @@ public class HwvtepOperGlobalListener implements ClusteredDataTreeChangeListener } } - private void connect(Collection> changes) { + private static void connect(Collection> changes) { changes.forEach((change) -> { InstanceIdentifier key = change.getRootPath().getRootIdentifier(); DataObjectModification mod = change.getRootNode(); @@ -158,7 +158,7 @@ public class HwvtepOperGlobalListener implements ClusteredDataTreeChangeListener }); } - private void updated(Collection> changes) { + private static void updated(Collection> changes) { changes.forEach((change) -> { InstanceIdentifier key = change.getRootPath().getRootIdentifier(); DataObjectModification mod = change.getRootNode(); @@ -236,7 +236,7 @@ public class HwvtepOperGlobalListener implements ClusteredDataTreeChangeListener .child(Node.class); } - private Node getUpdated(DataObjectModification mod) { + private static Node getUpdated(DataObjectModification mod) { Node node = null; switch (mod.getModificationType()) { case SUBTREE_MODIFIED: @@ -252,6 +252,4 @@ public class HwvtepOperGlobalListener implements ClusteredDataTreeChangeListener } return node; } - - } diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/TransactionHistoryCmd.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/TransactionHistoryCmd.java index f5a0a39f6..f9e8017d3 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/TransactionHistoryCmd.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/TransactionHistoryCmd.java @@ -85,7 +85,7 @@ public class TransactionHistoryCmd extends OsgiCommandSupport { }); } - private List> mergeLogsByDate( + private static List> mergeLogsByDate( List logs1, List logs2) { diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/cli/HwvtepCacheDisplayCmd.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/cli/HwvtepCacheDisplayCmd.java index c62dee1b8..be3d5fe0a 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/cli/HwvtepCacheDisplayCmd.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/cli/HwvtepCacheDisplayCmd.java @@ -83,8 +83,7 @@ public class HwvtepCacheDisplayCmd implements Action { } @SuppressWarnings("checkstyle:RegexpSinglelineJava") - private void print(InstanceIdentifier iid, - HwvtepConnectionInstance connectionInstance) { + private static void print(InstanceIdentifier iid, HwvtepConnectionInstance connectionInstance) { PrintStream printStream = System.out; printStream.print("Printing for Node : "); printStream.println(iid.firstKeyOf(Node.class).getNodeId().getValue()); @@ -116,7 +115,7 @@ public class HwvtepCacheDisplayCmd implements Action { } - private void printEntry(PrintStream console, Map.Entry, + private static void printEntry(PrintStream console, Map.Entry, Map> entry) { Class cls = entry.getKey(); Map map = entry.getValue(); @@ -127,7 +126,7 @@ public class HwvtepCacheDisplayCmd implements Action { }); } - private void printTable(PrintStream console, String clsName, HwvtepDeviceInfo.DeviceData deviceData) { + private static void printTable(PrintStream console, String clsName, HwvtepDeviceInfo.DeviceData deviceData) { console.print(" "); if (clsName.equals("LogicalSwitches")) { printLogicalSwitches(console, deviceData); @@ -152,12 +151,12 @@ public class HwvtepCacheDisplayCmd implements Action { console.println(deviceData.getUuid()); } - private void printLogicalSwitches(PrintStream console, HwvtepDeviceInfo.DeviceData deviceData) { + private static void printLogicalSwitches(PrintStream console, HwvtepDeviceInfo.DeviceData deviceData) { InstanceIdentifier ls = deviceData.getKey(); console.print(ls.firstKeyOf(LogicalSwitches.class).getHwvtepNodeName().getValue()); } - private void printRemoteMcasts(PrintStream console, HwvtepDeviceInfo.DeviceData deviceData) { + private static void printRemoteMcasts(PrintStream console, HwvtepDeviceInfo.DeviceData deviceData) { InstanceIdentifier remoteMcastMacsIid = deviceData.getKey(); String macAddress = remoteMcastMacsIid.firstKeyOf(RemoteMcastMacs.class).getMacEntryKey().getValue(); String logicalSwitchRef = remoteMcastMacsIid.firstKeyOf(RemoteMcastMacs.class).getLogicalSwitchRef().getValue() @@ -167,7 +166,7 @@ public class HwvtepCacheDisplayCmd implements Action { console.print(macEntryDetails); } - private void printRemoteUcasts(PrintStream console, HwvtepDeviceInfo.DeviceData deviceData) { + private static void printRemoteUcasts(PrintStream console, HwvtepDeviceInfo.DeviceData deviceData) { InstanceIdentifier remoteUcastMacsIid = deviceData.getKey(); String macAddress = remoteUcastMacsIid.firstKeyOf(RemoteUcastMacs.class).getMacEntryKey().getValue(); String logicalSwitchRef = remoteUcastMacsIid.firstKeyOf(RemoteUcastMacs.class).getLogicalSwitchRef().getValue() @@ -177,7 +176,7 @@ public class HwvtepCacheDisplayCmd implements Action { console.print(macEntryDetails); } - private void printTerminationPoint(PrintStream console, HwvtepDeviceInfo.DeviceData deviceData) { + private static void printTerminationPoint(PrintStream console, HwvtepDeviceInfo.DeviceData deviceData) { InstanceIdentifier terminationPointIid = deviceData.getKey(); console.print(terminationPointIid.firstKeyOf(TerminationPoint.class).getTpId().getValue()); try { @@ -188,12 +187,12 @@ public class HwvtepCacheDisplayCmd implements Action { } } - private void printNode(PrintStream console, HwvtepDeviceInfo.DeviceData deviceData) { + private static void printNode(PrintStream console, HwvtepDeviceInfo.DeviceData deviceData) { InstanceIdentifier ls = deviceData.getKey(); console.print(ls.firstKeyOf(Node.class).getNodeId().getValue()); } - private void printCommon(PrintStream console, HwvtepDeviceInfo.DeviceData deviceData) { + private static void printCommon(PrintStream console, HwvtepDeviceInfo.DeviceData deviceData) { console.print(deviceData.getKey()); console.print(" "); if (deviceData.getData() == null && deviceData.getStatus() != HwvtepDeviceInfo.DeviceDataStatus.IN_TRANSIT) { @@ -204,7 +203,7 @@ public class HwvtepCacheDisplayCmd implements Action { console.println(deviceData.getUuid()); } - private void printEntryUUID(PrintStream console, Map.Entry, Map, Map> entry) { Class cls = entry.getKey(); Map map = entry.getValue(); @@ -214,6 +213,4 @@ public class HwvtepCacheDisplayCmd implements Action { printTable(console, clsName, deviceData); }); } - - } diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/reconciliation/configuration/HwvtepReconciliationManager.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/reconciliation/configuration/HwvtepReconciliationManager.java index 3ef5b833a..72de9ce65 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/reconciliation/configuration/HwvtepReconciliationManager.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/reconciliation/configuration/HwvtepReconciliationManager.java @@ -87,14 +87,14 @@ public class HwvtepReconciliationManager implements ClusteredDataTreeChangeListe } } - private Node getCreated(DataObjectModification mod) { + private static Node getCreated(DataObjectModification mod) { if (mod.getModificationType() == ModificationType.WRITE && mod.getDataBefore() == null) { return mod.getDataAfter(); } return null; } - private Node getRemoved(DataObjectModification mod) { + private static Node getRemoved(DataObjectModification mod) { if (mod.getModificationType() == ModificationType.DELETE) { return mod.getDataBefore(); } diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/LogicalRouterUpdateCommand.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/LogicalRouterUpdateCommand.java index 0879086af..be348667f 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/LogicalRouterUpdateCommand.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/LogicalRouterUpdateCommand.java @@ -95,7 +95,7 @@ public class LogicalRouterUpdateCommand } - private void setDescription(final LogicalRouter logicalRouter, final LogicalRouters inputRouter) { + private static void setDescription(final LogicalRouter logicalRouter, final LogicalRouters inputRouter) { if (inputRouter.getHwvtepNodeDescription() != null) { logicalRouter.setDescription(inputRouter.getHwvtepNodeDescription()); } else { @@ -103,7 +103,7 @@ public class LogicalRouterUpdateCommand } } - private void setName(final LogicalRouter logicalRouter, final LogicalRouters inputRouter, + private static void setName(final LogicalRouter logicalRouter, final LogicalRouters inputRouter, final Optional inputRouterOptional) { if (inputRouter.getHwvtepNodeName() != null) { logicalRouter.setName(inputRouter.getHwvtepNodeName().getValue()); diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/LogicalSwitchUcastsRemoveCommand.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/LogicalSwitchUcastsRemoveCommand.java index af926e392..9a7affa47 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/LogicalSwitchUcastsRemoveCommand.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/LogicalSwitchUcastsRemoveCommand.java @@ -188,7 +188,7 @@ public class LogicalSwitchUcastsRemoveCommand }); } - private Map excludeVlanBindings(final Set deletedLsUuids, final PhysicalPort port) { + private static Map excludeVlanBindings(final Set deletedLsUuids, final PhysicalPort port) { return port.getVlanBindingsColumn().getData() .entrySet().stream() .peek(entry -> { diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/McastMacsRemoteUpdateCommand.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/McastMacsRemoteUpdateCommand.java index d519a53a7..bf47aa1a6 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/McastMacsRemoteUpdateCommand.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/McastMacsRemoteUpdateCommand.java @@ -148,13 +148,13 @@ public class McastMacsRemoteUpdateCommand } } - private void setIpAddress(final McastMacsRemote mcastMacsRemote, final RemoteMcastMacs inputMac) { + private static void setIpAddress(final McastMacsRemote mcastMacsRemote, final RemoteMcastMacs inputMac) { if (inputMac.getIpaddr() != null) { mcastMacsRemote.setIpAddress(inputMac.getIpaddr().getIpv4Address().getValue()); } } - private void setMac(final McastMacsRemote mcastMacsRemote, final RemoteMcastMacs inputMac) { + private static void setMac(final McastMacsRemote mcastMacsRemote, final RemoteMcastMacs inputMac) { if (inputMac.getMacEntryKey() != null) { if (inputMac.getMacEntryKey().equals(HwvtepSouthboundConstants.UNKNOWN_DST_MAC)) { mcastMacsRemote.setMac(HwvtepSouthboundConstants.UNKNOWN_DST_STRING); @@ -179,7 +179,7 @@ public class McastMacsRemoteUpdateCommand && Objects.equals(macs1.getLocatorSet(), macs2.getLocatorSet()); } - private boolean compareLocatorSets(List locatorSet1, List locatorSet2) { + private static boolean compareLocatorSets(List locatorSet1, List locatorSet2) { if (locatorSet1 == null) { locatorSet1 = Collections.EMPTY_LIST; } diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/PhysicalPortUpdateCommand.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/PhysicalPortUpdateCommand.java index ccb71371e..a5c1bc598 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/PhysicalPortUpdateCommand.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/PhysicalPortUpdateCommand.java @@ -160,7 +160,8 @@ public class PhysicalPortUpdateCommand return; } - private void setName(final PhysicalPort physicalPort, final HwvtepPhysicalPortAugmentation inputPhysicalPort) { + private static void setName(final PhysicalPort physicalPort, + final HwvtepPhysicalPortAugmentation inputPhysicalPort) { if (inputPhysicalPort.getHwvtepNodeName() != null) { physicalPort.setName(inputPhysicalPort.getHwvtepNodeName().getValue()); } diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/PhysicalSwitchRemoveCommand.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/PhysicalSwitchRemoveCommand.java index 5c2549bb2..20c59afe8 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/PhysicalSwitchRemoveCommand.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/PhysicalSwitchRemoveCommand.java @@ -74,7 +74,7 @@ public class PhysicalSwitchRemoveCommand extends AbstractTransactCommand { } } - private Map, PhysicalSwitchAugmentation> extractRemovedSwitches( + private static Map, PhysicalSwitchAugmentation> extractRemovedSwitches( final Collection> changes, final Class class1) { Map, PhysicalSwitchAugmentation> result = new HashMap<>(); if (changes != null && !changes.isEmpty()) { diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/TransactCommandAggregator.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/TransactCommandAggregator.java index 37994cbfe..1bf0dfe24 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/TransactCommandAggregator.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/TransactCommandAggregator.java @@ -33,7 +33,7 @@ public class TransactCommandAggregator implements TransactCommand { private static final Logger LOG = LoggerFactory.getLogger(TransactCommandAggregator.class); private final List commands = new ArrayList<>(); - private AtomicInteger retryCount = new AtomicInteger(HwvtepSouthboundConstants.CHAIN_RETRY_COUNT); + private final AtomicInteger retryCount = new AtomicInteger(HwvtepSouthboundConstants.CHAIN_RETRY_COUNT); private final HwvtepOperationalState operationalState; /* stores the modified and deleted data for each child type of each node id Map @@ -111,16 +111,16 @@ public class TransactCommandAggregator implements TransactCommand { } } - private boolean isMacOnlyUpdate(final Map, List> updatedData, - final Map, List> deletedData) { + private static boolean isMacOnlyUpdate(final Map, List> updatedData, + final Map, List> deletedData) { return updatedData.containsKey(RemoteUcastMacs.class) && updatedData.size() == 1 || deletedData.containsKey(RemoteUcastMacs.class) && deletedData.size() == 1; } - private void extractDataChanged(final InstanceIdentifier key, - final DataObjectModification mod, - final Map, List> updatedData, - final Map, List> deletedData) { + private static void extractDataChanged(final InstanceIdentifier key, + final DataObjectModification mod, + final Map, List> updatedData, + final Map, List> deletedData) { extractDataChanged(mod.getModifiedChildren(), updatedData, deletedData); DataObjectModification aug = mod.getModifiedAugmentation( @@ -135,9 +135,10 @@ public class TransactCommandAggregator implements TransactCommand { } } - private void extractDataChanged(final Collection> children, - final Map, List> updatedData, - final Map, List> deletedData) { + private static void extractDataChanged( + final Collection> children, + final Map, List> updatedData, + final Map, List> deletedData) { if (children == null) { return; } @@ -175,8 +176,8 @@ public class TransactCommandAggregator implements TransactCommand { } } - private void addToUpdatedData(Map, List> updatedData, - Class childClass, Identifiable identifiable) { + private static void addToUpdatedData(Map, List> updatedData, + Class childClass, Identifiable identifiable) { updatedData.computeIfAbsent(childClass, (cls) -> new ArrayList<>()); updatedData.get(childClass).add(identifiable); } diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepLogicalRouterUpdateCommand.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepLogicalRouterUpdateCommand.java index 15d34e747..7207ab475 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepLogicalRouterUpdateCommand.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepLogicalRouterUpdateCommand.java @@ -106,7 +106,7 @@ public class HwvtepLogicalRouterUpdateCommand extends AbstractTransactionCommand return connectionNode.build(); } - private void setStaticRoutes(final LogicalRouter router, final LogicalRoutersBuilder lrBuilder) { + private static void setStaticRoutes(final LogicalRouter router, final LogicalRoutersBuilder lrBuilder) { if (isRouterHasStaticRoutes(router)) { List routes = new ArrayList<>(); for (Entry entry : router.getStaticRoutesColumn().getData().entrySet()) { @@ -119,7 +119,7 @@ public class HwvtepLogicalRouterUpdateCommand extends AbstractTransactionCommand } } - private boolean isRouterHasStaticRoutes(final LogicalRouter router) { + private static boolean isRouterHasStaticRoutes(final LogicalRouter router) { return router != null && router.getStaticRoutesColumn() != null && router.getStaticRoutesColumn().getData() != null && !router.getStaticRoutesColumn().getData().isEmpty(); @@ -144,7 +144,7 @@ public class HwvtepLogicalRouterUpdateCommand extends AbstractTransactionCommand } } - private boolean isRouterHasAcls(final LogicalRouter router) { + private static boolean isRouterHasAcls(final LogicalRouter router) { return router != null && router.getAclBindingColumn() != null && router.getAclBindingColumn().getData() != null && !router.getAclBindingColumn().getData().isEmpty(); @@ -169,7 +169,7 @@ public class HwvtepLogicalRouterUpdateCommand extends AbstractTransactionCommand } } - private boolean isRouterHasSwitchBindings(final LogicalRouter router) { + private static boolean isRouterHasSwitchBindings(final LogicalRouter router) { return router != null && router.getSwitchBindingColumn() != null && router.getSwitchBindingColumn().getData() != null && !router.getSwitchBindingColumn().getData().isEmpty(); diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepMacEntriesRemoveCommand.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepMacEntriesRemoveCommand.java index 62581f97b..65831b774 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepMacEntriesRemoveCommand.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepMacEntriesRemoveCommand.java @@ -144,7 +144,7 @@ public class HwvtepMacEntriesRemoveCommand extends AbstractTransactionCommand { return null; } - private MacAddress getMacAddress(String mac) { + private static MacAddress getMacAddress(String mac) { if (mac.equals(HwvtepSouthboundConstants.UNKNOWN_DST_STRING)) { return HwvtepSouthboundConstants.UNKNOWN_DST_MAC; } else { diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepPhysicalLocatorUpdateCommand.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepPhysicalLocatorUpdateCommand.java index da17e3f75..e68ba619b 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepPhysicalLocatorUpdateCommand.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepPhysicalLocatorUpdateCommand.java @@ -83,7 +83,7 @@ public class HwvtepPhysicalLocatorUpdateCommand extends AbstractTransactionComma } } - private void setEncapsType(HwvtepPhysicalLocatorAugmentationBuilder tpAugmentationBuilder, + private static void setEncapsType(HwvtepPhysicalLocatorAugmentationBuilder tpAugmentationBuilder, PhysicalLocator locator) { String encapsType = locator.getEncapsulationTypeColumn().getData(); if (HwvtepSouthboundMapper.createEncapsulationType(encapsType) != null) { @@ -91,7 +91,7 @@ public class HwvtepPhysicalLocatorUpdateCommand extends AbstractTransactionComma } } - private void setDstIp(HwvtepPhysicalLocatorAugmentationBuilder tpAugmentationBuilder, + private static void setDstIp(HwvtepPhysicalLocatorAugmentationBuilder tpAugmentationBuilder, PhysicalLocator locator) { tpAugmentationBuilder.setDstIp(IpAddressBuilder.getDefaultInstance(locator.getDstIpColumn().getData())); } diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepPhysicalSwitchUpdateCommand.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepPhysicalSwitchUpdateCommand.java index d4edea81d..d81c56ef8 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepPhysicalSwitchUpdateCommand.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepPhysicalSwitchUpdateCommand.java @@ -179,7 +179,7 @@ public class HwvtepPhysicalSwitchUpdateCommand extends AbstractTransactionComman psAugmentationBuilder.setManagedBy(new HwvtepGlobalRef(connectionNodePath)); } - private void setPhysicalSwitchId(PhysicalSwitchAugmentationBuilder psAugmentationBuilder, + private static void setPhysicalSwitchId(PhysicalSwitchAugmentationBuilder psAugmentationBuilder, PhysicalSwitch phySwitch) { if (phySwitch.getName() != null) { psAugmentationBuilder.setHwvtepNodeName(new HwvtepNodeName(phySwitch.getName())); @@ -189,7 +189,7 @@ public class HwvtepPhysicalSwitchUpdateCommand extends AbstractTransactionComman } } - private void setManagementIps(PhysicalSwitchAugmentationBuilder psAugmentationBuilder, + private static void setManagementIps(PhysicalSwitchAugmentationBuilder psAugmentationBuilder, PhysicalSwitch phySwitch) { if (phySwitch.getManagementIpsColumn() != null && phySwitch.getManagementIpsColumn().getData() != null && !phySwitch.getManagementIpsColumn().getData().isEmpty()) { @@ -229,7 +229,7 @@ public class HwvtepPhysicalSwitchUpdateCommand extends AbstractTransactionComman return nodeKey.getNodeId(); } - private void deleteEntries(ReadWriteTransaction transaction, + private static void deleteEntries(ReadWriteTransaction transaction, List> entryIids) { for (InstanceIdentifier entryIid : entryIids) { transaction.delete(LogicalDatastoreType.OPERATIONAL, entryIid); @@ -255,7 +255,7 @@ public class HwvtepPhysicalSwitchUpdateCommand extends AbstractTransactionComman return result; } - private void setSwitchFaultStatus(PhysicalSwitchAugmentationBuilder psAugmentationBuilder, + private static void setSwitchFaultStatus(PhysicalSwitchAugmentationBuilder psAugmentationBuilder, PhysicalSwitch phySwitch) { if (phySwitch.getSwitchFaultStatusColumn() != null && phySwitch.getSwitchFaultStatusColumn().getData() != null && !phySwitch.getSwitchFaultStatusColumn().getData().isEmpty()) { diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepTunnelUpdateCommand.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepTunnelUpdateCommand.java index 0d17e0dbc..977e5865b 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepTunnelUpdateCommand.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepTunnelUpdateCommand.java @@ -107,7 +107,7 @@ public class HwvtepTunnelUpdateCommand extends AbstractTransactionCommand { } } - private void setBfdLocalConfigs(TunnelsBuilder tunnelsBuilder, Tunnel tunnel) { + private static void setBfdLocalConfigs(TunnelsBuilder tunnelsBuilder, Tunnel tunnel) { Map localConfigs = tunnel.getBfdConfigLocalColumn().getData(); if (localConfigs != null && !localConfigs.isEmpty()) { List localConfigsList = localConfigs.entrySet().stream().map( @@ -118,7 +118,7 @@ public class HwvtepTunnelUpdateCommand extends AbstractTransactionCommand { } } - private void setBfdRemoteConfigs(TunnelsBuilder tunnelsBuilder, Tunnel tunnel) { + private static void setBfdRemoteConfigs(TunnelsBuilder tunnelsBuilder, Tunnel tunnel) { Map remoteConfigs = tunnel.getBfdConfigRemoteColumn().getData(); if (remoteConfigs != null && !remoteConfigs.isEmpty()) { List remoteConfigsList = remoteConfigs.entrySet().stream().map( @@ -130,7 +130,7 @@ public class HwvtepTunnelUpdateCommand extends AbstractTransactionCommand { } - private void setBfdParams(TunnelsBuilder tunnelsBuilder, Tunnel tunnel) { + private static void setBfdParams(TunnelsBuilder tunnelsBuilder, Tunnel tunnel) { Map params = tunnel.getBfdParamsColumn().getData(); if (params != null && !params.isEmpty()) { List paramsList = params.entrySet().stream().map( @@ -141,7 +141,7 @@ public class HwvtepTunnelUpdateCommand extends AbstractTransactionCommand { } } - private void setBfdStatus(TunnelsBuilder tunnelsBuilder, Tunnel tunnel) { + private static void setBfdStatus(TunnelsBuilder tunnelsBuilder, Tunnel tunnel) { Map status = tunnel.getBfdStatusColumn().getData(); if (status != null && !status.isEmpty()) { List statusList = status.entrySet().stream().map( diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepOperationalDataChangeListener.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepOperationalDataChangeListener.java index 32b2b35c7..dff2c7153 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepOperationalDataChangeListener.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepOperationalDataChangeListener.java @@ -95,8 +95,8 @@ public class HwvtepOperationalDataChangeListener implements ClusteredDataTreeCha } } - private InstanceIdentifier getKey(InstanceIdentifier key, DataObjectModification child, - DataObject data) { + private static InstanceIdentifier getKey(InstanceIdentifier key, + DataObjectModification child, DataObject data) { Class childClass = child.getDataType(); InstanceIdentifier instanceIdentifier = null; if (LogicalSwitches.class == childClass) { @@ -123,11 +123,9 @@ public class HwvtepOperationalDataChangeListener implements ClusteredDataTreeCha return (Class>) cls; } - private InstanceIdentifier getWildcardPath() { - InstanceIdentifier path = InstanceIdentifier - .create(NetworkTopology.class) + private static InstanceIdentifier getWildcardPath() { + return InstanceIdentifier.create(NetworkTopology.class) .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID)) .child(Node.class); - return path; } } diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/TransactionInvokerImplTest.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/TransactionInvokerImplTest.java index 51651b48b..f83f4e440 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/TransactionInvokerImplTest.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/TransactionInvokerImplTest.java @@ -124,7 +124,7 @@ public class TransactionInvokerImplTest extends AbstractConcurrentDataBrokerTest } - private InstanceIdentifier createInstanceIdentifier(final String nodeIdString) { + private static InstanceIdentifier createInstanceIdentifier(final String nodeIdString) { NodeId nodeId = new NodeId(new Uri(nodeIdString)); NodeKey nodeKey = new NodeKey(nodeId); TopologyKey topoKey = new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID); diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbOperGlobalListener.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbOperGlobalListener.java index a2391a8f5..c47f2bef5 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbOperGlobalListener.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbOperGlobalListener.java @@ -36,7 +36,7 @@ public class OvsdbOperGlobalListener implements ClusteredDataTreeChangeListener< private static final Logger LOG = LoggerFactory.getLogger(OvsdbOperGlobalListener.class); private ListenerRegistration registration; - private DataBroker db; + private final DataBroker db; private final OvsdbConnectionManager ovsdbConnectionManager; private final TransactionInvoker txInvoker; @@ -119,22 +119,22 @@ public class OvsdbOperGlobalListener implements ClusteredDataTreeChangeListener< TIMEOUT_FTS.put(iid, ft); } - private Node getCreated(DataObjectModification mod) { - if ((mod.getModificationType() == DataObjectModification.ModificationType.WRITE) - && (mod.getDataBefore() == null)) { + private static Node getCreated(DataObjectModification mod) { + if (mod.getModificationType() == DataObjectModification.ModificationType.WRITE + && mod.getDataBefore() == null) { return mod.getDataAfter(); } return null; } - private Node getRemoved(DataObjectModification mod) { + private static Node getRemoved(DataObjectModification mod) { if (mod.getModificationType() == DataObjectModification.ModificationType.DELETE) { return mod.getDataBefore(); } return null; } - private Node getUpdated(DataObjectModification mod) { + private static Node getUpdated(DataObjectModification mod) { Node node = null; switch (mod.getModificationType()) { case SUBTREE_MODIFIED: @@ -151,12 +151,9 @@ public class OvsdbOperGlobalListener implements ClusteredDataTreeChangeListener< return node; } - private InstanceIdentifier getWildcardPath() { - InstanceIdentifier path = InstanceIdentifier - .create(NetworkTopology.class) + private static InstanceIdentifier getWildcardPath() { + return InstanceIdentifier.create(NetworkTopology.class) .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)) .child(Node.class); - return path; } - } diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundProvider.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundProvider.java index 3d421af75..280761c5e 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundProvider.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundProvider.java @@ -165,7 +165,7 @@ public class SouthboundProvider implements ClusteredDataTreeChangeListener path = InstanceIdentifier .create(NetworkTopology.class) .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)); diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundProviderConfigurator.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundProviderConfigurator.java index 2eac43613..2b098eb40 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundProviderConfigurator.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundProviderConfigurator.java @@ -39,17 +39,17 @@ public class SouthboundProviderConfigurator { public void setBridgesReconciliationInclusionList(String bridgeListStr) { if (bridgeListStr != null && !bridgeListStr.equals("")) { - southboundProvider.setBridgesReconciliationInclusionList(getBridgesList(bridgeListStr)); + SouthboundProvider.setBridgesReconciliationInclusionList(getBridgesList(bridgeListStr)); } } public void setBridgesReconciliationExclusionList(String bridgeListStr) { if (bridgeListStr != null && !bridgeListStr.equals("")) { - southboundProvider.setBridgesReconciliationExclusionList(getBridgesList(bridgeListStr)); + SouthboundProvider.setBridgesReconciliationExclusionList(getBridgesList(bridgeListStr)); } } - private List getBridgesList(final String bridgeListStr) { + private static List getBridgesList(final String bridgeListStr) { List bridgeList = new ArrayList<>(); StringTokenizer tokenizer = new StringTokenizer(bridgeListStr, ","); while (tokenizer.hasMoreTokens()) { @@ -69,12 +69,12 @@ public class SouthboundProviderConfigurator { } else if (paramEntry.getKey().equalsIgnoreCase(BRIDGES_RECONCILIATION_INCLUSION_LIST_PARAM)) { String bridgeListStr = (String)paramEntry.getValue(); if (bridgeListStr != null && !bridgeListStr.equals("")) { - southboundProvider.setBridgesReconciliationInclusionList(getBridgesList(bridgeListStr)); + SouthboundProvider.setBridgesReconciliationInclusionList(getBridgesList(bridgeListStr)); } } else if (paramEntry.getKey().equalsIgnoreCase(BRIDGES_RECONCILIATION_EXCLUSION_LIST_PARAM)) { String bridgeListStr = (String)paramEntry.getValue(); if (bridgeListStr != null && !bridgeListStr.equals("")) { - southboundProvider.setBridgesReconciliationExclusionList(getBridgesList(bridgeListStr)); + SouthboundProvider.setBridgesReconciliationExclusionList(getBridgesList(bridgeListStr)); } } } diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/AutoAttachRemovedCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/AutoAttachRemovedCommand.java index e0c2904da..07a4a4fb9 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/AutoAttachRemovedCommand.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/AutoAttachRemovedCommand.java @@ -58,9 +58,9 @@ public class AutoAttachRemovedCommand implements TransactCommand { TransactUtils.extractUpdated(events, OvsdbNodeAugmentation.class)); } - private void execute(final TransactionBuilder transaction, final BridgeOperationalState state, - final Map, OvsdbNodeAugmentation> original, - final Map, OvsdbNodeAugmentation> updated) { + private static void execute(final TransactionBuilder transaction, final BridgeOperationalState state, + final Map, OvsdbNodeAugmentation> original, + final Map, OvsdbNodeAugmentation> updated) { for (final Map.Entry, OvsdbNodeAugmentation> originalEntry : original.entrySet()) { @@ -93,7 +93,7 @@ public class AutoAttachRemovedCommand implements TransactCommand { } } - private void deleteAutoAttach(final TransactionBuilder transaction, + private static void deleteAutoAttach(final TransactionBuilder transaction, final InstanceIdentifier ovsdbNodeIid, final Uuid autoattachUuid) { diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/AutoAttachUpdateCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/AutoAttachUpdateCommand.java index a17146443..a7e0f6f8b 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/AutoAttachUpdateCommand.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/AutoAttachUpdateCommand.java @@ -75,7 +75,7 @@ public class AutoAttachUpdateCommand implements TransactCommand { } } - private void updateAutoAttach(final TransactionBuilder transaction, final BridgeOperationalState state, + private static void updateAutoAttach(final TransactionBuilder transaction, final BridgeOperationalState state, final InstanceIdentifier iid, final OvsdbNodeAugmentation ovsdbNode) { diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/QosUpdateCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/QosUpdateCommand.java index ee6704fa9..fccf9cf01 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/QosUpdateCommand.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/QosUpdateCommand.java @@ -56,7 +56,7 @@ public class QosUpdateCommand implements TransactCommand { instanceIdentifierCodec); } - private void execute(final TransactionBuilder transaction, final BridgeOperationalState state, + private static void execute(final TransactionBuilder transaction, final BridgeOperationalState state, final Map, QosEntries> createdOrUpdated, final InstanceIdentifierCodec instanceIdentifierCodec) { for (Entry, QosEntries> qosMapEntry: createdOrUpdated.entrySet()) { diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointCreateCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointCreateCommand.java index b20b753e5..24f945752 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointCreateCommand.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointCreateCommand.java @@ -78,7 +78,7 @@ public class TerminationPointCreateCommand implements TransactCommand { TransactUtils.extractCreatedOrUpdated(modifications, Node.class), instanceIdentifierCodec); } - private void execute(final TransactionBuilder transaction, final BridgeOperationalState state, + private static void execute(final TransactionBuilder transaction, final BridgeOperationalState state, final Map, OvsdbTerminationPointAugmentation> createdTerminationPoints, final Map, Node> nodes, final InstanceIdentifierCodec instanceIdentifierCodec) { @@ -130,7 +130,7 @@ public class TerminationPointCreateCommand implements TransactCommand { } - private void createInterface( + private static void createInterface( final OvsdbTerminationPointAugmentation terminationPoint, final Interface ovsInterface) { ovsInterface.setName(terminationPoint.getName()); @@ -153,7 +153,7 @@ public class TerminationPointCreateCommand implements TransactCommand { } } - private void createPort( + private static void createPort( final OvsdbTerminationPointAugmentation terminationPoint, final Port port, final String interfaceUuid, final String opendaylightIid) { @@ -166,7 +166,7 @@ public class TerminationPointCreateCommand implements TransactCommand { createPortExternalIds(terminationPoint, port, opendaylightIid); } - private void createOfPort( + private static void createOfPort( final OvsdbTerminationPointAugmentation terminationPoint, final Interface ovsInterface) { @@ -176,7 +176,7 @@ public class TerminationPointCreateCommand implements TransactCommand { } } - private void createOfPortRequest( + private static void createOfPortRequest( final OvsdbTerminationPointAugmentation terminationPoint, final Interface ovsInterface) { @@ -186,7 +186,7 @@ public class TerminationPointCreateCommand implements TransactCommand { } } - private void createInterfaceOptions( + private static void createInterfaceOptions( final OvsdbTerminationPointAugmentation terminationPoint, final Interface ovsInterface) { @@ -201,7 +201,7 @@ public class TerminationPointCreateCommand implements TransactCommand { } } - private void createInterfaceExternalIds( + private static void createInterfaceExternalIds( final OvsdbTerminationPointAugmentation terminationPoint, final Interface ovsInterface) { @@ -222,7 +222,7 @@ public class TerminationPointCreateCommand implements TransactCommand { } } - private void createInterfaceOtherConfig( + private static void createInterfaceOtherConfig( final OvsdbTerminationPointAugmentation terminationPoint, final Interface ovsInterface) { @@ -242,7 +242,7 @@ public class TerminationPointCreateCommand implements TransactCommand { } } - private void createInterfaceLldp( + private static void createInterfaceLldp( final OvsdbTerminationPointAugmentation terminationPoint, final Interface ovsInterface) { @@ -262,8 +262,8 @@ public class TerminationPointCreateCommand implements TransactCommand { } } - private void createInterfaceBfd(final OvsdbTerminationPointAugmentation terminationPoint, - final Interface ovsInterface) { + private static void createInterfaceBfd(final OvsdbTerminationPointAugmentation terminationPoint, + final Interface ovsInterface) { try { Map interfaceBfdList = terminationPoint.getInterfaceBfd(); @@ -280,8 +280,7 @@ public class TerminationPointCreateCommand implements TransactCommand { } } - private void createPortExternalIds( - final OvsdbTerminationPointAugmentation terminationPoint, + private static void createPortExternalIds(final OvsdbTerminationPointAugmentation terminationPoint, final Port port, final String opendaylightIid) { // Set the iid external_id @@ -306,7 +305,7 @@ public class TerminationPointCreateCommand implements TransactCommand { } } - private void createPortVlanTag( + private static void createPortVlanTag( final OvsdbTerminationPointAugmentation terminationPoint, final Port port) { @@ -317,7 +316,7 @@ public class TerminationPointCreateCommand implements TransactCommand { } } - private void createPortVlanTrunk( + private static void createPortVlanTrunk( final OvsdbTerminationPointAugmentation terminationPoint, final Port port) { @@ -333,7 +332,7 @@ public class TerminationPointCreateCommand implements TransactCommand { } } - private void createPortVlanMode( + private static void createPortVlanMode( final OvsdbTerminationPointAugmentation terminationPoint, final Port port) { if (terminationPoint.getVlanMode() != null) { @@ -344,7 +343,7 @@ public class TerminationPointCreateCommand implements TransactCommand { } } - private void createPortOtherConfig( + private static void createPortOtherConfig( final OvsdbTerminationPointAugmentation terminationPoint, final Port ovsPort) { Map portOtherConfigs = diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/reconciliation/ReconciliationManager.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/reconciliation/ReconciliationManager.java index a9d80026e..9d824b120 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/reconciliation/ReconciliationManager.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/reconciliation/ReconciliationManager.java @@ -193,7 +193,7 @@ public class ReconciliationManager implements AutoCloseable { } } - private LoadingCache buildBridgeNodeCache() { + private static LoadingCache buildBridgeNodeCache() { return CacheBuilder.newBuilder() .expireAfterWrite(BRIDGE_CACHE_TIMEOUT_IN_SECONDS, TimeUnit.SECONDS) .build(new CacheLoader() { @@ -265,7 +265,7 @@ public class ReconciliationManager implements AutoCloseable { @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD", justification = "https://github.com/spotbugs/spotbugs/issues/811") - private Map, OvsdbTerminationPointAugmentation> + private static Map, OvsdbTerminationPointAugmentation> filterTerminationPointsForBridge(NodeKey nodeKey, Map, OvsdbTerminationPointAugmentation> terminationPoints) { diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OpenVSwitchUpdateCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OpenVSwitchUpdateCommand.java index 22b1e7385..e35eca7a9 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OpenVSwitchUpdateCommand.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OpenVSwitchUpdateCommand.java @@ -195,7 +195,7 @@ public class OpenVSwitchUpdateCommand extends AbstractTransactionCommand { ovsdbNodeBuilder.setOpenvswitchExternalIds(externalIdsList); } - private void setInterfaceTypes( + private static void setInterfaceTypes( OvsdbNodeAugmentationBuilder ovsdbNodeBuilder, OpenVSwitch openVSwitch) { try { @@ -218,9 +218,7 @@ public class OpenVSwitchUpdateCommand extends AbstractTransactionCommand { } } - private void setDataPathTypes( - OvsdbNodeAugmentationBuilder ovsdbNodeBuilder, - OpenVSwitch openVSwitch) { + private static void setDataPathTypes(OvsdbNodeAugmentationBuilder ovsdbNodeBuilder, OpenVSwitch openVSwitch) { try { Set dptypes = openVSwitch.getDatapathTypesColumn() .getData(); @@ -242,7 +240,7 @@ public class OpenVSwitchUpdateCommand extends AbstractTransactionCommand { } } - private void setOvsVersion(OvsdbNodeAugmentationBuilder ovsdbNodeBuilder, OpenVSwitch openVSwitch) { + private static void setOvsVersion(OvsdbNodeAugmentationBuilder ovsdbNodeBuilder, OpenVSwitch openVSwitch) { try { ovsdbNodeBuilder.setOvsVersion(openVSwitch.getOvsVersionColumn().getData().iterator().next()); } catch (NoSuchElementException e) { @@ -250,7 +248,7 @@ public class OpenVSwitchUpdateCommand extends AbstractTransactionCommand { } } - private void setDbVersion(OvsdbNodeAugmentationBuilder ovsdbNodeBuilder, OpenVSwitch openVSwitch) { + private static void setDbVersion(OvsdbNodeAugmentationBuilder ovsdbNodeBuilder, OpenVSwitch openVSwitch) { try { ovsdbNodeBuilder.setDbVersion(openVSwitch.getDbVersionColumn().getData().iterator().next()); } catch (NoSuchElementException e) { diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbAutoAttachRemovedCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbAutoAttachRemovedCommand.java index c8445c98e..b7fa9d234 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbAutoAttachRemovedCommand.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbAutoAttachRemovedCommand.java @@ -69,7 +69,7 @@ public class OvsdbAutoAttachRemovedCommand extends AbstractTransactionCommand { } } - private AutoattachKey getAutoAttachKeyToRemove(Node node, UUID autoAttachUuid) { + private static AutoattachKey getAutoAttachKeyToRemove(Node node, UUID autoAttachUuid) { final Map autoAttachList = node.augmentation(OvsdbNodeAugmentation.class).getAutoattach(); if (autoAttachList == null || autoAttachList.isEmpty()) { diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbAutoAttachUpdateCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbAutoAttachUpdateCommand.java index c9236f665..e36d482d2 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbAutoAttachUpdateCommand.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbAutoAttachUpdateCommand.java @@ -133,7 +133,7 @@ public class OvsdbAutoAttachUpdateCommand extends AbstractTransactionCommand { } } - private void setMappings(AutoattachBuilder autoAttachBuilder, + private static void setMappings(AutoattachBuilder autoAttachBuilder, AutoAttach autoAttach) { final Map mappings = autoAttach.getMappingsColumn().getData(); final List mappingsList = new ArrayList<>(); diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbControllerRemovedCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbControllerRemovedCommand.java index b90f1915d..78951b328 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbControllerRemovedCommand.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbControllerRemovedCommand.java @@ -32,9 +32,9 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class OvsdbControllerRemovedCommand extends AbstractTransactionCommand { private final InstanceIdentifierCodec instanceIdentifierCodec; - private Map oldBridgeRows; - private Map removedControllerRows; - private Map updatedBridgeRows; + private final Map oldBridgeRows; + private final Map removedControllerRows; + private final Map updatedBridgeRows; public OvsdbControllerRemovedCommand(InstanceIdentifierCodec instanceIdentifierCodec, OvsdbConnectionInstance key, TableUpdates updates, DatabaseSchema dbSchema) { @@ -56,7 +56,7 @@ public class OvsdbControllerRemovedCommand extends AbstractTransactionCommand { } } - private void deleteControllers(ReadWriteTransaction transaction, + private static void deleteControllers(ReadWriteTransaction transaction, List> controllerEntryIids) { for (InstanceIdentifier controllerEntryIid: controllerEntryIids) { transaction.delete(LogicalDatastoreType.OPERATIONAL, controllerEntryIid); diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbPortUpdateCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbPortUpdateCommand.java index 2ab8bc2fb..dcdef1bbc 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbPortUpdateCommand.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbPortUpdateCommand.java @@ -466,7 +466,7 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand { new Uri(SouthboundConstants.QOS_URI_PREFIX + "://" + qosUuid.toString()))); } - private void updateIfIndex(final Interface interf, + private static void updateIfIndex(final Interface interf, final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) { Set ifIndexSet = null; try { @@ -483,8 +483,8 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand { } } - private void updateMac(final Interface interf, - final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) { + private static void updateMac(final Interface interf, + final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) { Set macSet = null; try { if (interf.getMacColumn() != null) { @@ -504,8 +504,8 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand { } } - private void updateMacInUse(final Interface interf, - final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) { + private static void updateMacInUse(final Interface interf, + final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) { Set macInUseSet = null; try { if (interf.getMacInUseColumn() != null) { @@ -648,7 +648,7 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand { } } - private void updateInterfaceLldp(final Interface interf, + private static void updateInterfaceLldp(final Interface interf, final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) { try { @@ -693,7 +693,7 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand { } } - private void updateInterfaceBfdStatus(final Interface interf, + private static void updateInterfaceBfdStatus(final Interface interf, final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) { try { @@ -718,7 +718,7 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand { } } - private void updateInterfaceBfd(final Interface interf, + private static void updateInterfaceBfd(final Interface interf, final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) { try { @@ -744,7 +744,7 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand { } } - private void updateInterfacePolicing(final Interface interf, + private static void updateInterfacePolicing(final Interface interf, final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) { Long ingressPolicingRate = null; diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbQosUpdateCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbQosUpdateCommand.java index eba9c437f..601f95dec 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbQosUpdateCommand.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbQosUpdateCommand.java @@ -180,7 +180,7 @@ public class OvsdbQosUpdateCommand extends AbstractTransactionCommand { } } - private void setOtherConfig(ReadWriteTransaction transaction, + private static void setOtherConfig(ReadWriteTransaction transaction, QosEntriesBuilder qosEntryBuilder, Qos oldQos, Qos qos, InstanceIdentifier nodeIId) { Map oldOtherConfigs = null; @@ -200,7 +200,7 @@ public class OvsdbQosUpdateCommand extends AbstractTransactionCommand { } } - private void removeOldConfigs(ReadWriteTransaction transaction, + private static void removeOldConfigs(ReadWriteTransaction transaction, QosEntriesBuilder qosEntryBuilder, Map oldOtherConfigs, Qos qos, InstanceIdentifier nodeIId) { InstanceIdentifier qosIId = nodeIId @@ -215,7 +215,7 @@ public class OvsdbQosUpdateCommand extends AbstractTransactionCommand { } } - private void setNewOtherConfigs(QosEntriesBuilder qosEntryBuilder, + private static void setNewOtherConfigs(QosEntriesBuilder qosEntryBuilder, Map otherConfig) { List otherConfigList = new ArrayList<>(); for (Entry entry : otherConfig.entrySet()) { @@ -229,7 +229,7 @@ public class OvsdbQosUpdateCommand extends AbstractTransactionCommand { qosEntryBuilder.setQosOtherConfig(otherConfigList); } - private void setExternalIds(ReadWriteTransaction transaction, + private static void setExternalIds(ReadWriteTransaction transaction, QosEntriesBuilder qosEntryBuilder, Qos oldQos, Qos qos, InstanceIdentifier nodeIId) { Map oldExternalIds = null; @@ -249,7 +249,7 @@ public class OvsdbQosUpdateCommand extends AbstractTransactionCommand { } } - private void removeOldExternalIds(ReadWriteTransaction transaction, + private static void removeOldExternalIds(ReadWriteTransaction transaction, QosEntriesBuilder qosEntryBuilder, Map oldExternalIds, Qos qos, InstanceIdentifier nodeIId) { InstanceIdentifier qosIId = nodeIId @@ -264,7 +264,7 @@ public class OvsdbQosUpdateCommand extends AbstractTransactionCommand { } } - private void setNewExternalIds(QosEntriesBuilder qosEntryBuilder, + private static void setNewExternalIds(QosEntriesBuilder qosEntryBuilder, Map externalIds) { List externalIdsList = new ArrayList<>(); for (Entry entry : externalIds.entrySet()) { @@ -298,7 +298,7 @@ public class OvsdbQosUpdateCommand extends AbstractTransactionCommand { } } - private void removeOldQueues(ReadWriteTransaction transaction, + private static void removeOldQueues(ReadWriteTransaction transaction, QosEntriesBuilder qosEntryBuilder, Map oldQueueList, Qos qos, InstanceIdentifier nodeIId) { InstanceIdentifier qosIId = nodeIId diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbQueueUpdateCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbQueueUpdateCommand.java index 95c1a55d1..d0123e969 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbQueueUpdateCommand.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbQueueUpdateCommand.java @@ -130,7 +130,7 @@ public class OvsdbQueueUpdateCommand extends AbstractTransactionCommand { return SouthboundConstants.QUEUE_URI_PREFIX + "://" + queue.getUuid().toString(); } - private void setOtherConfig(ReadWriteTransaction transaction, + private static void setOtherConfig(ReadWriteTransaction transaction, QueuesBuilder queuesBuilder, Queue oldQueue, Queue queue, InstanceIdentifier nodeIId) { Map oldOtherConfigs = null; @@ -150,7 +150,7 @@ public class OvsdbQueueUpdateCommand extends AbstractTransactionCommand { } } - private void removeOldConfigs(ReadWriteTransaction transaction, + private static void removeOldConfigs(ReadWriteTransaction transaction, QueuesBuilder queuesBuilder, Map oldOtherConfigs, Queue queue, InstanceIdentifier nodeIId) { InstanceIdentifier queueIId = nodeIId @@ -165,7 +165,7 @@ public class OvsdbQueueUpdateCommand extends AbstractTransactionCommand { } } - private void setNewOtherConfigs(QueuesBuilder queuesBuilder, + private static void setNewOtherConfigs(QueuesBuilder queuesBuilder, Map otherConfig) { List otherConfigList = new ArrayList<>(); for (Entry entry : otherConfig.entrySet()) { @@ -179,7 +179,7 @@ public class OvsdbQueueUpdateCommand extends AbstractTransactionCommand { queuesBuilder.setQueuesOtherConfig(otherConfigList); } - private void setExternalIds(ReadWriteTransaction transaction, + private static void setExternalIds(ReadWriteTransaction transaction, QueuesBuilder queuesBuilder, Queue oldQueue, Queue queue, InstanceIdentifier nodeIId) { Map oldExternalIds = null; @@ -199,7 +199,7 @@ public class OvsdbQueueUpdateCommand extends AbstractTransactionCommand { } } - private void removeOldExternalIds(ReadWriteTransaction transaction, + private static void removeOldExternalIds(ReadWriteTransaction transaction, QueuesBuilder queuesBuilder, Map oldExternalIds, Queue queue, InstanceIdentifier nodeIId) { InstanceIdentifier queueIId = nodeIId @@ -214,7 +214,7 @@ public class OvsdbQueueUpdateCommand extends AbstractTransactionCommand { } } - private void setNewExternalIds(QueuesBuilder queuesBuilder, + private static void setNewExternalIds(QueuesBuilder queuesBuilder, Map externalIds) { List externalIdsList = new ArrayList<>(); for (Entry entry : externalIds.entrySet()) { diff --git a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/ProtocolRemovedCommandTest.java b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/ProtocolRemovedCommandTest.java index 17cfdfc47..e820e3381 100644 --- a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/ProtocolRemovedCommandTest.java +++ b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/ProtocolRemovedCommandTest.java @@ -89,7 +89,7 @@ public class ProtocolRemovedCommandTest { Mockito.verify(transaction).add(any(Operation.class)); } - private Object setField(final String fieldName) throws Exception { + private static Object setField(final String fieldName) throws Exception { Field field = Operations.class.getDeclaredField(fieldName); field.setAccessible(true); field.set(field.get(Operations.class), mock(Operations.class)); diff --git a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointCreateCommandTest.java b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointCreateCommandTest.java index a3b1739b3..4e24f96e9 100644 --- a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointCreateCommandTest.java +++ b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointCreateCommandTest.java @@ -146,7 +146,7 @@ public class TerminationPointCreateCommandTest { verify(transaction).add(any(Operation.class)); } - private Object setField(final String fieldName) throws Exception { + private static Object setField(final String fieldName) throws Exception { Field field = Operations.class.getDeclaredField(fieldName); field.setAccessible(true); field.set(field.get(Operations.class), mock(Operations.class)); diff --git a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TransactUtilsTest.java b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TransactUtilsTest.java index dc0c5e814..7aec38ae9 100644 --- a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TransactUtilsTest.java +++ b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TransactUtilsTest.java @@ -254,7 +254,7 @@ public class TransactUtilsTest { instanceIdentifierCodec)); } - private Object setField(final String fieldName) throws Exception { + private static Object setField(final String fieldName) throws Exception { Field field = Operations.class.getDeclaredField(fieldName); field.setAccessible(true); field.set(field.get(Operations.class), mock(Operations.class)); diff --git a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/reconciliation/configuration/BridgeConfigReconciliationTaskTest.java b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/reconciliation/configuration/BridgeConfigReconciliationTaskTest.java index 8456237e9..c958ed759 100644 --- a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/reconciliation/configuration/BridgeConfigReconciliationTaskTest.java +++ b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/reconciliation/configuration/BridgeConfigReconciliationTaskTest.java @@ -121,7 +121,7 @@ public class BridgeConfigReconciliationTaskTest { .build(); } - private Map, DataObject> createExpectedConfigurationChanges(final Node bridgeNode) { + private static Map, DataObject> createExpectedConfigurationChanges(final Node bridgeNode) { OvsdbBridgeAugmentation ovsdbBridge = bridgeNode.augmentation(OvsdbBridgeAugmentation.class); Map, DataObject> changes = new HashMap<>(); diff --git a/southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java b/southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java index 4327effff..821707a16 100644 --- a/southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java +++ b/southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java @@ -340,7 +340,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { return combinedOptions; } - private Option[] getOtherOptions() { + private static Option[] getOtherOptions() { return new Option[] { vmOption("-javaagent:../jars/org.jacoco.agent.jar=destfile=../../jacoco-it.exec"), keepRuntimeFolder() @@ -387,7 +387,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { super.getLoggingOption()); } - private Option[] getPropertiesOptions() { + private static Option[] getPropertiesOptions() { Properties props = new Properties(System.getProperties()); String ipAddressStr = props.getProperty(SouthboundITConstants.SERVER_IPADDRESS, SouthboundITConstants.DEFAULT_SERVER_IPADDRESS); @@ -494,7 +494,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { } } - private Boolean getOvsdbTopology() { + private static Boolean getOvsdbTopology() { LOG.info("getOvsdbTopology: looking for {}...", SouthboundUtils.OVSDB_TOPOLOGY_ID.getValue()); Boolean found = false; final TopologyId topologyId = SouthboundUtils.OVSDB_TOPOLOGY_ID; @@ -578,7 +578,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { topology); } - private Node connectOvsdbNode(final ConnectionInfo connectionInfo) throws InterruptedException { + private static Node connectOvsdbNode(final ConnectionInfo connectionInfo) throws InterruptedException { final InstanceIdentifier iid = SouthboundUtils.createInstanceIdentifier(connectionInfo); Assert.assertTrue( mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, iid, SouthboundUtils.createNode(connectionInfo))); @@ -589,7 +589,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { return node; } - private void waitForOperationalCreation(InstanceIdentifier iid) throws InterruptedException { + private static void waitForOperationalCreation(InstanceIdentifier iid) throws InterruptedException { synchronized (OPERATIONAL_LISTENER) { long start = System.currentTimeMillis(); LOG.info("Waiting for OPERATIONAL DataChanged creation on {}", iid); @@ -613,7 +613,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { } } - private void waitForOperationalUpdate(InstanceIdentifier iid) throws InterruptedException { + private static void waitForOperationalUpdate(InstanceIdentifier iid) throws InterruptedException { synchronized (OPERATIONAL_LISTENER) { long start = System.currentTimeMillis(); LOG.info("Waiting for OPERATIONAL DataChanged update on {}", iid); @@ -777,7 +777,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { } } - private List createControllerEntry(String controllerTarget) { + private static List createControllerEntry(String controllerTarget) { List controllerEntriesList = new ArrayList<>(); controllerEntriesList.add(new ControllerEntryBuilder() .setTarget(new Uri(controllerTarget)) @@ -801,7 +801,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { return protocolList; } - private OvsdbTerminationPointAugmentationBuilder createGenericOvsdbTerminationPointAugmentationBuilder() { + private static OvsdbTerminationPointAugmentationBuilder createGenericOvsdbTerminationPointAugmentationBuilder() { OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointAugmentationBuilder = new OvsdbTerminationPointAugmentationBuilder(); ovsdbTerminationPointAugmentationBuilder.setInterfaceType( @@ -812,7 +812,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { return ovsdbTerminationPointAugmentationBuilder; } - private OvsdbTerminationPointAugmentationBuilder createGenericDpdkOvsdbTerminationPointAugmentationBuilder( + private static OvsdbTerminationPointAugmentationBuilder createGenericDpdkOvsdbTerminationPointAugmentationBuilder( final String portName) { OvsdbTerminationPointAugmentationBuilder ovsdbTerminationBuilder = createGenericOvsdbTerminationPointAugmentationBuilder(); @@ -823,7 +823,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { return ovsdbTerminationBuilder; } - private OvsdbTerminationPointAugmentationBuilder createSpecificDpdkOvsdbTerminationPointAugmentationBuilder( + private static OvsdbTerminationPointAugmentationBuilder createSpecificDpdkOvsdbTerminationPointAugmentationBuilder( String testPortname,Class dpdkIfType) { OvsdbTerminationPointAugmentationBuilder ovsdbTerminationBuilder = createGenericOvsdbTerminationPointAugmentationBuilder(); @@ -832,9 +832,9 @@ public class SouthboundIT extends AbstractMdsalTestBase { return ovsdbTerminationBuilder; } - private boolean addTerminationPoint(final NodeId bridgeNodeId, final String portName, - final OvsdbTerminationPointAugmentationBuilder - ovsdbTerminationPointAugmentationBuilder) + private static boolean addTerminationPoint(final NodeId bridgeNodeId, final String portName, + final OvsdbTerminationPointAugmentationBuilder + ovsdbTerminationPointAugmentationBuilder) throws InterruptedException { InstanceIdentifier portIid = SouthboundMapper.createInstanceIdentifier(bridgeNodeId); @@ -1229,7 +1229,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { } } - private OvsdbNodeAugmentation getOvsdbNode(ConnectionInfo connectionInfo, LogicalDatastoreType store) { + private static OvsdbNodeAugmentation getOvsdbNode(ConnectionInfo connectionInfo, LogicalDatastoreType store) { InstanceIdentifier nodeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo); Node node = mdsalUtils.read(store, nodeIid); Assert.assertNotNull(node); @@ -1238,7 +1238,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { return ovsdbNodeAugmentation; } - private OvsdbBridgeAugmentation getBridge(ConnectionInfo connectionInfo) { + private static OvsdbBridgeAugmentation getBridge(ConnectionInfo connectionInfo) { return getBridge(connectionInfo, SouthboundITConstants.BRIDGE_NAME); } @@ -1251,8 +1251,8 @@ public class SouthboundIT extends AbstractMdsalTestBase { * @param store defined by the LogicalDatastoreType enumeration * @return store type data store contents */ - private OvsdbBridgeAugmentation getBridge(ConnectionInfo connectionInfo, String bridgeName, - LogicalDatastoreType store) { + private static OvsdbBridgeAugmentation getBridge(ConnectionInfo connectionInfo, String bridgeName, + LogicalDatastoreType store) { Node bridgeNode = getBridgeNode(connectionInfo, bridgeName, store); Assert.assertNotNull(bridgeNode); OvsdbBridgeAugmentation ovsdbBridgeAugmentation = bridgeNode.augmentation(OvsdbBridgeAugmentation.class); @@ -1269,7 +1269,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { * @see SouthboundIT#getBridge(ConnectionInfo, String, LogicalDatastoreType) * @return LogicalDatastoreType.OPERATIONAL type data store contents */ - private OvsdbBridgeAugmentation getBridge(ConnectionInfo connectionInfo, String bridgeName) { + private static OvsdbBridgeAugmentation getBridge(ConnectionInfo connectionInfo, String bridgeName) { return getBridge(connectionInfo, bridgeName, LogicalDatastoreType.OPERATIONAL); } @@ -1282,7 +1282,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { * @param store defined by the LogicalDatastoreType enumeration * @return store type data store contents */ - private Node getBridgeNode(ConnectionInfo connectionInfo, String bridgeName, LogicalDatastoreType store) { + private static Node getBridgeNode(ConnectionInfo connectionInfo, String bridgeName, LogicalDatastoreType store) { InstanceIdentifier bridgeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(bridgeName)); return mdsalUtils.read(store, bridgeIid); @@ -1296,7 +1296,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { * @param bridgeName the bridge name * @return LogicalDatastoreType.OPERATIONAL type data store contents */ - private Node getBridgeNode(ConnectionInfo connectionInfo, String bridgeName) { + private static Node getBridgeNode(ConnectionInfo connectionInfo, String bridgeName) { return getBridgeNode(connectionInfo, bridgeName, LogicalDatastoreType.OPERATIONAL); } @@ -1325,11 +1325,11 @@ public class SouthboundIT extends AbstractMdsalTestBase { * @param index the index we're interested in * @return the augmentation (or {@code null} if none) */ - private OvsdbTerminationPointAugmentation getOvsdbTerminationPointAugmentation( + private static OvsdbTerminationPointAugmentation getOvsdbTerminationPointAugmentation( ConnectionInfo connectionInfo, String bridgeName, LogicalDatastoreType store, int index) { Map tpList = getBridgeNode(connectionInfo, bridgeName, store) - .nonnullTerminationPoint(); + .getTerminationPoint(); if (tpList == null) { return null; } @@ -1487,7 +1487,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { * * @see SouthboundIT.generatePortExternalIdsTestCases() for specific test case information */ - private , T extends Identifiable> void testCRUDTerminationPoint( + private static , T extends Identifiable> void testCRUDTerminationPoint( KeyValueBuilder builder, String prefix, SouthboundTerminationPointHelper helper) throws InterruptedException { final int terminationPointTestIndex = 0; @@ -1865,7 +1865,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { } } - private List> generateVlanSets() { + private static List> generateVlanSets() { int min = 0; int max = 4095; return Lists.newArrayList( @@ -1874,7 +1874,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { Sets.newHashSet(min, max, min + 1, max - 1, (max - min) / 2)); } - private List buildTrunkList(Set trunkSet) { + private static List buildTrunkList(Set trunkSet) { List trunkList = new ArrayList<>(); for (Integer trunk : trunkSet) { TrunksBuilder trunkBuilder = new TrunksBuilder(); @@ -2047,7 +2047,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { Map readValues(OvsdbBridgeAugmentation augmentation); } - private , T extends Identifiable> void testCRUDBridge(String prefix, + private static , T extends Identifiable> void testCRUDBridge(String prefix, KeyValueBuilder builder, SouthboundBridgeHelper helper) throws InterruptedException { ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portNumber); // updateFromTestCases represent the original test case value. updateToTestCases represent the new value after @@ -2251,7 +2251,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { return null; } - private , T extends Identifiable> void testCRUDQueue( + private static , T extends Identifiable> void testCRUDQueue( KeyValueBuilder builder, String prefix, SouthboundQueueHelper helper) throws InterruptedException { @@ -2385,7 +2385,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { } - private , T extends Identifiable> void testCRUDQos( + private static , T extends Identifiable> void testCRUDQos( KeyValueBuilder builder, String prefix, SouthboundQosHelper helper) throws InterruptedException { diff --git a/utils/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java b/utils/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java index 955f18e8f..53adfe6a0 100644 --- a/utils/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java +++ b/utils/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java @@ -1327,7 +1327,7 @@ public class SouthboundUtils { return false; } - private List setBridgeExternalIds() { + private static List setBridgeExternalIds() { List externalIdsList = new ArrayList<>(); externalIdsList.add(new BridgeExternalIdsBuilder() .setBridgeExternalIdKey(CREATED_BY) -- 2.36.6