> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# STOP_LISTEN

> Reference for the `STOP_LISTEN` DLC operation, covering the `DlcStopListenRequest`, identified by `listenId`, and the `DlcStopListenResponse` returned when a listener is closed.

## Overview

This operation will look through all of the open listening operations and stop the ones that match the parameters in the request.

This means that listening can be started and stopped via the same request, while only changing the Operation type.

## Request

<Tabs>
  <Tab title="Java">
    ### `DlcStopListenRequest`

    | Key      | Required | Type     | Description                          |
    | -------- | :------: | :------- | ------------------------------------ |
    | listenId |     Y    | `String` | The unique identifier of a listener. |

    #### Example:

    ```Java theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
    DlcStopListenRequest.builder()
        .listenId("234890")
        .build();
    ```
  </Tab>

  <Tab title="JSON">
    ### `DlcStopListenRequestDTO`

    | Key      | Required | Type     | Description                          |
    | -------- | :------: | :------- | ------------------------------------ |
    | listenId |     Y    | `String` | The unique identifier of a listener. |

    #### Example:

    ```json theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
    {
      "operation": "STOP_LISTEN",
      "listenId": "234890"
    }
    ```
  </Tab>
</Tabs>

## Response

<Tabs>
  <Tab title="Java">
    ### `DlcStopListenResponse`

    | Key    | Type              | Description                                                      |
    | ------ | :---------------- | ---------------------------------------------------------------- |
    | report | `ListenReport<E>` | Reports of all events that occurred while the listener was open. |
    | status | `DlcStatus`       | Overall status of the DLC Operation.                             |

    ### `ListenReport<E>`

    | Key       | Type            | Description                                                                                           |
    | --------- | :-------------- | ----------------------------------------------------------------------------------------------------- |
    | isOpen    | `boolean`       | Whether the listener is currently open or closed.                                                     |
    | startTime | `LocalDateTime` | The time and date the listener was started. Uses the JVM's time zone.                                 |
    | endTime   | `LocalDateTime` | The time and date the listener was closed. Uses the JVM's time zone. Will be null for open listeners. |
    | events    | `List<E>`       | List of events that occurred while the listener was open. The type of event depends on the source.    |
  </Tab>

  <Tab title="JSON">
    ### `DlcStopListenResponseDTO`

    | Key       | Type            | Description                                                                                           |
    | --------- | :-------------- | ----------------------------------------------------------------------------------------------------- |
    | isOpen    | `boolean`       | Whether the listener is currently open or closed.                                                     |
    | startTime | `LocalDateTime` | The time and date the listener was started. Uses the JVM's time zone.                                 |
    | endTime   | `LocalDateTime` | The time and date the listener was closed. Uses the JVM's time zone. Will be null for open listeners. |
    | events    | `List<E>`       | List of events that occurred while the listener was open. The type of event depends on the source.    |
    | status    | `DlcStatus`     | Overall status of the DLC Operation.                                                                  |

    #### Example:

    ```json theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
    {
      "isOpen": false,
      "startTime": "2025-02-14T12:00:00",
      "endTime": "2025-02-14T12:30:00",
      "events": [
        {}
      ],
      "status": "OK"
    }
    ```
  </Tab>
</Tabs>

### Expected event types

The type parameter of the `ListenReport` can vary depending on the type of source being listened on.

#### File sources: `ListenReport<DlcLoadResponse>`

When listening on a file source, the listen report will contain [`DlcLoadResponse`](/operations/operations-load#response) events as the listen operation
will perform many [`LOAD`](/operations/operations-load) operations.

### `DlcStatus`

A simple enum to capture if the DLC request was executed.

| Key   | Description                                     |
| ----- | ----------------------------------------------- |
| OK    | Request was handled successfully.               |
| ERROR | Request was not able to be performed correctly. |

### How it works

#### File source types

All listen operations are recorded based on their Topic, Scope and the Source they are operating on. The open listener for the provided scope can then be looked up
and closed.
