.. SPDX-FileCopyrightText: 2024 Univention GmbH
..
.. SPDX-License-Identifier: AGPL-3.0-only

.. _data-flow-event-objects:

Event objects flow
==================

Nubus uses *Event objects* to inform other Nubus applications
or *Third-party applications not part of Nubus*
about changes in the :ref:`component-identity-store-directory-service`.
This section describes the flow relationships for *Event objects*
between the functional components in Nubus,
as shown in
:numref:`data-flow-event-objects-figure`.

Within the *Provisioning Service*, the *UDM Transformer* creates *Event objects*
and passes them to the *Dispatcher*,
which duplicates the *Event objects* for the respective consumers.
The *Prefill Service* also creates *Event objects* to provide an initial data state to consumers.
For details, see :ref:`component-provisioning-service-prefill`.

*Event objects* leave the *Provisioning Service*
through the *Events and Consumer API* to the *Consumer of Provisioning Service*.
Such consumers can be *Third-party applications not part of Nubus* or other *Nubus applications*.

.. _data-flow-event-objects-figure:

.. figure:: /images/Data_object_flow_Event_objects.*
   :target: ../_images/Data_object_flow_Event_objects.svg
   :alt: Data flow - Event objects

   Data flow for *Event objects* on the application component level

.. seealso::

   :ref:`component-provisioning-service` in the components section
      for detailed information of the functional component and its behavior.

   :ref:`data-objects-event` in data objects section
      for information about *Event objects*.

.. _data-flow-event-objects-details:

Event objects processing
------------------------

:numref:`data-flow-event-objects-detail-figure`
shows the processing of :ref:`data-objects-event` on the behavioral level.
It provides one additional level of details compared to the figure before.

*Event objects* have the following data flow:

* The :ref:`component-provisioning-service-udm-transformer` creates *Event objects* and stores them
  in the internal *Incoming queue*.

* The :ref:`component-provisioning-service-dispatcher`, consumes the *Incoming queue*
  and distributes the *Event objects* in queues for each registered consumer.

* The :ref:`component-provisioning-service-consumer-messages-http-rest-api` retrieves the events,
  and sends messages with *Event objects* to consumers.

* In the case of a first-time provision of a data state, the :ref:`component-provisioning-service-prefill` component
  creates *Event objects* and stores them in the *Prefill Service queue for each consumer*.
  From that queue, the *Consumer Messages HTTP REST API* takes over and continues as described
  before.

You can see the chain of flow relationships from *Transform directory objects to UDM objects* to
*Send messages to consumer* and which queue each behavior uses for write and read operations.

.. _data-flow-event-objects-detail-figure:

.. figure:: /images/Data_object_flow_Event_objects_details_vertical.*
   :target: ../_images/Data_object_flow_Event_objects_details_vertical.svg
   :alt: Event objects details

   Data flow for *Event objects* on the application behavior level

.. _data-flow-event-objects-consumers:

Event objects consumers
-----------------------

The :ref:`component-provisioning-service` provides :ref:`data-objects-event`.
Consumer are all systems,
that have registered with the :ref:`component-provisioning-service`.
These can therefore be internal Nubus applications
and *Third-party application not part of Nubus*.

For more information about the consuming of *Event objects*,
see :ref:`component-provisioning-service-consumer-messages-http-rest-api`.

.. _data-flow-event-objects-consumers-figure:

.. figure:: /images/Data_object_flow_Event_objects_Consumers_vertical.*
   :target: ../_images/Data_object_flow_Event_objects_Consumers_vertical.svg
   :alt: Consumers of Event objects outside the Provisioning Service, application component level

   Consumers of *Event objects* outside the *Provisioning Service*, application component level

.. _data-flow-event-objects-consumers-detail-figure:

.. figure:: /images/Data_object_flow_Event_objects_Consumers_details_vertical.*
   :target: ../_images/Data_object_flow_Event_objects_Consumers_details_vertical.svg
   :alt: Consumers of Event objects outside the Provisioning Service, application behavior level

   Consumers of *Event objects* outside the *Provisioning Service*, application behavior level
