Refactor ServerFacade 54/111854/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 23 May 2024 22:44:24 +0000 (00:44 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sun, 26 May 2024 20:52:19 +0000 (22:52 +0200)
commit6d148b3e061ab457b8dcf354f11d93a4d1c6d19c
treecdbf6ac5725f999c24cbd9f98ec8352cbf0b943d
parentc5d3cec367ac8e5b35e03d1763de0cafd97f1329
Refactor ServerFacade

ServerFacade and its two implementations have intrinsic state in their
associated groups.

The API and interactions are rather involved, including a threadpool
holding a thread, which is waiting for channel shutdown.

This completely refactors things:
- ServerFacade is an abstract class with a well-separated public and
  private APIs
- {Tcp,Udp}ServerFacade are replacements for {Tcp,Udp}Handler, which
  manage the lifecycle
- instantiation is completely asynchronous, so that we know at all times
  what we need to clean up and what is fine

Change-Id: I82952b5c3e54a9b9067f6d28bc6e9072373b146b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit ce1a49362ddb70df372798f0ed5c1fbfc39d83a4)
15 files changed:
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OnlineProvider.java [deleted file]
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ShutdownProvider.java [deleted file]
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/TcpConnectionInitializer.java [deleted file]
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java [deleted file]
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpServerFacade.java [new file with mode: 0644]
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java [deleted file]
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpServerFacade.java [new file with mode: 0644]
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandlerTest.java [deleted file]
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/TcpServerFacadeTest.java [new file with mode: 0644]
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/UdpServerFacadeTest.java [new file with mode: 0644]
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/SwitchConnectionProviderImpl02Test.java
openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/connection/UdpHandlerTest.java [deleted file]
openflowjava/openflow-protocol-it/src/test/java/org/opendaylight/openflowjava/protocol/it/integration/IntegrationTest.java