Refactor ShutdownProvider.shutdown() 33/111833/3
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 23 May 2024 16:25:59 +0000 (18:25 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 24 May 2024 00:14:20 +0000 (02:14 +0200)
commit945b2dd05df3c725941fe4c4677f6b2972249256
tree140bbc81acb77bb371a6e8850693f8efb4623651
parentb753a6614a2036e78f76d7c17fde521a58f887da
Refactor ShutdownProvider.shutdown()

Returning a Boolean is confusing with regard to error reporting:
- users are really ignoring the value and rely on exception cause
- that is not what the code does, as it is confused about mapping,
  running set(true/false) followed by an optional setException()

Change the future type to Void, making it the value does not hold
anything and rely on setException() to deliver the failure cause.

Change-Id: Id6d97580b8d908caf37338f3578045598d2555f1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ShutdownProvider.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/SwitchConnectionProviderImpl.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandlerTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImplTest.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpHandlerTest.java
openflowjava/openflow-protocol-spi/src/main/java/org/opendaylight/openflowjava/protocol/spi/connection/SwitchConnectionProvider.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImplTest.java