From: Robert Varga Date: Tue, 23 Jan 2024 11:46:20 +0000 (+0100) Subject: WIP: Bump upstreams X-Git-Tag: release/potassium-sr2~3 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=93fa4f844b0712c35a01f16ec321693557496202;p=openflowplugin.git WIP: Bump upstreams Adopt: - odparent-13.0.10 - infrautils-6.0.5 - yangtools-11.0.5 - mdsal-12.0.4 - controller-8.0.4 - aaa-0.18.4 - netconf-6.0.6-SNAPSHOT Also fixes up fallout from I35697d2544464d6cdc4ee88d13978eaabcf33353, which broke unregistration -- this is now found by SpotBugs. Change-Id: Ifbbaebc8521ac07606b2eec692926b081666c017 Signed-off-by: Robert Varga --- diff --git a/applications/arbitratorreconciliation/pom.xml b/applications/arbitratorreconciliation/pom.xml index 7dd9e094ea..9f09076242 100644 --- a/applications/arbitratorreconciliation/pom.xml +++ b/applications/arbitratorreconciliation/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/FlowWriterSequential.java b/applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/FlowWriterSequential.java index d09d8d0c20..e5694e3f32 100644 --- a/applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/FlowWriterSequential.java +++ b/applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/FlowWriterSequential.java @@ -23,24 +23,23 @@ import org.slf4j.LoggerFactory; public class FlowWriterSequential implements FlowCounterMBean { private static final Logger LOG = LoggerFactory.getLogger(FlowWriterSequential.class); + private final DataBroker dataBroker; private final ExecutorService flowPusher; - protected int dpnCount; private long startTime; private final AtomicInteger writeOpStatus = new AtomicInteger(FlowCounter.OperationStatus.INIT.status()); private final AtomicInteger countDpnWriteCompletion = new AtomicInteger(); private final AtomicLong taskCompletionTime = new AtomicLong(); - public FlowWriterSequential(final DataBroker dataBroker, ExecutorService flowPusher) { + public FlowWriterSequential(final DataBroker dataBroker, final ExecutorService flowPusher) { this.dataBroker = dataBroker; this.flowPusher = flowPusher; LOG.info("Using Sequential implementation of Flow Writer."); } - public void addFlows(Integer count, Integer flowsPerDPN, int batchSize, int sleepMillis, short startTableId, - short endTableId, boolean isCreateParents) { + public void addFlows(final Integer count, final Integer flowsPerDPN, final int batchSize, final int sleepMillis, + final short startTableId, final short endTableId, final boolean isCreateParents) { LOG.info("Using Sequential implementation of Flow Writer."); - this.dpnCount = count; countDpnWriteCompletion.set(count); startTime = System.nanoTime(); for (int i = 1; i <= count; i++) { @@ -50,8 +49,8 @@ public class FlowWriterSequential implements FlowCounterMBean { } } - public void deleteFlows(Integer count, Integer flowsPerDPN, int batchSize, short startTableId, - short endTableId) { + public void deleteFlows(final Integer count, final Integer flowsPerDPN, final int batchSize, + final short startTableId, final short endTableId) { LOG.info("Using Sequential implementation of Flow Writer."); countDpnWriteCompletion.set(count); for (int i = 1; i <= count; i++) { @@ -71,7 +70,7 @@ public class FlowWriterSequential implements FlowCounterMBean { return taskCompletionTime.get(); } - private class FlowHandlerTask implements Runnable { + private final class FlowHandlerTask implements Runnable { private final String dpId; private final int flowsPerDpn; private final boolean add; @@ -85,7 +84,7 @@ public class FlowWriterSequential implements FlowCounterMBean { final int flowsPerDpn, final boolean add, final int batchSize, - int sleepMillis, + final int sleepMillis, final short startTableId, final short endTableId, final boolean isCreateParents) { @@ -136,8 +135,8 @@ public class FlowWriterSequential implements FlowCounterMBean { MoreExecutors.directExecutor()); } - private void addFlowToTx(WriteTransaction writeTransaction, String flowId, InstanceIdentifier flowIid, - Flow flow) { + private void addFlowToTx(final WriteTransaction writeTransaction, final String flowId, + final InstanceIdentifier flowIid, final Flow flow) { if (add) { LOG.trace("Adding flow for flowId: {}, flowIid: {}", flowId, flowIid); if (isCreateParents) { @@ -157,7 +156,7 @@ public class FlowWriterSequential implements FlowCounterMBean { private int sourceIp; - DsCallBack(String dpId, int sourceIp, short tableId) { + DsCallBack(final String dpId, final int sourceIp, final short tableId) { this.dpId = dpId; this.sourceIp = sourceIp; short numberA = 1; @@ -166,7 +165,7 @@ public class FlowWriterSequential implements FlowCounterMBean { } @Override - public void onSuccess(Object notUsed) { + public void onSuccess(final Object notUsed) { if (sourceIp > flowsPerDpn) { long dur = System.nanoTime() - startTime; LOG.info("Completed all flows installation for: dpid: {}, tableId: {}, sourceIp: {} in {}ns", dpId, @@ -214,7 +213,7 @@ public class FlowWriterSequential implements FlowCounterMBean { } @Override - public void onFailure(Throwable error) { + public void onFailure(final Throwable error) { LOG.error("Error: {} in Datastore write operation: dpid: {}, tableId: {}, sourceIp: {}", error, dpId, tableId, sourceIp); writeOpStatus.set(FlowCounter.OperationStatus.FAILURE.status()); diff --git a/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/AbstractListeningCommiter.java b/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/AbstractListeningCommiter.java index 731232da9a..e638febbbc 100644 --- a/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/AbstractListeningCommiter.java +++ b/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/AbstractListeningCommiter.java @@ -14,7 +14,6 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.MoreExecutors; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.util.Collection; -import org.eclipse.jdt.annotation.Nullable; import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.mdsal.binding.api.DataObjectModification; import org.opendaylight.mdsal.binding.api.DataTreeIdentifier; @@ -37,19 +36,19 @@ import org.slf4j.LoggerFactory; */ public abstract class AbstractListeningCommiter implements ForwardingRulesCommiter, RecoverableListener { - private static final Logger LOG = LoggerFactory.getLogger(AbstractListeningCommiter.class); + final ForwardingRulesManager provider; NodeConfigurator nodeConfigurator; protected final DataBroker dataBroker; - protected final ListenerRegistrationHelper registrationHelper; - protected ListenerRegistration listenerRegistration; + private final ListenerRegistrationHelper registrationHelper; + private ListenerRegistration listenerRegistration; @SuppressFBWarnings(value = "MC_OVERRIDABLE_METHOD_CALL_IN_CONSTRUCTOR", justification = "See FIXME below") protected AbstractListeningCommiter(final ForwardingRulesManager provider, final DataBroker dataBroker, final ListenerRegistrationHelper registrationHelper) { this.provider = requireNonNull(provider, "ForwardingRulesManager can not be null!"); - this.nodeConfigurator = requireNonNull(provider.getNodeConfigurator(), "NodeConfigurator can not be null!"); + nodeConfigurator = requireNonNull(provider.getNodeConfigurator(), "NodeConfigurator can not be null!"); this.dataBroker = requireNonNull(dataBroker, "DataBroker can not be null!"); this.registrationHelper = requireNonNull(registrationHelper, "registrationHelper can not be null!"); @@ -89,24 +88,22 @@ public abstract class AbstractListeningCommiter IllegalArgumentException("Unhandled modification type " + mod.getModificationType()); } - } else { - if (provider.isStaleMarkingEnabled()) { - LOG.info("Stale-Marking ENABLED and switch {} is NOT connected, storing stale entities", - nodeIdent.toString()); - // Switch is NOT connected - switch (mod.getModificationType()) { - case DELETE: - createStaleMarkEntity(key, mod.getDataBefore(), nodeIdent); - break; - case SUBTREE_MODIFIED: - break; - case WRITE: - break; - default: - throw new - IllegalArgumentException("Unhandled modification type " - + mod.getModificationType()); - } + } else if (provider.isStaleMarkingEnabled()) { + LOG.info("Stale-Marking ENABLED and switch {} is NOT connected, storing stale entities", + nodeIdent.toString()); + // Switch is NOT connected + switch (mod.getModificationType()) { + case DELETE: + createStaleMarkEntity(key, mod.getDataBefore(), nodeIdent); + break; + case SUBTREE_MODIFIED: + break; + case WRITE: + break; + default: + throw new + IllegalArgumentException("Unhandled modification type " + + mod.getModificationType()); } } } catch (RuntimeException e) { @@ -117,22 +114,33 @@ public abstract class AbstractListeningCommiter @Override public final void registerListener() { - final DataTreeIdentifier treeId = - DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, getWildCardPath()); - Futures.addCallback(registrationHelper.checkedRegisterListener(treeId, this), - new FutureCallback>() { - @Override - public void onSuccess( - @Nullable final ListenerRegistration flowListenerRegistration) { - LOG.info("{} registered successfully", flowListenerRegistration.getInstance()); - listenerRegistration = flowListenerRegistration; - } + Futures.addCallback(registrationHelper.checkedRegisterListener( + DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, getWildCardPath()), this), + new FutureCallback>() { + @Override + public void onSuccess(final ListenerRegistration flowListenerRegistration) { + LOG.info("{} registered successfully", flowListenerRegistration.getInstance()); + listenerRegistration = flowListenerRegistration; + } - @Override - public void onFailure(final Throwable throwable) { - LOG.error("Registration failed ", throwable); - } - }, MoreExecutors.directExecutor()); + @Override + public void onFailure(final Throwable throwable) { + LOG.error("Registration failed ", throwable); + } + }, MoreExecutors.directExecutor()); + } + + @Override + public void deregisterListener() { + close(); + } + + @Override + public void close() { + if (listenerRegistration != null) { + listenerRegistration.close(); + listenerRegistration = null; + } } /** diff --git a/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/FlowForwarder.java b/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/FlowForwarder.java index 6b23762354..6ff32f3089 100644 --- a/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/FlowForwarder.java +++ b/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/FlowForwarder.java @@ -60,7 +60,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundleId; -import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.common.ErrorType; import org.opendaylight.yangtools.yang.common.RpcResult; @@ -77,32 +76,12 @@ import org.slf4j.LoggerFactory; * {@link org.opendaylight.mdsal.binding.api.DataTreeModification}. */ public class FlowForwarder extends AbstractListeningCommiter { - private static final Logger LOG = LoggerFactory.getLogger(FlowForwarder.class); - private static final String GROUP_EXISTS_IN_DEVICE_ERROR = "GROUPEXISTS"; - private ListenerRegistration listenerRegistration; - - private final BundleFlowForwarder bundleFlowForwarder; - public FlowForwarder(final ForwardingRulesManager manager, final DataBroker db, final ListenerRegistrationHelper registrationHelper) { super(manager, db, registrationHelper); - bundleFlowForwarder = new BundleFlowForwarder(manager); - } - - @Override - public void deregisterListener() { - close(); - } - - @Override - public void close() { - if (listenerRegistration != null) { - listenerRegistration.close(); - listenerRegistration = null; - } } @Override diff --git a/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/GroupForwarder.java b/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/GroupForwarder.java index 9b65c0374b..7fe5f8fc93 100644 --- a/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/GroupForwarder.java +++ b/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/GroupForwarder.java @@ -44,7 +44,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundleId; -import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.common.Uint32; @@ -59,29 +58,11 @@ import org.slf4j.LoggerFactory; * {@link org.opendaylight.mdsal.binding.api.DataTreeModification}. */ public class GroupForwarder extends AbstractListeningCommiter { - private static final Logger LOG = LoggerFactory.getLogger(GroupForwarder.class); - private ListenerRegistration listenerRegistration; - - private final BundleGroupForwarder bundleGroupForwarder; public GroupForwarder(final ForwardingRulesManager manager, final DataBroker db, final ListenerRegistrationHelper registrationHelper) { super(manager, db, registrationHelper); - this.bundleGroupForwarder = new BundleGroupForwarder(manager); - } - - @Override - public void deregisterListener() { - close(); - } - - @Override - public void close() { - if (listenerRegistration != null) { - listenerRegistration.close(); - listenerRegistration = null; - } } @Override @@ -109,7 +90,7 @@ public class GroupForwarder extends AbstractListeningCommiter { .build(); final ListenableFuture> resultFuture = - this.provider.getSalGroupService() + provider.getSalGroupService() .removeGroup(removeGroup); Futures.addCallback(resultFuture, new RemoveGroupCallBack(removeDataObj.getGroupId().getValue(), nodeId), @@ -131,7 +112,7 @@ public class GroupForwarder extends AbstractListeningCommiter { builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class))); builder.setGroupRef(new GroupRef(identifier)); builder.setTransactionUri(new Uri(provider.getNewTransactionId())); - return this.provider.getSalGroupService().removeGroup(builder.build()); + return provider.getSalGroupService().removeGroup(builder.build()); } @Override @@ -152,7 +133,7 @@ public class GroupForwarder extends AbstractListeningCommiter { builder.setUpdatedGroup(new UpdatedGroupBuilder(updatedGroup).build()); builder.setOriginalGroup(new OriginalGroupBuilder(originalGroup).build()); UpdateGroupInput updateGroupInput = builder.build(); - final ListenableFuture> resultFuture = this.provider.getSalGroupService() + final ListenableFuture> resultFuture = provider.getSalGroupService() .updateGroup(updateGroupInput); LoggingFutures.addErrorLogging(resultFuture, LOG, "updateGroup"); Futures.addCallback(resultFuture, @@ -180,7 +161,7 @@ public class GroupForwarder extends AbstractListeningCommiter { builder.setTransactionUri(new Uri(provider.getNewTransactionId())); AddGroupInput addGroupInput = builder.build(); final ListenableFuture> resultFuture; - resultFuture = this.provider.getSalGroupService().addGroup(addGroupInput); + resultFuture = provider.getSalGroupService().addGroup(addGroupInput); Futures.addCallback(resultFuture, new AddGroupCallBack(addGroupInput.getGroupId().getValue(), nodeId), MoreExecutors.directExecutor()); @@ -190,21 +171,21 @@ public class GroupForwarder extends AbstractListeningCommiter { } @Override - public void createStaleMarkEntity(InstanceIdentifier identifier, Group del, - InstanceIdentifier nodeIdent) { + public void createStaleMarkEntity(final InstanceIdentifier identifier, final Group del, + final InstanceIdentifier nodeIdent) { LOG.debug("Creating Stale-Mark entry for the switch {} for Group {} ", nodeIdent, del); StaleGroup staleGroup = makeStaleGroup(identifier, del, nodeIdent); persistStaleGroup(staleGroup, nodeIdent); } - private static StaleGroup makeStaleGroup(InstanceIdentifier identifier, Group del, - InstanceIdentifier nodeIdent) { + private static StaleGroup makeStaleGroup(final InstanceIdentifier identifier, final Group del, + final InstanceIdentifier nodeIdent) { StaleGroupBuilder staleGroupBuilder = new StaleGroupBuilder(del); return staleGroupBuilder.setGroupId(del.getGroupId()).build(); } - private void persistStaleGroup(StaleGroup staleGroup, InstanceIdentifier nodeIdent) { + private void persistStaleGroup(final StaleGroup staleGroup, final InstanceIdentifier nodeIdent) { WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction(); writeTransaction.put(LogicalDatastoreType.CONFIGURATION, getStaleGroupInstanceIdentifier(staleGroup, nodeIdent), staleGroup); @@ -213,15 +194,15 @@ public class GroupForwarder extends AbstractListeningCommiter { handleStaleGroupResultFuture(submitFuture); } - private static void handleStaleGroupResultFuture(FluentFuture submitFuture) { + private static void handleStaleGroupResultFuture(final FluentFuture submitFuture) { submitFuture.addCallback(new FutureCallback() { @Override - public void onSuccess(Object result) { + public void onSuccess(final Object result) { LOG.debug("Stale Group creation success"); } @Override - public void onFailure(Throwable throwable) { + public void onFailure(final Throwable throwable) { LOG.error("Stale Group creation failed", throwable); } }, MoreExecutors.directExecutor()); @@ -229,7 +210,7 @@ public class GroupForwarder extends AbstractListeningCommiter { private static InstanceIdentifier getStaleGroupInstanceIdentifier( - StaleGroup staleGroup, InstanceIdentifier nodeIdent) { + final StaleGroup staleGroup, final InstanceIdentifier nodeIdent) { return nodeIdent.child(StaleGroup.class, new StaleGroupKey(new GroupId(staleGroup.getGroupId()))); } @@ -243,7 +224,7 @@ public class GroupForwarder extends AbstractListeningCommiter { } @Override - public void onSuccess(RpcResult result) { + public void onSuccess(final RpcResult result) { if (result.isSuccessful()) { provider.getDevicesGroupRegistry().storeGroup(nodeId, groupId); LOG.debug("Group add with id {} finished without error for node {}", groupId, nodeId); @@ -254,7 +235,7 @@ public class GroupForwarder extends AbstractListeningCommiter { } @Override - public void onFailure(Throwable throwable) { + public void onFailure(final Throwable throwable) { LOG.error("Service call for adding group {} failed for node with error {}", groupId, nodeId, throwable); } } @@ -269,7 +250,7 @@ public class GroupForwarder extends AbstractListeningCommiter { } @Override - public void onSuccess(RpcResult result) { + public void onSuccess(final RpcResult result) { if (result.isSuccessful()) { provider.getDevicesGroupRegistry().storeGroup(nodeId, groupId); LOG.debug("Group update with id {} finished without error for node {}", groupId, nodeId); @@ -280,7 +261,7 @@ public class GroupForwarder extends AbstractListeningCommiter { } @Override - public void onFailure(Throwable throwable) { + public void onFailure(final Throwable throwable) { LOG.error("Service call for updating group {} failed for node {} with", groupId, nodeId, throwable); } @@ -296,7 +277,7 @@ public class GroupForwarder extends AbstractListeningCommiter { } @Override - public void onSuccess(RpcResult result) { + public void onSuccess(final RpcResult result) { if (result.isSuccessful()) { LOG.debug("Group remove with id {} finished without error for node {}", groupId, nodeId); provider.getDevicesGroupRegistry().removeGroup(nodeId, groupId); @@ -307,7 +288,7 @@ public class GroupForwarder extends AbstractListeningCommiter { } @Override - public void onFailure(Throwable throwable) { + public void onFailure(final Throwable throwable) { LOG.error("Service call for removing group {} failed for node with error {}", groupId, nodeId, throwable); } } diff --git a/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/ListenerRegistrationHelper.java b/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/ListenerRegistrationHelper.java index e01c3cd434..9410feae01 100644 --- a/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/ListenerRegistrationHelper.java +++ b/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/ListenerRegistrationHelper.java @@ -30,7 +30,6 @@ public class ListenerRegistrationHelper { private static final Logger LOG = LoggerFactory.getLogger(ListenerRegistrationHelper.class); private static final long INVENTORY_CHECK_TIMER = 1; - private final String operational = "OPERATIONAL"; private final ListeningExecutorService listeningExecutorService; private final DataBroker dataBroker; @@ -47,9 +46,9 @@ public class ListenerRegistrationHelper { public > ListenableFuture> checkedRegisterListener( - DataTreeIdentifier treeId, L listener) { + final DataTreeIdentifier treeId, final L listener) { return listeningExecutorService.submit(() -> { - while (!getInventoryConfigDataStoreStatus().equals(operational)) { + while (!getInventoryConfigDataStoreStatus().equals("OPERATIONAL")) { try { LOG.debug("Retrying for datastore to become operational for listener {}", listener); Thread.sleep(INVENTORY_CHECK_TIMER * 1000); diff --git a/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/MeterForwarder.java b/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/MeterForwarder.java index ecf18514a3..9c437f7f3f 100644 --- a/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/MeterForwarder.java +++ b/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/MeterForwarder.java @@ -48,7 +48,6 @@ import org.slf4j.LoggerFactory; * */ public class MeterForwarder extends AbstractListeningCommiter { - private static final Logger LOG = LoggerFactory.getLogger(MeterForwarder.class); public MeterForwarder(final ForwardingRulesManager manager, final DataBroker db, @@ -56,19 +55,6 @@ public class MeterForwarder extends AbstractListeningCommiter { super(manager, db, listenerRegistrationHelper); } - @Override - public void deregisterListener() { - close(); - } - - @Override - public void close() { - if (listenerRegistration != null) { - listenerRegistration.close(); - listenerRegistration = null; - } - } - @Override protected InstanceIdentifier getWildCardPath() { return InstanceIdentifier.create(Nodes.class).child(Node.class).augmentation(FlowCapableNode.class) @@ -85,7 +71,7 @@ public class MeterForwarder extends AbstractListeningCommiter { builder.setMeterRef(new MeterRef(identifier)); builder.setTransactionUri(new Uri(provider.getNewTransactionId())); - LoggingFutures.addErrorLogging(this.provider.getSalMeterService().removeMeter(builder.build()), LOG, + LoggingFutures.addErrorLogging(provider.getSalMeterService().removeMeter(builder.build()), LOG, "removeMeter"); } @@ -98,7 +84,7 @@ public class MeterForwarder extends AbstractListeningCommiter { builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class))); builder.setMeterRef(new MeterRef(identifier)); builder.setTransactionUri(new Uri(provider.getNewTransactionId())); - return this.provider.getSalMeterService().removeMeter(builder.build()); + return provider.getSalMeterService().removeMeter(builder.build()); } @Override @@ -113,7 +99,7 @@ public class MeterForwarder extends AbstractListeningCommiter { builder.setUpdatedMeter(new UpdatedMeterBuilder(update).build()); builder.setOriginalMeter(new OriginalMeterBuilder(original).build()); - LoggingFutures.addErrorLogging(this.provider.getSalMeterService().updateMeter(builder.build()), LOG, + LoggingFutures.addErrorLogging(provider.getSalMeterService().updateMeter(builder.build()), LOG, "updateMeter"); } @@ -126,23 +112,23 @@ public class MeterForwarder extends AbstractListeningCommiter { builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class))); builder.setMeterRef(new MeterRef(identifier)); builder.setTransactionUri(new Uri(provider.getNewTransactionId())); - return this.provider.getSalMeterService().addMeter(builder.build()); + return provider.getSalMeterService().addMeter(builder.build()); } @Override - public void createStaleMarkEntity(InstanceIdentifier identifier, Meter del, - InstanceIdentifier nodeIdent) { + public void createStaleMarkEntity(final InstanceIdentifier identifier, final Meter del, + final InstanceIdentifier nodeIdent) { LOG.debug("Creating Stale-Mark entry for the switch {} for meter {} ", nodeIdent, del); StaleMeter staleMeter = makeStaleMeter(del); persistStaleMeter(staleMeter, nodeIdent); } - private static StaleMeter makeStaleMeter(Meter del) { + private static StaleMeter makeStaleMeter(final Meter del) { StaleMeterBuilder staleMeterBuilder = new StaleMeterBuilder(del); return staleMeterBuilder.setMeterId(del.getMeterId()).build(); } - private void persistStaleMeter(StaleMeter staleMeter, InstanceIdentifier nodeIdent) { + private void persistStaleMeter(final StaleMeter staleMeter, final InstanceIdentifier nodeIdent) { WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction(); writeTransaction.put(LogicalDatastoreType.CONFIGURATION, getStaleMeterInstanceIdentifier(staleMeter, nodeIdent), staleMeter); @@ -151,15 +137,15 @@ public class MeterForwarder extends AbstractListeningCommiter { handleStaleMeterResultFuture(submitFuture); } - private static void handleStaleMeterResultFuture(FluentFuture submitFuture) { + private static void handleStaleMeterResultFuture(final FluentFuture submitFuture) { submitFuture.addCallback(new FutureCallback() { @Override - public void onSuccess(Object result) { + public void onSuccess(final Object result) { LOG.debug("Stale Meter creation success"); } @Override - public void onFailure(Throwable throwable) { + public void onFailure(final Throwable throwable) { LOG.error("Stale Meter creation failed", throwable); } }, MoreExecutors.directExecutor()); @@ -167,7 +153,7 @@ public class MeterForwarder extends AbstractListeningCommiter { private static InstanceIdentifier getStaleMeterInstanceIdentifier( - StaleMeter staleMeter, InstanceIdentifier nodeIdent) { + final StaleMeter staleMeter, final InstanceIdentifier nodeIdent) { return nodeIdent.child(StaleMeter.class, new StaleMeterKey(new MeterId(staleMeter.getMeterId()))); } } diff --git a/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/TableForwarder.java b/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/TableForwarder.java index ebfb2ae744..b2ff5f0ac5 100644 --- a/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/TableForwarder.java +++ b/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/TableForwarder.java @@ -29,7 +29,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class TableForwarder extends AbstractListeningCommiter { - private static final Logger LOG = LoggerFactory.getLogger(TableForwarder.class); public TableForwarder(final ForwardingRulesManager manager, final DataBroker db, @@ -37,19 +36,6 @@ public class TableForwarder extends AbstractListeningCommiter { super(manager, db, registrationHelper); } - @Override - public void deregisterListener() { - close(); - } - - @Override - public void close() { - if (listenerRegistration != null) { - listenerRegistration.close(); - listenerRegistration = null; - } - } - @Override protected InstanceIdentifier getWildCardPath() { return InstanceIdentifier.create(Nodes.class).child(Node.class).augmentation(FlowCapableNode.class) @@ -94,11 +80,11 @@ public class TableForwarder extends AbstractListeningCommiter { .build()); LOG.debug("Invoking SalTableService "); - if (this.provider.getSalTableService() != null) { - LOG.debug(" Handle to SalTableServices {}", this.provider.getSalTableService()); + if (provider.getSalTableService() != null) { + LOG.debug(" Handle to SalTableServices {}", provider.getSalTableService()); } - LoggingFutures.addErrorLogging(this.provider.getSalTableService().updateTable(builder.build()), LOG, + LoggingFutures.addErrorLogging(provider.getSalTableService().updateTable(builder.build()), LOG, "updateTable"); } @@ -109,14 +95,14 @@ public class TableForwarder extends AbstractListeningCommiter { } @Override - public void createStaleMarkEntity(InstanceIdentifier identifier, TableFeatures del, - InstanceIdentifier nodeIdent) { + public void createStaleMarkEntity(final InstanceIdentifier identifier, final TableFeatures del, + final InstanceIdentifier nodeIdent) { LOG.debug("NO-OP"); } @Override - public Future> removeWithResult(InstanceIdentifier identifier, - TableFeatures del, InstanceIdentifier nodeIdent) { + public Future> removeWithResult(final InstanceIdentifier identifier, + final TableFeatures del, final InstanceIdentifier nodeIdent) { return null; } } diff --git a/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyFlatBatchImpl.java b/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyFlatBatchImpl.java index d954cf2129..7e7e0d90b0 100644 --- a/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyFlatBatchImpl.java +++ b/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyFlatBatchImpl.java @@ -100,11 +100,9 @@ import org.slf4j.LoggerFactory; * Execute CRUD API for flow + group + meter involving flat-batch strategy. */ public class SyncPlanPushStrategyFlatBatchImpl implements SyncPlanPushStrategy { - private static final Logger LOG = LoggerFactory.getLogger(SyncPlanPushStrategyFlatBatchImpl.class); - private SalFlatBatchService flatBatchService; - private TableForwarder tableForwarder; + private SalFlatBatchService flatBatchService = null; @Override public ListenableFuture> executeSyncStrategy(ListenableFuture> resultVehicle, @@ -482,8 +480,8 @@ public class SyncPlanPushStrategyFlatBatchImpl implements SyncPlanPushStrategy { return this; } + @Deprecated(since = "0.17.2", forRemoval = true) public SyncPlanPushStrategyFlatBatchImpl setTableForwarder(final TableForwarder tableForwarder) { - this.tableForwarder = tableForwarder; return this; } } diff --git a/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyIncrementalImpl.java b/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyIncrementalImpl.java index da2117120f..8299322df7 100644 --- a/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyIncrementalImpl.java +++ b/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyIncrementalImpl.java @@ -55,13 +55,11 @@ import org.slf4j.LoggerFactory; * Execute CRUD API for flow + group + meter involving one-by-one (incremental) strategy. */ public class SyncPlanPushStrategyIncrementalImpl implements SyncPlanPushStrategy { - private static final Logger LOG = LoggerFactory.getLogger(SyncPlanPushStrategyIncrementalImpl.class); private FlowForwarder flowForwarder; private MeterForwarder meterForwarder; private GroupForwarder groupForwarder; - private TableForwarder tableForwarder; private FlowCapableTransactionService transactionService; @Override @@ -75,59 +73,37 @@ public class SyncPlanPushStrategyIncrementalImpl implements SyncPlanPushStrategy // TODO enable table-update when ready //resultVehicle = updateTableFeatures(nodeIdent, configTree); - resultVehicle = Futures.transformAsync(resultVehicle, input -> { - // if (!input.isSuccessful()) { - //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input); - //final ListenableFuture> singleVoidUpdateResult = Futures.transform( - // Futures.asList Arrays.asList(input, output), - // ReconcileUtil.createRpcResultCondenser("TODO")); - // } - return addMissingGroups(nodeId, nodeIdent, diffInput.getGroupsToAddOrUpdate(), counters); - }, MoreExecutors.directExecutor()); + resultVehicle = Futures.transformAsync(resultVehicle, + input -> addMissingGroups(nodeId, nodeIdent, diffInput.getGroupsToAddOrUpdate(), counters), + MoreExecutors.directExecutor()); Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "addMissingGroups"), - MoreExecutors.directExecutor()); - resultVehicle = Futures.transformAsync(resultVehicle, input -> { - // if (!input.isSuccessful()) { - //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input); - // } - return addMissingMeters(nodeId, nodeIdent, diffInput.getMetersToAddOrUpdate(), counters); - }, MoreExecutors.directExecutor()); + MoreExecutors.directExecutor()); + resultVehicle = Futures.transformAsync(resultVehicle, + input -> addMissingMeters(nodeId, nodeIdent, diffInput.getMetersToAddOrUpdate(), counters), + MoreExecutors.directExecutor()); Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "addMissingMeters"), - MoreExecutors.directExecutor()); - resultVehicle = Futures.transformAsync(resultVehicle, input -> { - // if (!input.isSuccessful()) { - //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input); - // } - return addMissingFlows(nodeId, nodeIdent, diffInput.getFlowsToAddOrUpdate(), counters); - }, MoreExecutors.directExecutor()); + MoreExecutors.directExecutor()); + resultVehicle = Futures.transformAsync(resultVehicle, + input -> addMissingFlows(nodeId, nodeIdent, diffInput.getFlowsToAddOrUpdate(), counters), + MoreExecutors.directExecutor()); Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "addMissingFlows"), - MoreExecutors.directExecutor()); - + MoreExecutors.directExecutor()); - resultVehicle = Futures.transformAsync(resultVehicle, input -> { - // if (!input.isSuccessful()) { - //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input); - // } - return removeRedundantFlows(nodeId, nodeIdent, diffInput.getFlowsToRemove(), counters); - }, MoreExecutors.directExecutor()); + resultVehicle = Futures.transformAsync(resultVehicle, + input -> removeRedundantFlows(nodeId, nodeIdent, diffInput.getFlowsToRemove(), counters), + MoreExecutors.directExecutor()); Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "removeRedundantFlows"), - MoreExecutors.directExecutor()); - resultVehicle = Futures.transformAsync(resultVehicle, input -> { - // if (!input.isSuccessful()) { - //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input); - // } - return removeRedundantMeters(nodeId, nodeIdent, diffInput.getMetersToRemove(), counters); - }, MoreExecutors.directExecutor()); + MoreExecutors.directExecutor()); + resultVehicle = Futures.transformAsync(resultVehicle, + input -> removeRedundantMeters(nodeId, nodeIdent, diffInput.getMetersToRemove(), counters), + MoreExecutors.directExecutor()); Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "removeRedundantMeters"), - MoreExecutors.directExecutor()); - resultVehicle = Futures.transformAsync(resultVehicle, input -> { - // if (!input.isSuccessful()) { - //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input); - // } - return removeRedundantGroups(nodeId, nodeIdent, diffInput.getGroupsToRemove(), counters); - }, MoreExecutors.directExecutor()); + MoreExecutors.directExecutor()); + resultVehicle = Futures.transformAsync(resultVehicle, + input -> removeRedundantGroups(nodeId, nodeIdent, diffInput.getGroupsToRemove(), counters), + MoreExecutors.directExecutor()); Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "removeRedundantGroups"), - MoreExecutors.directExecutor()); + MoreExecutors.directExecutor()); return resultVehicle; } @@ -483,8 +459,8 @@ public class SyncPlanPushStrategyIncrementalImpl implements SyncPlanPushStrategy return this; } + @Deprecated(since = "0.17.2", forRemoval = true) public SyncPlanPushStrategyIncrementalImpl setTableForwarder(final TableForwarder tableForwarder) { - this.tableForwarder = tableForwarder; return this; } @@ -503,5 +479,4 @@ public class SyncPlanPushStrategyIncrementalImpl implements SyncPlanPushStrategy this.transactionService = transactionService; return this; } - } diff --git a/applications/pom.xml b/applications/pom.xml index 43281973e9..25661a3b7d 100644 --- a/applications/pom.xml +++ b/applications/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/applications/reconciliation-framework/src/main/java/org/opendaylight/openflowplugin/applications/reconciliation/cli/GetRegisteredServices.java b/applications/reconciliation-framework/src/main/java/org/opendaylight/openflowplugin/applications/reconciliation/cli/GetRegisteredServices.java index ae0161edc5..07f4a6c0b7 100644 --- a/applications/reconciliation-framework/src/main/java/org/opendaylight/openflowplugin/applications/reconciliation/cli/GetRegisteredServices.java +++ b/applications/reconciliation-framework/src/main/java/org/opendaylight/openflowplugin/applications/reconciliation/cli/GetRegisteredServices.java @@ -17,17 +17,17 @@ import org.opendaylight.openflowplugin.applications.reconciliation.Reconciliatio import org.slf4j.Logger; import org.slf4j.LoggerFactory; -@Command(scope = "reconciliation", name = "getRegisteredServices", description = "displaying services registered to " - + "Reconciliation Framework") /* - * CLI to display the service priority, service name and service status TODO - * service status + * CLI to display the service priority, service name and service status + * FIXME: service status */ +@Command(scope = "reconciliation", name = "getRegisteredServices", + description = "displaying services registered to Reconciliation Framework") public class GetRegisteredServices extends OsgiCommandSupport { private static final Logger LOG = LoggerFactory.getLogger(GetRegisteredServices.class); private static final String CLI_FORMAT = "%d %-20s "; - private ReconciliationManager reconciliationManager; + private ReconciliationManager reconciliationManager = null; public void setReconciliationManager(final ReconciliationManager reconciliationManager) { this.reconciliationManager = requireNonNull(reconciliationManager, "ReconciliationManager can not be null!"); diff --git a/applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/ReconciliationServiceImpl.java b/applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/ReconciliationServiceImpl.java index fb00d4e084..6a9118eb6a 100644 --- a/applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/ReconciliationServiceImpl.java +++ b/applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/ReconciliationServiceImpl.java @@ -70,10 +70,9 @@ public class ReconciliationServiceImpl implements ReconciliationService, AutoClo private final FrmReconciliationService frmReconciliationService; private final AlarmAgent alarmAgent; private final NodeListener nodeListener; - private final int threadPoolSize = 10; private final Map reconciliationStates; - private ExecutorService executor = Executors.newWorkStealingPool(threadPoolSize); + private ExecutorService executor = Executors.newWorkStealingPool(10); public ReconciliationServiceImpl(final DataBroker broker, final FrmReconciliationService frmReconciliationService, final AlarmAgent alarmAgent, final NodeListener nodeListener, diff --git a/applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/cli/Reconciliation.java b/applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/cli/Reconciliation.java index 5a9cf4a21f..de09ed3635 100644 --- a/applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/cli/Reconciliation.java +++ b/applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/cli/Reconciliation.java @@ -28,9 +28,9 @@ import org.slf4j.LoggerFactory; @Command(scope = "openflow", name = "reconcile", description = "Launch reconciliation for openflow nodes") public class Reconciliation extends OsgiCommandSupport { - private static final Logger LOG = LoggerFactory.getLogger(Reconciliation.class); - private ReconciliationService reconciliationService; + + private ReconciliationService reconciliationService = null; public void setReconciliationService(final ReconciliationService reconciliationService) { this.reconciliationService = reconciliationService; diff --git a/applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/FlowCapableTopologyProvider.java b/applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/FlowCapableTopologyProvider.java index b0594925e5..35bdd55f8d 100644 --- a/applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/FlowCapableTopologyProvider.java +++ b/applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/FlowCapableTopologyProvider.java @@ -43,8 +43,9 @@ public class FlowCapableTopologyProvider implements ClusterSingletonService, Aut private final NotificationService notificationService; private final OperationProcessor processor; private final ClusterSingletonServiceProvider clusterSingletonServiceProvider; + private InstanceIdentifier topologyPathIID; - private TransactionChainManager transactionChainManager; + private TransactionChainManager transactionChainManager = null; private Registration listenerRegistration; private ClusterSingletonServiceRegistration singletonServiceRegistration; diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 6cd9de2142..198717a498 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/distribution/karaf/pom.xml b/distribution/karaf/pom.xml index df9f4b70ac..fb73dcafe6 100644 --- a/distribution/karaf/pom.xml +++ b/distribution/karaf/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent karaf4-parent - 13.0.7 + 13.0.10 org.opendaylight.openflowplugin openflowplugin-karaf diff --git a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml index 438a6d75c9..1418697767 100644 --- a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml +++ b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 13.0.7 + 13.0.10 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml index 1881641148..e1561fe1b6 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml index be346b9a03..93f8ee3983 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml index a4973e8020..d9cad742a4 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/extension/features-extension-aggregator/pom.xml b/extension/features-extension-aggregator/pom.xml index e38569f7a7..d7c6c05cb1 100644 --- a/extension/features-extension-aggregator/pom.xml +++ b/extension/features-extension-aggregator/pom.xml @@ -3,7 +3,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 4.0.0 diff --git a/extension/pom.xml b/extension/pom.xml index 27cfc01925..2b5828f8e7 100644 --- a/extension/pom.xml +++ b/extension/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/features-aggregator/features-openflowplugin/pom.xml b/features-aggregator/features-openflowplugin/pom.xml index fa3212ee1a..872fe47be8 100644 --- a/features-aggregator/features-openflowplugin/pom.xml +++ b/features-aggregator/features-openflowplugin/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 13.0.7 + 13.0.10 diff --git a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml index 18a1cc87a5..8244e3cf54 100644 --- a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml index 0314f1f368..1a8f8d8360 100644 --- a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml index 7c6f6460ec..a32746e730 100644 --- a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml index 752cf3432d..8f780eb55d 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml index 2e2eedf0da..7bfc17d876 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml index f6fe877fee..6adef19ac5 100644 --- a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml index 7a40042c20..b60d133bc4 100644 --- a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml index 452d9ba81b..587e0489a1 100644 --- a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml index ca2641ee16..d2c6cbf276 100644 --- a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml index 038c771c37..6a322cc7a6 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml index 69fe489daa..c17311638c 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/features-aggregator/odl-openflowplugin-app-topology/pom.xml b/features-aggregator/odl-openflowplugin-app-topology/pom.xml index 6e5a0531d9..39763300c6 100644 --- a/features-aggregator/odl-openflowplugin-app-topology/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/features-aggregator/odl-openflowplugin-drop-test/pom.xml b/features-aggregator/odl-openflowplugin-drop-test/pom.xml index 49c3bc043c..f704bbf7cd 100644 --- a/features-aggregator/odl-openflowplugin-drop-test/pom.xml +++ b/features-aggregator/odl-openflowplugin-drop-test/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml index 4724d0ba57..49f5518fae 100644 --- a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 @@ -21,7 +21,7 @@ org.opendaylight.netconf netconf-artifacts - 6.0.5 + 6.0.6-SNAPSHOT import pom diff --git a/features-aggregator/odl-openflowplugin-flow-services/pom.xml b/features-aggregator/odl-openflowplugin-flow-services/pom.xml index 2ec32bbd32..5cecf01b06 100644 --- a/features-aggregator/odl-openflowplugin-flow-services/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/features-aggregator/odl-openflowplugin-libraries/pom.xml b/features-aggregator/odl-openflowplugin-libraries/pom.xml index 52eef7226b..22b43252dc 100644 --- a/features-aggregator/odl-openflowplugin-libraries/pom.xml +++ b/features-aggregator/odl-openflowplugin-libraries/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 diff --git a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml index b0bba32570..c060fcd048 100644 --- a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml +++ b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 @@ -21,7 +21,7 @@ org.opendaylight.mdsal mdsal-artifacts - 12.0.3 + 12.0.4 import pom @@ -30,7 +30,7 @@ org.opendaylight.controller controller-artifacts - 8.0.3 + 8.0.4 import pom diff --git a/features-aggregator/odl-openflowplugin-southbound/pom.xml b/features-aggregator/odl-openflowplugin-southbound/pom.xml index f036369bbb..6ba0790505 100644 --- a/features-aggregator/odl-openflowplugin-southbound/pom.xml +++ b/features-aggregator/odl-openflowplugin-southbound/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 @@ -29,14 +29,14 @@ org.opendaylight.controller controller-artifacts - 8.0.3 + 8.0.4 import pom org.opendaylight.infrautils infrautils-artifacts - 6.0.4 + 6.0.5 import pom diff --git a/features-aggregator/pom.xml b/features-aggregator/pom.xml index eb7b9b374b..9c8ac8bbbd 100644 --- a/features-aggregator/pom.xml +++ b/features-aggregator/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/libraries/liblldp/src/main/java/org/opendaylight/openflowplugin/libraries/liblldp/Packet.java b/libraries/liblldp/src/main/java/org/opendaylight/openflowplugin/libraries/liblldp/Packet.java index 2822b2736f..e17d955dc7 100644 --- a/libraries/liblldp/src/main/java/org/opendaylight/openflowplugin/libraries/liblldp/Packet.java +++ b/libraries/liblldp/src/main/java/org/opendaylight/openflowplugin/libraries/liblldp/Packet.java @@ -22,11 +22,10 @@ import org.slf4j.LoggerFactory; * deserialize. */ public abstract class Packet { - private static final Logger LOG = LoggerFactory.getLogger(Packet.class); // Access level granted to this packet - protected boolean writeAccess; + protected final boolean writeAccess; // When deserialized from wire, packet could result corrupted protected boolean corrupted; @@ -99,8 +98,8 @@ public abstract class Packet { for (Entry> pairs : hdrFieldCoordMap .entrySet()) { String hdrField = pairs.getKey(); - startOffset = bitOffset + this.getfieldOffset(hdrField); - numBits = this.getfieldnumBits(hdrField); + startOffset = bitOffset + getfieldOffset(hdrField); + numBits = getfieldnumBits(hdrField); byte[] hdrFieldBytes; try { @@ -114,7 +113,7 @@ public abstract class Packet { * Store the raw read value, checks the payload type and set the * payloadClass accordingly */ - this.setHeaderField(hdrField, hdrFieldBytes); + setHeaderField(hdrField, hdrFieldBytes); if (LOG.isTraceEnabled()) { LOG.trace("{}: {}: {} (offset {} bitsize {})", this.getClass().getSimpleName(), hdrField, @@ -165,7 +164,7 @@ public abstract class Packet { int payloadSize = payloadBytes == null ? 0 : payloadBytes.length; // Allocate the buffer to contain the full (header + payload) packet - int headerSize = this.getHeaderSize() / NetUtils.NUM_BITS_IN_A_BYTE; + int headerSize = getHeaderSize() / NetUtils.NUM_BITS_IN_A_BYTE; byte[] packetBytes = new byte[headerSize + payloadSize]; if (payloadBytes != null) { System.arraycopy(payloadBytes, 0, packetBytes, headerSize, payloadSize); @@ -303,7 +302,7 @@ public abstract class Packet { * @param bytes The raw payload as byte array */ public void setRawPayload(final byte[] bytes) { - this.rawPayload = Arrays.copyOf(bytes, bytes.length); + rawPayload = Arrays.copyOf(bytes, bytes.length); } /** @@ -326,7 +325,7 @@ public abstract class Packet { final int prime = 31; int result = super.hashCode(); result = prime * result - + (this.hdrFieldsMap == null ? 0 : hdrFieldsMap.hashCode()); + + (hdrFieldsMap == null ? 0 : hdrFieldsMap.hashCode()); return result; } diff --git a/libraries/pom.xml b/libraries/pom.xml index 9919ea106e..b4c4f6c354 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/model/pom.xml b/model/pom.xml index e7b992ec9f..7aaed7278d 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml index d740ce8d76..7d5223366b 100644 --- a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 13.0.7 + 13.0.10 diff --git a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml index e7c77248fa..2dd8540260 100644 --- a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent single-feature-parent - 13.0.7 + 13.0.10 @@ -33,7 +33,7 @@ org.opendaylight.infrautils infrautils-artifacts - 6.0.4 + 6.0.5 import pom @@ -42,7 +42,7 @@ org.opendaylight.yangtools yangtools-artifacts - 11.0.4 + 11.0.5 import pom @@ -51,7 +51,7 @@ org.opendaylight.mdsal mdsal-artifacts - 12.0.3 + 12.0.4 import pom diff --git a/openflowjava/features-openflowjava-aggregator/pom.xml b/openflowjava/features-openflowjava-aggregator/pom.xml index 5f31add012..6e274bb4ce 100644 --- a/openflowjava/features-openflowjava-aggregator/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketDecoder.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketDecoder.java index 3fa1ef506e..fd2086b0ed 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketDecoder.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketDecoder.java @@ -23,9 +23,9 @@ import org.slf4j.LoggerFactory; * @author michal.polkorab */ public class OFDatagramPacketDecoder extends SimpleChannelInboundHandler { - private static final Logger LOG = LoggerFactory.getLogger(OFDatagramPacketDecoder.class); - private DeserializationFactory deserializationFactory; + + private DeserializationFactory deserializationFactory = null; @Override @SuppressWarnings("checkstyle:IllegalCatch") diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketEncoder.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketEncoder.java index f4f7f97dfa..573973cfce 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketEncoder.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketEncoder.java @@ -26,9 +26,9 @@ import org.slf4j.LoggerFactory; * @author michal.polkorab */ public class OFDatagramPacketEncoder extends MessageToMessageEncoder { - private static final Logger LOG = LoggerFactory.getLogger(OFDatagramPacketEncoder.class); - private SerializationFactory serializationFactory; + + private SerializationFactory serializationFactory = null; @Override @SuppressWarnings("checkstyle:IllegalCatch") diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java index 18c80e34c2..67bb0a3d32 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java @@ -5,8 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - - package org.opendaylight.openflowjava.protocol.impl.core; import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration; @@ -17,11 +15,11 @@ import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration * @author mirehak */ public interface ServerFacade extends ShutdownProvider, OnlineProvider, Runnable { - /** * Sets thread configuration. * * @param threadConfig desired thread configuration */ + @Deprecated(since = "0.17.2", forRemoval = true) void setThreadConfig(ThreadConfiguration threadConfig); } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java index 2c0f711f4e..9e8d1fa9be 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java @@ -40,7 +40,7 @@ public class TcpConnectionInitializer implements ServerFacade, ConnectionInitial * * @param workerGroup - shared worker group */ - public TcpConnectionInitializer(EventLoopGroup workerGroup, boolean isEpollEnabled) { + public TcpConnectionInitializer(final EventLoopGroup workerGroup, final boolean isEpollEnabled) { this.workerGroup = requireNonNull(workerGroup, "WorkerGroup can't be null"); this.isEpollEnabled = isEpollEnabled; } @@ -69,12 +69,13 @@ public class TcpConnectionInitializer implements ServerFacade, ConnectionInitial } @Override - public void setThreadConfig(ThreadConfiguration threadConfig) { + @Deprecated(since = "0.17.2", forRemoval = true) + public void setThreadConfig(final ThreadConfiguration threadConfig) { // IGNORE } @Override - public void initiateConnection(String host, int port) { + public void initiateConnection(final String host, final int port) { try { bootstrap.connect(host, port).sync(); } catch (InterruptedException e) { @@ -82,7 +83,7 @@ public class TcpConnectionInitializer implements ServerFacade, ConnectionInitial } } - public void setChannelInitializer(TcpChannelInitializer channelInitializer) { + public void setChannelInitializer(final TcpChannelInitializer channelInitializer) { this.channelInitializer = channelInitializer; } } diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java index 9ca513ae0e..25789dcc1d 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java @@ -55,7 +55,6 @@ public class TcpHandler implements ServerFacade { private EventLoopGroup workerGroup; private EventLoopGroup bossGroup; private final SettableFuture isOnlineFuture = SettableFuture.create(); - private ThreadConfiguration threadConfig; private TcpChannelInitializer channelInitializer; @@ -66,7 +65,7 @@ public class TcpHandler implements ServerFacade { * * @param port listening port of TCPHandler server */ - public TcpHandler(final int port, Runnable readyRunnable) { + public TcpHandler(final int port, final Runnable readyRunnable) { this(null, port, readyRunnable); } @@ -75,9 +74,9 @@ public class TcpHandler implements ServerFacade { * @param address listening address of TCPHandler server * @param port listening port of TCPHandler server */ - public TcpHandler(final InetAddress address, final int port, Runnable readyRunnable) { + public TcpHandler(final InetAddress address, final int port, final Runnable readyRunnable) { this.port = port; - this.startupAddress = address; + startupAddress = address; this.readyRunnable = readyRunnable; } @@ -132,7 +131,7 @@ public class TcpHandler implements ServerFacade { address = isa.getHostString(); // Update port, as it may have been specified as 0 - this.port = isa.getPort(); + port = isa.getPort(); LOG.debug("address from tcphandler: {}", address); LOG.info("Switch listener started and ready to accept incoming tcp/tls connections on port: {}", port); @@ -187,13 +186,14 @@ public class TcpHandler implements ServerFacade { return address; } - public void setChannelInitializer(TcpChannelInitializer channelInitializer) { + public void setChannelInitializer(final TcpChannelInitializer channelInitializer) { this.channelInitializer = channelInitializer; } @Override - public void setThreadConfig(ThreadConfiguration threadConfig) { - this.threadConfig = threadConfig; + @Deprecated(since = "0.17.2", forRemoval = true) + public void setThreadConfig(final ThreadConfiguration threadConfig) { + // No-op } /** @@ -201,7 +201,7 @@ public class TcpHandler implements ServerFacade { * * @param threadConfiguration number of threads to be created, if not specified in threadConfig */ - public void initiateEventLoopGroups(ThreadConfiguration threadConfiguration, boolean isEpollEnabled) { + public void initiateEventLoopGroups(final ThreadConfiguration threadConfiguration, final boolean isEpollEnabled) { if (isEpollEnabled) { initiateEpollEventLoopGroups(threadConfiguration); } else { @@ -214,7 +214,7 @@ public class TcpHandler implements ServerFacade { * * @param threadConfiguration number of threads to be created, if not specified in threadConfig */ - public void initiateNioEventLoopGroups(ThreadConfiguration threadConfiguration) { + public void initiateNioEventLoopGroups(final ThreadConfiguration threadConfiguration) { socketChannelClass = NioServerSocketChannel.class; if (threadConfiguration != null) { bossGroup = new NioEventLoopGroup(threadConfiguration.getBossThreadCount()); @@ -232,7 +232,7 @@ public class TcpHandler implements ServerFacade { * @param threadConfiguration the ThreadConfiguration */ @SuppressWarnings("checkstyle:IllegalCatch") - protected void initiateEpollEventLoopGroups(ThreadConfiguration threadConfiguration) { + protected void initiateEpollEventLoopGroups(final ThreadConfiguration threadConfiguration) { try { socketChannelClass = EpollServerSocketChannel.class; if (threadConfiguration != null) { diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java index 3a373c96b0..f4ad4b2e4a 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java @@ -39,8 +39,8 @@ public final class UdpHandler implements ServerFacade { private final InetAddress startupAddress; private final Runnable readyRunnable; private final SettableFuture isOnlineFuture = SettableFuture.create(); + private UdpChannelInitializer channelInitializer; - private ThreadConfiguration threadConfig; private Class datagramChannelClass; /** @@ -48,7 +48,7 @@ public final class UdpHandler implements ServerFacade { * * @param port listening port of UdpHandler server */ - public UdpHandler(final int port, Runnable readyRunnable) { + public UdpHandler(final int port, final Runnable readyRunnable) { this(null, port, readyRunnable); } @@ -57,9 +57,9 @@ public final class UdpHandler implements ServerFacade { * @param address listening address of UdpHandler server * @param port listening port of UdpHandler server */ - public UdpHandler(final InetAddress address, final int port, Runnable readyRunnable) { + public UdpHandler(final InetAddress address, final int port, final Runnable readyRunnable) { this.port = port; - this.startupAddress = address; + startupAddress = address; this.readyRunnable = readyRunnable; } @@ -91,7 +91,7 @@ public final class UdpHandler implements ServerFacade { String address = isa.getHostString(); // Update port, as it may have been specified as 0 - this.port = isa.getPort(); + port = isa.getPort(); LOG.debug("Address from udpHandler: {}", address); LOG.info("Switch listener started and ready to accept incoming udp connections on port: {}", port); @@ -128,13 +128,14 @@ public final class UdpHandler implements ServerFacade { return port; } - public void setChannelInitializer(UdpChannelInitializer channelInitializer) { + public void setChannelInitializer(final UdpChannelInitializer channelInitializer) { this.channelInitializer = channelInitializer; } @Override - public void setThreadConfig(ThreadConfiguration threadConfig) { - this.threadConfig = threadConfig; + @Deprecated(since = "0.17.2", forRemoval = true) + public void setThreadConfig(final ThreadConfiguration threadConfig) { + // No-op } /** @@ -142,7 +143,7 @@ public final class UdpHandler implements ServerFacade { * * @param threadConfiguration number of threads to be created, if not specified in threadConfig */ - public void initiateEventLoopGroups(ThreadConfiguration threadConfiguration, boolean isEpollEnabled) { + public void initiateEventLoopGroups(final ThreadConfiguration threadConfiguration, final boolean isEpollEnabled) { if (isEpollEnabled) { initiateEpollEventLoopGroups(threadConfiguration); } else { @@ -155,7 +156,7 @@ public final class UdpHandler implements ServerFacade { * * @param threadConfiguration number of threads to be created, if not specified in threadConfig */ - public void initiateNioEventLoopGroups(ThreadConfiguration threadConfiguration) { + public void initiateNioEventLoopGroups(final ThreadConfiguration threadConfiguration) { datagramChannelClass = NioDatagramChannel.class; if (threadConfiguration != null) { group = new NioEventLoopGroup(threadConfiguration.getWorkerThreadCount()); @@ -170,7 +171,7 @@ public final class UdpHandler implements ServerFacade { * @param threadConfiguration the ThreadConfiguration */ @SuppressWarnings("checkstyle:IllegalCatch") - protected void initiateEpollEventLoopGroups(ThreadConfiguration threadConfiguration) { + protected void initiateEpollEventLoopGroups(final ThreadConfiguration threadConfiguration) { try { datagramChannelClass = EpollDatagramChannel.class; if (threadConfiguration != null) { diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactory.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactory.java index 4ab309a272..c9a4357552 100755 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactory.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactory.java @@ -38,16 +38,15 @@ import org.slf4j.LoggerFactory; * @author timotej.kubas * @author michal.polkorab */ -public class MeterModInputMessageFactory implements OFSerializer, - SerializerRegistryInjector { +public class MeterModInputMessageFactory implements OFSerializer, SerializerRegistryInjector { + private static final Logger LOG = LoggerFactory .getLogger(MeterModInputMessageFactory.class); - private static final Logger LOG = LoggerFactory - .getLogger(MeterModInputMessageFactory.class); private static final byte MESSAGE_TYPE = 29; private static final short LENGTH_OF_METER_BANDS = 16; private static final short PADDING_IN_METER_BAND_DROP = 4; private static final short PADDING_IN_METER_BAND_DSCP_REMARK = 3; - private SerializerRegistry registry; + + private SerializerRegistry registry = null; @Override public void serialize(final MeterModInput message, final ByteBuf outBuffer) { @@ -71,19 +70,16 @@ public class MeterModInputMessageFactory implements OFSerializer, if (bands != null) { for (Bands currentBand : bands) { MeterBand meterBand = currentBand.getMeterBand(); - if (meterBand instanceof MeterBandDropCase) { - MeterBandDropCase dropBandCase = (MeterBandDropCase) meterBand; + if (meterBand instanceof MeterBandDropCase dropBandCase) { MeterBandDrop dropBand = dropBandCase.getMeterBandDrop(); writeBandCommonFields(dropBand, outBuffer); outBuffer.writeZero(PADDING_IN_METER_BAND_DROP); - } else if (meterBand instanceof MeterBandDscpRemarkCase) { - MeterBandDscpRemarkCase dscpRemarkBandCase = (MeterBandDscpRemarkCase) meterBand; + } else if (meterBand instanceof MeterBandDscpRemarkCase dscpRemarkBandCase) { MeterBandDscpRemark dscpRemarkBand = dscpRemarkBandCase.getMeterBandDscpRemark(); writeBandCommonFields(dscpRemarkBand, outBuffer); outBuffer.writeByte(dscpRemarkBand.getPrecLevel().toJava()); outBuffer.writeZero(PADDING_IN_METER_BAND_DSCP_REMARK); - } else if (meterBand instanceof MeterBandExperimenterCase) { - MeterBandExperimenterCase experimenterBandCase = (MeterBandExperimenterCase) meterBand; + } else if (meterBand instanceof MeterBandExperimenterCase experimenterBandCase) { MeterBandExperimenter experimenterBand = experimenterBandCase.getMeterBandExperimenter(); ExperimenterIdMeterBand expIdMeterBand = experimenterBand.augmentation(ExperimenterIdMeterBand.class); diff --git a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer.java b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer.java index b208e9e449..0da56924fe 100644 --- a/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer.java +++ b/openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer.java @@ -34,7 +34,8 @@ public class OF13MatchSerializer implements OFSerializer, SerializerRegis private static final Logger LOG = LoggerFactory.getLogger(OF13MatchSerializer.class); private static final byte STANDARD_MATCH_TYPE_CODE = 0; private static final byte OXM_MATCH_TYPE_CODE = 1; - private SerializerRegistry registry; + + private SerializerRegistry registry = null; @Override public void serialize(final Match match, final ByteBuf outBuffer) { diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/ConnectionContextImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/ConnectionContextImpl.java index a4fa77a4e8..e4834f2ad8 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/ConnectionContextImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/ConnectionContextImpl.java @@ -40,17 +40,17 @@ import org.slf4j.LoggerFactory; public class ConnectionContextImpl implements ConnectionContext { private static final Logger LOG = LoggerFactory.getLogger(ConnectionContextImpl.class); + private final List portStatusMessages = new ArrayList<>(); private final ConnectionAdapter connectionAdapter; + private volatile CONNECTION_STATE connectionState; - private FeaturesReply featuresReply; + private FeaturesReply featuresReply = null; private NodeId nodeId; private DeviceDisconnectedHandler deviceDisconnectedHandler; private OutboundQueueProvider outboundQueueProvider; private OutboundQueueHandlerRegistration outboundQueueHandlerRegistration; - private HandshakeContext handshakeContext; - private DeviceInfo deviceInfo; - private final List portStatusMessages = new ArrayList<>(); - private final DeviceConnectionStatusProvider deviceConnectionStatusProvider; + private HandshakeContext handshakeContext = null; + private DeviceInfo deviceInfo = null; /** * Constructor. @@ -60,7 +60,6 @@ public class ConnectionContextImpl implements ConnectionContext { public ConnectionContextImpl(final ConnectionAdapter connectionAdapter, final DeviceConnectionStatusProvider deviceConnectionStatusProvider) { this.connectionAdapter = connectionAdapter; - this.deviceConnectionStatusProvider = deviceConnectionStatusProvider; } @Override diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/listener/HandshakeListenerImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/listener/HandshakeListenerImpl.java index f087f27440..db89457588 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/listener/HandshakeListenerImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/listener/HandshakeListenerImpl.java @@ -29,13 +29,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class HandshakeListenerImpl implements HandshakeListener { - private static final Logger LOG = LoggerFactory.getLogger(HandshakeListenerImpl.class); private static final Logger OF_EVENT_LOG = LoggerFactory.getLogger("OfEventLog"); private final ConnectionContext connectionContext; private final DeviceConnectedHandler deviceConnectedHandler; - private HandshakeContext handshakeContext; + + private HandshakeContext handshakeContext = null; /** * Constructor. @@ -55,7 +55,7 @@ public class HandshakeListenerImpl implements HandshakeListener { LOG.debug("handshake succeeded: {}", connectionContext.getConnectionAdapter().getRemoteAddress()); } OF_EVENT_LOG.debug("Connect, Node: {}", featureOutput.getDatapathId()); - this.handshakeContext.close(); + handshakeContext.close(); connectionContext.changeStateToWorking(); connectionContext.setFeatures(featureOutput); connectionContext.setNodeId(InventoryDataServiceUtil.nodeIdFromDatapathId(featureOutput.getDatapathId())); @@ -104,16 +104,16 @@ public class HandshakeListenerImpl implements HandshakeListener { .setXid(xid) .setVersion(version) .build(); - return this.connectionContext.getConnectionAdapter().barrier(barrierInput); + return connectionContext.getConnectionAdapter().barrier(barrierInput); } @Override public void onHandshakeFailure() { if (LOG.isDebugEnabled()) { - LOG.debug("handshake failed: {}", this.connectionContext.getConnectionAdapter().getRemoteAddress()); + LOG.debug("handshake failed: {}", connectionContext.getConnectionAdapter().getRemoteAddress()); } - this.handshakeContext.close(); - this.connectionContext.closeConnection(false); + handshakeContext.close(); + connectionContext.closeConnection(false); } @Override diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/MatchDeserializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/MatchDeserializer.java index 47ee1a6c77..d655953c69 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/MatchDeserializer.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/MatchDeserializer.java @@ -29,11 +29,12 @@ import org.slf4j.LoggerFactory; public class MatchDeserializer implements OFDeserializer, HeaderDeserializer, MatchEntryDeserializerRegistry, MatchEntryDeserializer, DeserializerRegistryInjector { - private static final Logger LOG = LoggerFactory.getLogger(MatchDeserializer.class); + private final Map entryRegistry = new HashMap<>(); private final MatchPath matchPath; - private DeserializerRegistry registry; + + private DeserializerRegistry registry = null; public MatchDeserializer(final MatchPath matchPath) { this.matchPath = matchPath; diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyExperimenterDeserializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyExperimenterDeserializer.java index 514fae0b79..47ab711202 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyExperimenterDeserializer.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyExperimenterDeserializer.java @@ -25,13 +25,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.experimenter.core.message.ExperimenterMessageOfChoice; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.multipart.reply.multipart.reply.body.MultipartReplyExperimenterBuilder; import org.opendaylight.yangtools.yang.common.Uint32; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class MultipartReplyExperimenterDeserializer implements OFDeserializer, DeserializerRegistryInjector { - private static final Logger LOG = LoggerFactory.getLogger(MultipartReplyExperimenterDeserializer.class); - private DeserializerRegistry registry; + private DeserializerRegistry registry = null; @Override @SuppressWarnings("unchecked") diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyTableFeaturesDeserializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyTableFeaturesDeserializer.java index 954796c48e..9b11140fbd 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyTableFeaturesDeserializer.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyTableFeaturesDeserializer.java @@ -78,7 +78,7 @@ public class MultipartReplyTableFeaturesDeserializer implements OFDeserializer, HeaderSerializer, MatchEntrySerializerRegistry, SerializerRegistryInjector { - private static final Logger LOG = LoggerFactory.getLogger(MatchSerializer.class); private static final byte OXM_MATCH_TYPE_CODE = 1; private final Map entryRegistry = new LinkedHashMap<>(); - private SerializerRegistry registry; + private SerializerRegistry registry = null; @Override public void serialize(final Match match, final ByteBuf outBuffer) { diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/MeterMessageSerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/MeterMessageSerializer.java index 6241e38387..c7069887fa 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/MeterMessageSerializer.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/MeterMessageSerializer.java @@ -40,7 +40,7 @@ public class MeterMessageSerializer extends AbstractMessageSerializer>> lastRoleFuture = new AtomicReference<>(); private final Collection> requestContexts = new HashSet<>(); + private final DeviceInfo deviceInfo; + private final HashedWheelTimer timer; private final Timeout slaveTask; private final OpenflowProviderConfig config; private final ExecutorService executorService; private ContextChainMastershipWatcher contextChainMastershipWatcher; - private SalRoleService roleService; + private SalRoleService roleService = null; RoleContextImpl(@NonNull final DeviceInfo deviceInfo, @NonNull final HashedWheelTimer timer, @@ -68,8 +68,7 @@ public class RoleContextImpl implements RoleContext { this.executorService = executorService; slaveTask = timer.newTimeout(timerTask -> makeDeviceSlave(), checkRoleMasterTimeout, TimeUnit.MILLISECONDS); - LOG.info("Started timer for setting SLAVE role on device {} if no role will be set in {}s.", - deviceInfo, + LOG.info("Started timer for setting SLAVE role on device {} if no role will be set in {}s.", deviceInfo, checkRoleMasterTimeout / 1000L); } @@ -85,7 +84,7 @@ public class RoleContextImpl implements RoleContext { @Override public void registerMastershipWatcher(@NonNull final ContextChainMastershipWatcher newWatcher) { - this.contextChainMastershipWatcher = newWatcher; + contextChainMastershipWatcher = newWatcher; } @Override diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImpl.java index 3ac23e840c..2911a89b16 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImpl.java @@ -57,7 +57,8 @@ class RpcContextImpl implements RpcContext { private final ExtensionConverterProvider extensionConverterProvider; private final ConvertorExecutor convertorExecutor; private final NotificationPublishService notificationPublishService; - private ContextChainMastershipWatcher contextChainMastershipWatcher; + + private ContextChainMastershipWatcher contextChainMastershipWatcher = null; RpcContextImpl(@NonNull final RpcProviderService rpcProviderRegistry, final int maxRequests, @@ -67,15 +68,15 @@ class RpcContextImpl implements RpcContext { @NonNull final NotificationPublishService notificationPublishService, final boolean statisticsRpcEnabled) { this.deviceContext = deviceContext; - this.deviceInfo = deviceContext.getDeviceInfo(); - this.nodeInstanceIdentifier = deviceContext.getDeviceInfo().getNodeInstanceIdentifier(); - this.messageSpy = deviceContext.getMessageSpy(); + deviceInfo = deviceContext.getDeviceInfo(); + nodeInstanceIdentifier = deviceContext.getDeviceInfo().getNodeInstanceIdentifier(); + messageSpy = deviceContext.getMessageSpy(); this.rpcProviderRegistry = rpcProviderRegistry; this.extensionConverterProvider = extensionConverterProvider; this.notificationPublishService = notificationPublishService; this.convertorExecutor = convertorExecutor; - this.isStatisticsRpcEnabled = statisticsRpcEnabled; - this.tracker = new Semaphore(maxRequests, true); + isStatisticsRpcEnabled = statisticsRpcEnabled; + tracker = new Semaphore(maxRequests, true); } @Override @@ -161,17 +162,17 @@ class RpcContextImpl implements RpcContext { @VisibleForTesting boolean isEmptyRpcRegistrations() { - return this.rpcRegistrations.isEmpty(); + return rpcRegistrations.isEmpty(); } @Override public DeviceInfo getDeviceInfo() { - return this.deviceInfo; + return deviceInfo; } @Override public void registerMastershipWatcher(@NonNull final ContextChainMastershipWatcher newWatcher) { - this.contextChainMastershipWatcher = newWatcher; + contextChainMastershipWatcher = newWatcher; } @Override diff --git a/parent/pom.xml b/parent/pom.xml index 8da330554c..4dec25895a 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -12,7 +12,7 @@ org.opendaylight.mdsal binding-parent - 12.0.3 + 12.0.4 @@ -41,14 +41,14 @@ org.opendaylight.controller controller-artifacts - 8.0.3 + 8.0.4 pom import org.opendaylight.infrautils infrautils-artifacts - 6.0.4 + 6.0.5 pom import diff --git a/samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/LearningSwitchManagerSimpleImpl.java b/samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/LearningSwitchManagerSimpleImpl.java index d624643a45..26c582bbc6 100644 --- a/samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/LearningSwitchManagerSimpleImpl.java +++ b/samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/LearningSwitchManagerSimpleImpl.java @@ -35,13 +35,13 @@ import org.slf4j.LoggerFactory; */ public class LearningSwitchManagerSimpleImpl implements DataTreeChangeListenerRegistrationHolder, LearningSwitchManager { - private static final Logger LOG = LoggerFactory.getLogger(LearningSwitchManagerSimpleImpl.class); - private NotificationService notificationService; + + private NotificationService notificationService = null; private PacketProcessingService packetProcessingService; - private DataBroker data; - private Registration packetInRegistration; - private ListenerRegistration dataTreeChangeListenerRegistration; + private DataBroker data = null; + private Registration packetInRegistration = null; + private ListenerRegistration dataTreeChangeListenerRegistration = null; /** * Sets the NotificationService. @@ -49,7 +49,7 @@ public class LearningSwitchManagerSimpleImpl * @param notificationService the notificationService to set */ @Override - public void setNotificationService(NotificationService notificationService) { + public void setNotificationService(final NotificationService notificationService) { this.notificationService = notificationService; } @@ -60,7 +60,7 @@ public class LearningSwitchManagerSimpleImpl */ @Override public void setPacketProcessingService( - PacketProcessingService packetProcessingService) { + final PacketProcessingService packetProcessingService) { this.packetProcessingService = packetProcessingService; } @@ -68,7 +68,7 @@ public class LearningSwitchManagerSimpleImpl * Sets the DataBroker. */ @Override - public void setDataBroker(DataBroker broker) { + public void setDataBroker(final DataBroker broker) { data = broker; } diff --git a/samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/WakeupOnNode.java b/samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/WakeupOnNode.java index 32b72cf7d4..c355cc4f4f 100644 --- a/samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/WakeupOnNode.java +++ b/samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/WakeupOnNode.java @@ -8,38 +8,31 @@ package org.opendaylight.openflowplugin.learningswitch; import java.util.Collection; -import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType; import org.opendaylight.mdsal.binding.api.DataTreeChangeListener; import org.opendaylight.mdsal.binding.api.DataTreeModification; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; -import org.opendaylight.yangtools.yang.binding.DataObject; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.common.Uint8; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class WakeupOnNode implements DataTreeChangeListener { - private static final Logger LOG = LoggerFactory.getLogger(WakeupOnNode.class); - private LearningSwitchHandler learningSwitchHandler; + + private LearningSwitchHandler learningSwitchHandler = null; @Override - public void onDataTreeChanged(@NonNull Collection> modifications) { + public void onDataTreeChanged(final Collection> modifications) { Uint8 requiredTableId = Uint8.ZERO; // TODO add flow - for (DataTreeModification
modification : modifications) { + for (var modification : modifications) { if (modification.getRootNode().getModificationType() == ModificationType.SUBTREE_MODIFIED) { - DataObject table = modification.getRootNode().getDataAfter(); - if (table instanceof Table) { - Table tableSure = (Table) table; + var table = modification.getRootNode().getDataAfter(); + if (table != null) { LOG.trace("table: {}", table); - - if (requiredTableId.equals(tableSure.getId())) { - InstanceIdentifier
tablePath = - modification.getRootPath().getRootIdentifier(); - learningSwitchHandler.onSwitchAppeared(tablePath); + if (requiredTableId.equals(table.getId())) { + learningSwitchHandler.onSwitchAppeared(modification.getRootPath().getRootIdentifier()); } } } @@ -51,8 +44,7 @@ public class WakeupOnNode implements DataTreeChangeListener
{ * * @param learningSwitchHandler the learningSwitchHandler to set */ - public void setLearningSwitchHandler( - LearningSwitchHandler learningSwitchHandler) { + public void setLearningSwitchHandler(final LearningSwitchHandler learningSwitchHandler) { this.learningSwitchHandler = learningSwitchHandler; } } diff --git a/samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/multi/LearningSwitchManagerMultiImpl.java b/samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/multi/LearningSwitchManagerMultiImpl.java index 9a8a03d874..7ad5bcea92 100644 --- a/samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/multi/LearningSwitchManagerMultiImpl.java +++ b/samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/multi/LearningSwitchManagerMultiImpl.java @@ -39,13 +39,13 @@ import org.slf4j.LoggerFactory; * */ public class LearningSwitchManagerMultiImpl implements DataTreeChangeListenerRegistrationHolder, LearningSwitchManager { - private static final Logger LOG = LoggerFactory.getLogger(LearningSwitchManagerMultiImpl.class); - private NotificationService notificationService; + + private NotificationService notificationService = null; private PacketProcessingService packetProcessingService; - private DataBroker data; - private Registration packetInRegistration; - private ListenerRegistration dataTreeChangeListenerRegistration; + private DataBroker data = null; + private Registration packetInRegistration = null; + private ListenerRegistration dataTreeChangeListenerRegistration = null; /** * Sets the NotificationService. @@ -53,7 +53,7 @@ public class LearningSwitchManagerMultiImpl implements DataTreeChangeListenerReg * @param notificationService the notificationService to set */ @Override - public void setNotificationService(NotificationService notificationService) { + public void setNotificationService(final NotificationService notificationService) { this.notificationService = notificationService; } @@ -64,7 +64,7 @@ public class LearningSwitchManagerMultiImpl implements DataTreeChangeListenerReg */ @Override public void setPacketProcessingService( - PacketProcessingService packetProcessingService) { + final PacketProcessingService packetProcessingService) { this.packetProcessingService = packetProcessingService; } @@ -74,7 +74,7 @@ public class LearningSwitchManagerMultiImpl implements DataTreeChangeListenerReg * @param broker the data to set */ @Override - public void setDataBroker(DataBroker broker) { + public void setDataBroker(final DataBroker broker) { data = broker; } diff --git a/samples/pom.xml b/samples/pom.xml index 253c588f2a..330f63081f 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 13.0.7 + 13.0.10 diff --git a/samples/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/CallableClient.java b/samples/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/CallableClient.java index fc70a14f35..d1c5ca2402 100644 --- a/samples/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/CallableClient.java +++ b/samples/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/CallableClient.java @@ -15,6 +15,7 @@ import io.netty.channel.EventLoopGroup; import io.netty.channel.socket.nio.NioSocketChannel; import java.net.InetAddress; import java.util.concurrent.Callable; +import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** @@ -24,8 +25,7 @@ import org.slf4j.LoggerFactory; * @author Jozef Bacigal */ public class CallableClient implements Callable, OFClient { - - private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(CallableClient.class); + private static final Logger LOG = LoggerFactory.getLogger(CallableClient.class); private int port = 6653; private boolean securedClient = false; @@ -33,8 +33,8 @@ public class CallableClient implements Callable, OFClient { private String name = "Empty name"; private final EventLoopGroup workerGroup; - private SettableFuture isOnlineFuture; - private SettableFuture scenarioDone; + private final SettableFuture isOnlineFuture = null; + private final SettableFuture scenarioDone = null; private ScenarioHandler scenarioHandler = null; private Bootstrap bootstrap = null; @@ -49,7 +49,7 @@ public class CallableClient implements Callable, OFClient { this.port = port; this.securedClient = securedClient; this.ipAddress = requireNonNull(ipAddress, "IP address cannot be null"); - this.workerGroup = eventExecutors; + workerGroup = eventExecutors; this.bootstrap = bootstrap; this.name = name; this.scenarioHandler = requireNonNull(scenarioHandler, "Scenario handler cannot be null"); @@ -67,7 +67,7 @@ public class CallableClient implements Callable, OFClient { @Override public void setScenarioHandler(final ScenarioHandler scenario) { - this.scenarioHandler = scenario; + scenarioHandler = scenario; } @Override @@ -81,7 +81,7 @@ public class CallableClient implements Callable, OFClient { public Boolean call() throws Exception { requireNonNull(bootstrap); requireNonNull(workerGroup); - LOG.info("Switch {} trying connect to controller", this.name); + LOG.info("Switch {} trying connect to controller", name); SimpleClientInitializer clientInitializer = new SimpleClientInitializer(isOnlineFuture, securedClient); clientInitializer.setScenario(scenarioHandler); try { @@ -101,9 +101,9 @@ public class CallableClient implements Callable, OFClient { return false; } if (scenarioHandler.isFinishedOK()) { - LOG.info("Device {} finished scenario OK", this.name); + LOG.info("Device {} finished scenario OK", name); } else { - LOG.error("Device {} finished scenario with error", this.name); + LOG.error("Device {} finished scenario with error", name); } return scenarioHandler.isFinishedOK(); diff --git a/samples/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SendEvent.java b/samples/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SendEvent.java index fa4936a3b3..f733b10640 100644 --- a/samples/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SendEvent.java +++ b/samples/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SendEvent.java @@ -20,17 +20,17 @@ import org.slf4j.LoggerFactory; * @author michal.polkorab */ public class SendEvent implements ClientEvent { - private static final Logger LOG = LoggerFactory.getLogger(SendEvent.class); + protected byte[] msgToSend; - protected ChannelHandlerContext ctx; + protected ChannelHandlerContext ctx = null; /** * Constructor. * * @param msgToSend message to be sent */ - public SendEvent(byte[] msgToSend) { + public SendEvent(final byte[] msgToSend) { this.msgToSend = new byte[msgToSend.length]; System.arraycopy(msgToSend, 0, this.msgToSend, 0, msgToSend.length); } @@ -55,8 +55,7 @@ public class SendEvent implements ClientEvent { * * @param ctx context which will be used for sending messages (SendEvents) */ - public void setCtx(ChannelHandlerContext ctx) { + public void setCtx(final ChannelHandlerContext ctx) { this.ctx = ctx; } - } diff --git a/test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestCommiter.java b/test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestCommiter.java index 6bb4d4ca2c..beb60d7385 100644 --- a/test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestCommiter.java +++ b/test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestCommiter.java @@ -39,10 +39,7 @@ import org.slf4j.LoggerFactory; public class DropTestCommiter extends AbstractDropTest { private static final Logger LOG = LoggerFactory.getLogger(DropTestCommiter.class); private static final TableKey ZERO_TABLE = new TableKey(Uint8.ZERO); - private DataBroker dataService; - private static final AtomicLong ID_COUNTER = new AtomicLong(); - private static final ThreadLocal BUILDER = ThreadLocal.withInitial(() -> { final var cookie = new FlowCookie(Uint64.TEN); return new FlowBuilder() @@ -56,9 +53,9 @@ public class DropTestCommiter extends AbstractDropTest { .setFlags(new FlowModFlags(false, false, false, false, false)); }); - private NotificationService notificationService; - - private Registration notificationRegistration; + private NotificationService notificationService = null; + private Registration notificationRegistration = null; + private DataBroker dataService = null; /** * start listening on packetIn. diff --git a/test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestRpcSender.java b/test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestRpcSender.java index 885b119167..8906f8bf38 100644 --- a/test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestRpcSender.java +++ b/test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestRpcSender.java @@ -36,13 +36,6 @@ import org.slf4j.LoggerFactory; */ public class DropTestRpcSender extends AbstractDropTest { private static final Logger LOG = LoggerFactory.getLogger(DropTestRpcSender.class); - - private SalFlowService flowService; - - public void setFlowService(final SalFlowService flowService) { - this.flowService = flowService; - } - private static final ThreadLocal BUILDER = ThreadLocal.withInitial(() -> { final var cookie = new FlowCookie(Uint64.TEN); return new AddFlowInputBuilder() @@ -56,9 +49,13 @@ public class DropTestRpcSender extends AbstractDropTest { .setFlags(new FlowModFlags(false, false, false, false, false)); }); - private NotificationService notificationService; + private NotificationService notificationService = null; + private Registration notificationRegistration = null; + private SalFlowService flowService = null; - private Registration notificationRegistration; + public void setFlowService(final SalFlowService flowService) { + this.flowService = flowService; + } /** * Start listening on packetIn. diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkGroupTransactionProvider.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkGroupTransactionProvider.java index ce2880ef24..5c82d1d419 100644 --- a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkGroupTransactionProvider.java +++ b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkGroupTransactionProvider.java @@ -98,11 +98,12 @@ import org.slf4j.LoggerFactory; public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvider { private static final Logger LOG = LoggerFactory.getLogger(OpenflowPluginBulkGroupTransactionProvider.class); + private static final String ORIGINAL_FLOW_NAME = "Foo"; + private static final String ORIGINAL_GROUP_NAME = "Foo"; + private final DataBroker dataBroker; private final BundleContext ctx; - private final String originalFlowName = "Foo"; private Node testNode12; - private final String originalGroupName = "Foo"; public OpenflowPluginBulkGroupTransactionProvider(final DataBroker dataBroker, final BundleContext ctx) { this.dataBroker = dataBroker; @@ -306,7 +307,8 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid .build())); } - private FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg, final String tableId) { + private static FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg, + final String tableId) { FlowBuilder flow = new FlowBuilder(); long id = 123; @@ -409,7 +411,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid flow.withKey(key); flow.setPriority(Uint16.TWO); - flow.setFlowName(originalFlowName + "X" + flowType); + flow.setFlowName(ORIGINAL_FLOW_NAME + "X" + flowType); return flow; } @@ -629,7 +631,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid }, MoreExecutors.directExecutor()); } - private GroupBuilder createTestGroup(String actionType, String groupType, final String groupmod, + private static GroupBuilder createTestGroup(String actionType, String groupType, final String groupmod, final String strId) { // Sample data , committing to DataStore @@ -712,7 +714,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid return group.withKey(new GroupKey(new GroupId(Uint32.valueOf(strId)))) // .group.setInstall(false) - .setGroupName(originalGroupName) + .setGroupName(ORIGINAL_GROUP_NAME) .setBarrier(false) .setBuckets(new BucketsBuilder().setBucket(BindingMap.of(bucket.build())).build()); } diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkTransactionProvider.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkTransactionProvider.java index d7a97d4cc3..4d19dc7f64 100644 --- a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkTransactionProvider.java +++ b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkTransactionProvider.java @@ -104,10 +104,10 @@ import org.slf4j.LoggerFactory; public class OpenflowPluginBulkTransactionProvider implements CommandProvider { private static final Logger LOG = LoggerFactory.getLogger(OpenflowPluginBulkTransactionProvider.class); + private static final String ORIGINAL_FLOW_NAME = "Foo"; private final DataBroker dataBroker; private final BundleContext ctx; - private final String originalFlowName = "Foo"; public OpenflowPluginBulkTransactionProvider(final DataBroker dataBroker, final BundleContext ctx) { this.dataBroker = dataBroker; @@ -131,7 +131,8 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider { return "No help"; } - private FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg, final String tableId) { + private static FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg, + final String tableId) { FlowBuilder flow = new FlowBuilder(); long id = 123; @@ -394,7 +395,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider { FlowKey key = new FlowKey(new FlowId(Long.toString(id))); flow.withKey(key); flow.setPriority(Uint16.TWO); - flow.setFlowName(originalFlowName + "X" + flowType); + flow.setFlowName(ORIGINAL_FLOW_NAME + "X" + flowType); return flow; } @@ -417,49 +418,47 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider { FlowBuilder tf; FlowBuilder tf1; FlowBuilder tf2; - FlowBuilder tf3; - switch (flowcnt) { - case 1: + FlowBuilder tf3 = switch (flowcnt) { + case 1 -> { tf = createTestFlow(tn, "f1", "10"); tf1 = createTestFlow(tn, "f2", "11"); tf2 = createTestFlow(tn, "f3", "12"); - tf3 = createTestFlow(tn, "f4", "13"); - break; - case 2: + yield createTestFlow(tn, "f4", "13"); + } + case 2 -> { tf = createTestFlow(tn, "f3", "3"); tf1 = createTestFlow(tn, "f4", "4"); tf2 = createTestFlow(tn, "f5", "5"); - tf3 = createTestFlow(tn, "f6", "6"); - break; - case 3: + yield createTestFlow(tn, "f6", "6"); + } + case 3 -> { tf = createTestFlow(tn, "f7", "7"); tf1 = createTestFlow(tn, "f8", "8"); tf2 = createTestFlow(tn, "f9", "9"); - tf3 = createTestFlow(tn, "f10", "10"); - break; - case 4: + yield createTestFlow(tn, "f10", "10"); + } + case 4 -> { // -ve scenario tf = createTestFlow(tn, "f23", "3"); tf1 = createTestFlow(tn, "f34", "4"); tf2 = createTestFlow(tn, "f35", "5"); - tf3 = createTestFlow(tn, "f36", "6"); - break; - case 5: + yield createTestFlow(tn, "f36", "6"); + } + case 5 -> { // +ve scenario // modify case 6 -ve tf = createTestFlow(tn, "f230", "3"); tf1 = createTestFlow(tn, "f34", "4"); tf2 = createTestFlow(tn, "f35", "5"); - tf3 = createTestFlow(tn, "f36", "6"); - break; - - default: + yield createTestFlow(tn, "f36", "6"); + } + default -> { tf = createTestFlow(tn, "f42", "42"); tf1 = createTestFlow(tn, "f43", "43"); tf2 = createTestFlow(tn, "f44", "44"); - tf3 = createTestFlow(tn, "f45", "45"); - - } + yield createTestFlow(tn, "f45", "45"); + } + }; writeFlow(ci, tf, tf1, tf2, tf3, tn); } @@ -475,50 +474,47 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider { FlowBuilder tf; FlowBuilder tf1; FlowBuilder tf2; - FlowBuilder tf3; - switch (flowcnt) { - case 1: + FlowBuilder tf3 = switch (flowcnt) { + case 1 -> { tf = createTestFlow(tn, "f82", "10"); tf1 = createTestFlow(tn, "f83", "11"); tf2 = createTestFlow(tn, "f84", "12"); - tf3 = createTestFlow(tn, "f85", "13"); - break; - case 2: + yield createTestFlow(tn, "f85", "13"); + } + case 2 -> { tf = createTestFlow(tn, "f700", "3"); tf1 = createTestFlow(tn, "f4", "4"); tf2 = createTestFlow(tn, "f900", "5"); - tf3 = createTestFlow(tn, "f86", "6"); - break; - case 3: + yield createTestFlow(tn, "f86", "6"); + } + case 3 -> { // + tf = createTestFlow(tn, "f91", "7"); tf1 = createTestFlow(tn, "f92", "8"); tf2 = createTestFlow(tn, "f93", "9"); - tf3 = createTestFlow(tn, "f94", "10"); - break; - case 4: + yield createTestFlow(tn, "f94", "10"); + } + case 4 -> { // +ve scenario tf = createTestFlow(tn, "f230", "3"); tf1 = createTestFlow(tn, "f99", "4"); tf2 = createTestFlow(tn, "f100", "5"); - tf3 = createTestFlow(tn, "f101", "6"); - break; - case 5: + yield createTestFlow(tn, "f101", "6"); + } + case 5 -> { // - tf = createTestFlow(tn, "f23", "3"); tf1 = createTestFlow(tn, "f99", "4"); tf2 = createTestFlow(tn, "f100", "5"); - tf3 = createTestFlow(tn, "f101", "6"); - break; - - default: + yield createTestFlow(tn, "f101", "6"); + } + default -> { tf = createTestFlow(tn, "f87", "12"); tf1 = createTestFlow(tn, "f88", "13"); tf2 = createTestFlow(tn, "f89", "14"); - tf3 = createTestFlow(tn, "f90", "15"); - - } - + yield createTestFlow(tn, "f90", "15"); + } + }; writeFlow(ci, tf, tf1, tf2, tf3, tn); } @@ -532,74 +528,73 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider { FlowBuilder tf1 = null; FlowBuilder tf2 = null; FlowBuilder tf3 = null; - switch (flowcnt) { - case 1: + tf3 = switch (flowcnt) { + case 1 -> { // add case 1 tf = createTestFlow(tn, "f1", "10"); tf1 = createTestFlow(tn, "f2", "11"); tf2 = createTestFlow(tn, "f3", "12"); - tf3 = createTestFlow(tn, "f4", "13"); - break; - case 2: + yield createTestFlow(tn, "f4", "13"); + } + case 2 -> { // modify case 1 tf = createTestFlow(tn, "f82", "10"); tf1 = createTestFlow(tn, "f83", "11"); tf2 = createTestFlow(tn, "f84", "12"); - tf3 = createTestFlow(tn, "f85", "13"); - break; - case 3: + yield createTestFlow(tn, "f85", "13"); + } + case 3 -> { // add case 2 tf = createTestFlow(tn, "f3", "3"); tf1 = createTestFlow(tn, "f4", "4"); tf2 = createTestFlow(tn, "f5", "5"); - tf3 = createTestFlow(tn, "f6", "6"); - break; - case 4: + yield createTestFlow(tn, "f6", "6"); + } + case 4 -> { // modify case 2 tf = createTestFlow(tn, "f700", "3"); tf1 = createTestFlow(tn, "f4", "4"); tf2 = createTestFlow(tn, "f900", "5"); - tf3 = createTestFlow(tn, "f86", "6"); - break; - case 5: + yield createTestFlow(tn, "f86", "6"); + } + case 5 -> { // add case 3 tf = createTestFlow(tn, "f7", "7"); tf1 = createTestFlow(tn, "f8", "8"); tf2 = createTestFlow(tn, "f9", "9"); - tf3 = createTestFlow(tn, "f10", "10"); - break; - case 6: + yield createTestFlow(tn, "f10", "10"); + } + case 6 -> { // modify case 3 tf = createTestFlow(tn, "f91", "7"); tf1 = createTestFlow(tn, "f92", "8"); tf2 = createTestFlow(tn, "f93", "9"); - tf3 = createTestFlow(tn, "f94", "10"); - break; - case 7: + yield createTestFlow(tn, "f94", "10"); + } + case 7 -> { // -ve scenario tf = createTestFlow(tn, "f23", "3"); tf1 = createTestFlow(tn, "f34", "4"); tf2 = createTestFlow(tn, "f35", "5"); - tf3 = createTestFlow(tn, "f36", "6"); - break; - case 8: + yield createTestFlow(tn, "f36", "6"); + } + case 8 -> { // +ve scenario // modify case 6 -ve tf = createTestFlow(tn, "f23", "3"); tf1 = createTestFlow(tn, "f99", "4"); tf2 = createTestFlow(tn, "f100", "5"); - tf3 = createTestFlow(tn, "f101", "6"); - break; - case 9: + yield createTestFlow(tn, "f101", "6"); + } + case 9 -> { // modify case 6 tf = createTestFlow(tn, "f700", "7"); tf1 = createTestFlow(tn, "f230", "23"); tf2 = createTestFlow(tn, "f900", "9"); - tf3 = createTestFlow(tn, "f1000", "10"); - break; - default: - throw new IllegalArgumentException("Invalid flowtype: " + flowtype); - } + yield createTestFlow(tn, "f1000", "10"); + } + default -> throw new IllegalArgumentException("Invalid flowtype: " + flowtype); + }; InstanceIdentifier path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.key()) .augmentation(FlowCapableNode.class).child(Table.class, new TableKey(tf.getTableId())) diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginGroupTestServiceProvider.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginGroupTestServiceProvider.java index 17a2e79bf5..202081bda3 100644 --- a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginGroupTestServiceProvider.java +++ b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginGroupTestServiceProvider.java @@ -29,13 +29,11 @@ import org.opendaylight.yangtools.yang.common.RpcResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, - SalGroupService { +public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, SalGroupService { + private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginGroupTestServiceProvider.class); - private static final Logger LOG = LoggerFactory - .getLogger(OpenflowpluginGroupTestServiceProvider.class); - private ObjectRegistration groupRegistration; - private NotificationPublishService notificationService; + private ObjectRegistration groupRegistration = null; + private NotificationPublishService notificationService = null; /** * Get group registration. @@ -70,8 +68,7 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, } public void start() { - OpenflowpluginGroupTestServiceProvider.LOG - .info("SalGroupServiceProvider Started."); + LOG.info("SalGroupServiceProvider Started."); } /* @@ -81,8 +78,7 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, */ @Override public void close() { - OpenflowpluginGroupTestServiceProvider.LOG - .info("SalGroupServiceProvide stopped."); + LOG.info("SalGroupServiceProvide stopped."); groupRegistration.close(); } @@ -97,7 +93,7 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, */ @Override public ListenableFuture> addGroup(final AddGroupInput input) { - OpenflowpluginGroupTestServiceProvider.LOG.info("addGroup - {}", input); + LOG.info("addGroup - {}", input); return null; } @@ -111,9 +107,8 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, * .group.service.rev130918.RemoveGroupInput) */ @Override - public ListenableFuture> removeGroup( - final RemoveGroupInput input) { - OpenflowpluginGroupTestServiceProvider.LOG.info("removeGroup - {}", input); + public ListenableFuture> removeGroup(final RemoveGroupInput input) { + LOG.info("removeGroup - {}", input); return null; } @@ -127,9 +122,8 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, * .group.service.rev130918.UpdateGroupInput) */ @Override - public ListenableFuture> updateGroup( - final UpdateGroupInput input) { - OpenflowpluginGroupTestServiceProvider.LOG.info("updateGroup - {}", input); + public ListenableFuture> updateGroup(final UpdateGroupInput input) { + LOG.info("updateGroup - {}", input); return null; } diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestCommandProvider.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestCommandProvider.java index c04e4084bb..6c71f581f2 100644 --- a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestCommandProvider.java +++ b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestCommandProvider.java @@ -37,11 +37,10 @@ import org.opendaylight.yangtools.yang.binding.util.BindingMap; import org.opendaylight.yangtools.yang.common.Uint32; import org.opendaylight.yangtools.yang.common.Uint8; import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class OpenflowpluginMeterTestCommandProvider implements CommandProvider { - private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginMeterTestCommandProvider.class); + private static final String ORIGINAL_METER_NAME = "Foo"; + private static final String UPDATED_METER_NAME = "Bar"; private final DataBroker dataBroker; private final BundleContext ctx; @@ -49,8 +48,6 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider { private Meter testMeter1; private Meter testMeter2; private Node testNode; - private final String originalMeterName = "Foo"; - private final String updatedMeterName = "Bar"; public OpenflowpluginMeterTestCommandProvider(final DataBroker dataBroker, final BundleContext ctx) { this.dataBroker = dataBroker; @@ -81,7 +78,7 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider { .setContainerName("abcd") .withKey(new MeterKey(new MeterId(Uint32.valueOf(12)))) .setMeterId(new MeterId(Uint32.valueOf(9))) - .setMeterName(originalMeterName) + .setMeterName(ORIGINAL_METER_NAME) .setFlags(new MeterFlags(true, false, false, false)) .setMeterBandHeaders(new MeterBandHeadersBuilder() .setMeterBandHeader(BindingMap.of(new MeterBandHeaderBuilder() @@ -119,10 +116,10 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider { .setBandId(new BandId(Uint32.ZERO)); if (s2.equalsIgnoreCase("modify")) { - meter.setMeterName(updatedMeterName); + meter.setMeterName(UPDATED_METER_NAME); bandHeader.setBandRate(Uint32.valueOf(234)); } else { - meter.setMeterName(originalMeterName); + meter.setMeterName(ORIGINAL_METER_NAME); bandHeader.setBandRate(Uint32.valueOf(123)); } @@ -375,9 +372,9 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider { createUserNode(nref); } MeterBuilder meter = createTestMeter(); - meter.setMeterName(updatedMeterName); + meter.setMeterName(UPDATED_METER_NAME); writeMeter(ci, meter.build()); - meter.setMeterName(originalMeterName); + meter.setMeterName(ORIGINAL_METER_NAME); writeMeter(ci, meter.build()); } diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestServiceProvider.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestServiceProvider.java index 3a54042e9c..b70ebccc09 100644 --- a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestServiceProvider.java +++ b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestServiceProvider.java @@ -30,13 +30,12 @@ import org.opendaylight.yangtools.yang.common.RpcResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, - SalMeterService { - private static final Logger LOG = LoggerFactory - .getLogger(OpenflowpluginMeterTestServiceProvider.class); - private DataBroker dataService; - private ObjectRegistration meterRegistration; - private NotificationPublishService notificationService; +public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, SalMeterService { + private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginMeterTestServiceProvider.class); + + private DataBroker dataService = null; + private ObjectRegistration meterRegistration = null; + private NotificationPublishService notificationService = null; /** * Gets the data service. @@ -44,7 +43,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, * @return {@link #dataService} */ public DataBroker getDataService() { - return this.dataService; + return dataService; } /** @@ -60,7 +59,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, * @return {@link #meterRegistration} */ public ObjectRegistration getMeterRegistration() { - return this.meterRegistration; + return meterRegistration; } /** @@ -76,7 +75,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, * @return {@link #notificationService} */ public NotificationPublishService getNotificationService() { - return this.notificationService; + return notificationService; } /** @@ -87,8 +86,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, } public void start() { - OpenflowpluginMeterTestServiceProvider.LOG - .info("SalMeterServiceProvider Started."); + LOG.info("SalMeterServiceProvider Started."); } /* @@ -98,8 +96,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, */ @Override public void close() { - OpenflowpluginMeterTestServiceProvider.LOG - .info("SalMeterServiceProvide stopped."); + LOG.info("SalMeterServiceProvide stopped."); meterRegistration.close(); } @@ -114,7 +111,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, */ @Override public ListenableFuture> addMeter(final AddMeterInput input) { - OpenflowpluginMeterTestServiceProvider.LOG.info("addMeter - {}", input); + LOG.info("addMeter - {}", input); return null; } @@ -128,9 +125,8 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, * .meter.service.rev130918.RemoveMeterInput) */ @Override - public ListenableFuture> removeMeter( - final RemoveMeterInput input) { - OpenflowpluginMeterTestServiceProvider.LOG.info("removeMeter - {}", input); + public ListenableFuture> removeMeter(final RemoveMeterInput input) { + LOG.info("removeMeter - {}", input); return null; } @@ -144,9 +140,8 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, * .meter.service.rev130918.UpdateMeterInput) */ @Override - public ListenableFuture> updateMeter( - final UpdateMeterInput input) { - OpenflowpluginMeterTestServiceProvider.LOG.info("updateMeter - {}", input); + public ListenableFuture> updateMeter(final UpdateMeterInput input) { + LOG.info("updateMeter - {}", input); return null; } diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTableFeaturesTestServiceProvider.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTableFeaturesTestServiceProvider.java index 64836a6578..e618a7c808 100644 --- a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTableFeaturesTestServiceProvider.java +++ b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTableFeaturesTestServiceProvider.java @@ -15,22 +15,23 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService; +import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTable; import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutputBuilder; import org.opendaylight.yangtools.concepts.AbstractObjectRegistration; import org.opendaylight.yangtools.concepts.ObjectRegistration; +import org.opendaylight.yangtools.concepts.Registration; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.common.RpcResult; +import org.opendaylight.yangtools.yang.common.RpcResultBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class OpenflowpluginTableFeaturesTestServiceProvider implements - AutoCloseable, SalTableService { +public class OpenflowpluginTableFeaturesTestServiceProvider implements AutoCloseable, UpdateTable { + private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginTableFeaturesTestServiceProvider.class); - private static final Logger LOG = LoggerFactory - .getLogger(OpenflowpluginTableFeaturesTestServiceProvider.class); - private ObjectRegistration tableRegistration; + private Registration tableRegistration = null; private NotificationPublishService notificationService; /** @@ -38,14 +39,14 @@ public class OpenflowpluginTableFeaturesTestServiceProvider implements * * @return {@link #tableRegistration} */ - public ObjectRegistration getTableRegistration() { - return this.tableRegistration; + public Registration getTableRegistration() { + return tableRegistration; } /** * Set {@link #tableRegistration}. */ - public void setTableRegistration(final ObjectRegistration tableRegistration) { + public void setTableRegistration(final Registration tableRegistration) { this.tableRegistration = tableRegistration; } @@ -55,7 +56,7 @@ public class OpenflowpluginTableFeaturesTestServiceProvider implements * @return {@link #notificationService} */ public NotificationPublishService getNotificationService() { - return this.notificationService; + return notificationService; } /** @@ -66,41 +67,24 @@ public class OpenflowpluginTableFeaturesTestServiceProvider implements } public void start() { - OpenflowpluginTableFeaturesTestServiceProvider.LOG - .info("SalTableServiceProvider Started."); + LOG.info("SalTableServiceProvider Started."); } - /* - * (non-Javadoc) - * - * @see java.lang.AutoCloseable#close() - */ @Override public void close() { - OpenflowpluginTableFeaturesTestServiceProvider.LOG - .info("SalTableServiceProvider stopped."); + LOG.info("SalTableServiceProvider stopped."); tableRegistration.close(); } - /* - * (non-Javadoc) - * - * @see - * org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026 - * .SalTableService - * #updateTable(org.opendaylight.yang.gen.v1.urn.opendaylight - * .table.service.rev131026.UpdateTableInput) - */ @Override - public ListenableFuture> updateTable( - final UpdateTableInput input) { - OpenflowpluginTableFeaturesTestServiceProvider.LOG.info("updateTable - {}", input); - return null; + public ListenableFuture> invoke(final UpdateTableInput input) { + LOG.info("updateTable - {}", input); + return RpcResultBuilder.success(new UpdateTableOutputBuilder().build()).buildFuture(); } public ObjectRegistration register( final RpcProviderService rpcRegistry) { - setTableRegistration(rpcRegistry.registerRpcImplementation(SalTableService.class, this, ImmutableSet.of( + setTableRegistration(rpcRegistry.registerRpcImplementation(this, ImmutableSet.of( InstanceIdentifier.create(Nodes.class) .child(Node.class, new NodeKey(new NodeId(OpenflowpluginTestActivator.NODE_ID)))))); diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestServiceProvider.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestServiceProvider.java index 521ce330e1..00d7639244 100644 --- a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestServiceProvider.java +++ b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestServiceProvider.java @@ -30,16 +30,14 @@ import org.opendaylight.yangtools.yang.common.RpcResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class OpenflowpluginTestServiceProvider implements AutoCloseable, - SalFlowService { - - private static final Logger LOG = LoggerFactory - .getLogger(OpenflowpluginTestServiceProvider.class); +public class OpenflowpluginTestServiceProvider implements AutoCloseable, SalFlowService { + private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginTestServiceProvider.class); private final DataBroker dataService; - private ObjectRegistration flowRegistration; private final NotificationPublishService notificationProviderService; + private ObjectRegistration flowRegistration = null; + public OpenflowpluginTestServiceProvider(final DataBroker dataService, final NotificationPublishService notificationProviderService) { this.dataService = dataService;