Unbind SFC service from interface on sfc-genius. 84/45884/7
authorJaime Caamaño Ruiz <jaime.caamano.ruiz@ericsson.com>
Fri, 30 Sep 2016 14:36:16 +0000 (16:36 +0200)
committerBrady Johnson <brady.allen.johnson@ericsson.com>
Wed, 5 Oct 2016 09:59:42 +0000 (09:59 +0000)
commite74b3e70a6c9cac0fb890b1c7b8f911f401eb7e7
treee139f37eec4d3e5562a6b3dd4d83d1d11805cad5
parentb0a95a028f4e67fd46e2a7b0c87089ec5c6c896e
Unbind SFC service from interface on sfc-genius.

Performs unbind of SFC service for the logical interfaces handled
through Genius. Includes removing the SFC terminating service action
from the interface node, which handles SFC traffic incoming through
tunnel, if there are no more interfaces bound to SFC service on the
node.

A handler is setup for this task, SfcGeniusServiceHandler, which
coordinates the task through more sub-handlers specialized in read and
write operations through asynchronous APIs. JDK8 new CompletableFuture
is leveraged to asynchronously chain read & write asynchronous
operations.

For the time being, the module stores in-memory the data plane node
location of each interface (dpnInterfaces map), which is an information
needed to handle the terminating service actions. On a later patch, this
will be stored in the SFC operational data store.

The implementation is asynchronous for the following reasons:
- Javadoc of APIs recommend using the asynchronous interfaces over
  the synchronous ones.
- With the introduction of JDK8, more code facilities are available to
  produce asynchronous readable code.
- Being sfc-genius an independent small module, it's deemed a good
  chance to get a taste for it.

Change-Id: I145b4eb0aa6a4f17ff0c3bd8344a0486d8d7be96
Signed-off-by: Jaime Caamaño Ruiz <jaime.caamano.ruiz@ericsson.com>
22 files changed:
sfc-genius/src/main/java/org/opendaylight/sfc/genius/impl/handlers/SfcGeniusInterfaceServiceManager.java
sfc-genius/src/main/java/org/opendaylight/sfc/genius/impl/handlers/SfcGeniusServiceHandler.java [new file with mode: 0644]
sfc-genius/src/main/java/org/opendaylight/sfc/genius/impl/handlers/readers/SfcGeniusIfStateReader.java [new file with mode: 0644]
sfc-genius/src/main/java/org/opendaylight/sfc/genius/impl/handlers/readers/SfcGeniusReaderAbstract.java [new file with mode: 0644]
sfc-genius/src/main/java/org/opendaylight/sfc/genius/impl/handlers/readers/SfcGeniusSfReader.java [new file with mode: 0644]
sfc-genius/src/main/java/org/opendaylight/sfc/genius/impl/handlers/writers/SfcGeniusBoundServiceWriter.java [new file with mode: 0644]
sfc-genius/src/main/java/org/opendaylight/sfc/genius/impl/handlers/writers/SfcGeniusDpnIfWriter.java [new file with mode: 0644]
sfc-genius/src/main/java/org/opendaylight/sfc/genius/impl/handlers/writers/SfcGeniusTsaWriter.java [new file with mode: 0644]
sfc-genius/src/main/java/org/opendaylight/sfc/genius/impl/listeners/SfcGeniusInterfaceStateListener.java
sfc-genius/src/main/java/org/opendaylight/sfc/genius/impl/listeners/SfcGeniusSfStateListener.java
sfc-genius/src/main/java/org/opendaylight/sfc/genius/impl/utils/SfcGeniusConstants.java [new file with mode: 0644]
sfc-genius/src/main/java/org/opendaylight/sfc/genius/impl/utils/SfcGeniusRuntimeException.java [new file with mode: 0644]
sfc-genius/src/main/java/org/opendaylight/sfc/genius/impl/utils/SfcGeniusUtils.java
sfc-genius/src/test/java/org/opendaylight/sfc/genius/impl/handlers/SfcGeniusInterfaceServiceManagerTest.java [new file with mode: 0644]
sfc-genius/src/test/java/org/opendaylight/sfc/genius/impl/handlers/SfcGeniusServiceHandlerTest.java [new file with mode: 0644]
sfc-genius/src/test/java/org/opendaylight/sfc/genius/impl/handlers/readers/SfcGeniusIfStateReaderTest.java [new file with mode: 0644]
sfc-genius/src/test/java/org/opendaylight/sfc/genius/impl/handlers/readers/SfcGeniusReaderAbstractTest.java [new file with mode: 0644]
sfc-genius/src/test/java/org/opendaylight/sfc/genius/impl/handlers/readers/SfcGeniusSfReaderTest.java [new file with mode: 0644]
sfc-genius/src/test/java/org/opendaylight/sfc/genius/impl/handlers/writers/SfcGeniusBoundServiceWriterTest.java [new file with mode: 0644]
sfc-genius/src/test/java/org/opendaylight/sfc/genius/impl/handlers/writers/SfcGeniusDpnIfWriterTest.java [new file with mode: 0644]
sfc-genius/src/test/java/org/opendaylight/sfc/genius/impl/handlers/writers/SfcGeniusTsaWriterTest.java [new file with mode: 0644]
sfc-genius/src/test/java/org/opendaylight/sfc/genius/impl/utils/SfcGeniusUtilsTest.java