NAME
Kernel::System::PushEvent::Queue – Event queue manager to handle raw entries for push events.
DESCRIPTION
This class takes care about handling raw event entries, that are used for further push event processing. It is possible to list, create, retrieve and delete those event entries. Those events will be added by related backend objects and are picked up afterwards by the push event manager daemon module, to generate proper user messages, that may be pushed to the frontend client. For further information, please see Kernel::System::Daemon::DaemonModules::PushEventManager.
PUBLIC INTERFACE
MethodParamValidationSchema()
Extend the original 'MethodParamValidationSchema' of the base class to fit the schemata of the queue management.
Add()
Creates a new event entry in the database.
The attribute parameter is used to add more data to the event name of the stored event. If this optional parameter is used, it has to be a hash reference, which will be sorted alphanumerical by the keys and appended to the original event name, with it's keys and values. All single values will be separated by double colons (::). The resulting event name must not be longer than 255 characters.
As an example the following parameters:
$PushEventQueueObject->Add(
EventName => 'TicketUpdate',
Attributes => { TicketID => 123 },
);
will become the event name:
'TicketUpdate::TicketID::123'
If the alphanumerical sorting does not fit the current use case, it's possible to add those values directly to the EventName parameter.
If the LockID is passed, it will be added to the related entry, to be filtered in the List() method later.
Thus the resulting method calls may look like:
my $Success = $PushEventQueueObject->Add(
EventName => 'TicketUpdate', # required
Attributes => { # optional
TicketID => 123,
},
);
or:
my $Success = $PushEventQueueObject->Add(
EventName => 'TicketUpdate', # required
LockID => 123,
Attributes => { # optional
TicketID => 123,
},
);
or:
my $Success = $PushEventQueueObject->Add(
EventName => 'TicketUpdate::TicketID::123', # required
);
or:
my $Success = $PushEventQueueObject->Add(
EventName => 'TicketUpdate', # required
);
or:
my $Success = $PushEventQueueObject->Add(
EventName => 'TicketUpdate', # required
);
Returns 1, if the insertion was successful or undef in case of errors.
LockRecords()
Lock the records with the given LockID.
my $Success = $PushEventQueueObject->LockRecords(
LockID => 123, # optional, usually the OTRS daemon NodeID
);
Returns 1 if lock records were successfully.
List()
Lists all event entries stored in the database which are not expired for the given LockID. If the LockID is not passed, all entries which are not expired will be returned.
my $EventEntries = $PushEventQueueObject->List(
LockID => 123, # optional, usually the OTRS daemon NodeID
);
Returns
[
{
ID => '...',
Name => '...',
},
...
];
Delete()
Delete a list of event entries by name
my $Success = $PushEventQueueObject->Delete(
Name => [
'...',
'...',
],
);
Returns
True if delete was successful or undef otherwise.
CleanupExpired()
Cleans up all expired push event queue.
my $Success = $BrowserTrustObject->CleanupExpired();
Returns 1 if expired push event queue were cleaned up successfully.