Kernel::System::PushEvent::UserMessage

NAME

Kernel::System::PushEvent::UserMessage – Manager for prepared user messages (push events).

DESCRIPTION

This class takes care about handling the prepared push events for certain frontend clients. Since events will be stored in the push event queue as raw entries (for more information see Kernel::System::PushEvent::Queue), those raw entries will be picked up by the OTRS daemon (please see Kernel::System::Daemon::DaemonModules::PushEventManager) for more information and prepared for every single subscription. Those prepared entries will then be send to the frontend in a regular interval via the websocket backend (Kernel::WebApp::Controller::Websocket).

PUBLIC INTERFACE

MethodParamValidationSchema()

Around's the original 'MethodParamValidationSchema' of the driver to just add the schema of the parameter 'ObjectAttributes'.

Add()

Creates/adds a new user message to the database.

    # Add a new queue.
    my $Queue = $UserMessageObject->Add(
        Messages => [
            Name              => '...',
            FrontendClientIDs => [ '...', '...', ],
        ]
    );

Every message will only be added once per FrontendClientID. This means it will be discarded if already found in the database or sent multiple times in the FrontendClientIDs array (which can happen because of multiple similar subscriptions in the frontend).

Returns

    True if add was successful or undef otherwise.

List()

List all User Messages from the database by name or by FrontendClientID.

    # Get a message.
    my $Queue = $UserMessageObject->List(
        Name             => '...', # or
        FrontendClientID => '...',
    );

Returns

    [
        {
            ID               => '...',
            Name             => '...',
            FrontendClientID => '...',
            ExpireTime       => '...',
        },
        ...
    ]

Delete()

Delete an User Message from the database.

    # Delete a message.
    my $Status = $UserMessageObject->Delete(
        Name => '...', # or
        FrontendClientID => '...',
    );

Returns

    True if delete was successful or undef otherwise.

CleanupExpired()

Cleans up all expired user messages.

    my $Success = $UserMessageObject->CleanupExpired();

Returns 1 if expired user messages were cleaned up successfully.

Scroll to Top