| 1 | # Dataplane Selection Improvements |
| 2 | |
| 3 | ## Decision |
| 4 | |
| 5 | In the scope of `Dataplane Signaling`, a new way to manage dataplane registration and de-registration will be implemented |
| 6 | |
| 7 | ## Rationale |
| 8 | |
| 9 | Currently, the dataplane registration is done manually by the operator through the management-api, this way is not optimal |
| 10 | because it could lead to errors, plus, there's no way for the control plane to ensure that the dataplane is still active |
| 11 | and ready to accept new transfer requests. |
| 12 | |
| 13 | ## Approach |
| 14 | |
| 15 | The dataplane needs to register itself to the control plane. |
| 16 | To do that, it will need a way to be aware of its supported `source` types and `transferTypes`. |
| 17 | |
| 18 | In the first iteration, a new method needs to be added to the `DataSourceFactory` interface, that indicates the type that is handled by the |
| 19 | factory: |
| 20 | ```java |
| 21 | public interface DataSourceFactory { |
| 22 | String supportedType(); |
| 23 | } |
| 24 | ``` |
| 25 | |
| 26 | Doing so, the `canHandle` method will become obsolete, and the factory will be bound to a specific type. |
| 27 | |
| 28 | The `transferTypes` instead will need: |
| 29 | - for `PUSH` flows: the same method will be added to the `DataSinkFactory`, so collecting the types from the registered |
| 30 | factories will give the set of supported `PUSH` types |
| 31 | - for `PULL` flows: the types are registered to the `PublicEndpointGeneratorService` |
| 32 | |
| 33 | |
| 34 | With this knowledge, the dataplane will be able at startup to register itself to the controlplane via the `control-api` |
| 35 | (and de-register itself at shutdown). |
| 36 | |
| 37 | The dataplane will need to have a UUID configured to handle idempotency. |
| 38 | |
| 39 | The controlplane will have the possibility to "heartbeat" the dataplane to verify its availability in order to be able |
| 40 | to build the catalog in the correct way and being able to tell if a requested transfer can be started or not. |