Transient messages to admins
On application startup, services log important warning messages that may not be looked at by administrators of GG-CE Server (e.g. ES mapping for Inventory
is no longer compatible).
I would like to see such messages added to a in-memory list of alerts that will be retrieved and rendered in GG-CE Web when an administrator accesses the system.
Please implement a TransientMessageService
with:
interface TransientMessageService {
// format uses Log4j syntax
IMessage addAdminAlert(String format, Object... args);
// get current alert
Page<IMessage> listAdminAlerts(Pageable page);
// remove alert
IMessage removeAdminAlert(UUID alertUuid);
}
class IMessage {
UUID uuid; // uses UUID.randomUUID();
String message;
Date timestamp;
}
The service implementation starts with a blank ArrayList
of messages and removes alerts from the list via removeAdminAlert()
method.
UI
GG-CE Web will query the for the alert messages and render them to in the /admin page. They will have an X
icon that will call removeAdminAlert()
.
Messages to users
We will later consider the same approach also to send alerts to users.