public abstract class ALfnEvent extends Object
getTimestamp()
.
An event optionally can contain a reference to the TLfnUser who caused this event:
see getUser()
.
Depending on the type of event, this user might be unavailable, in which case the method returns an empty Optional.
An event optionally can contain a TLfnEventSourceRequest that caused this event:
see getRequest()
.
Depending on the type of event, this request context might be unavailable, in which case the method returns an
empty Optional.
More information on how the LuciadFusion event system works and how your application can get notified
of these events can be found in the Listening for LuciadFusion events
documentation article.Modifier | Constructor and Description |
---|---|
protected |
ALfnEvent(TLfnUser aUser)
Create a new LuciadFusion event.
|
protected |
ALfnEvent(TLfnUser aUser,
TLfnEventSourceRequest aRequest)
Create a new LuciadFusion event.
|
Modifier and Type | Method and Description |
---|---|
protected String |
getPropertiesString()
Get the
String object that is used in the toString() method
for describing this event's properties. |
Optional<TLfnEventSourceRequest> |
getRequest()
Returns an Optional containing the
TLfnEventSourceRequest that caused this event. |
ZonedDateTime |
getTimestamp()
Returns the date and time when the event happened.
|
Optional<TLfnUser> |
getUser()
Returns an Optional containing the
TLfnUser who caused this event. |
String |
toString() |
protected ALfnEvent(TLfnUser aUser)
aUser
- the TLfnUser
who caused this event, or null
protected ALfnEvent(TLfnUser aUser, TLfnEventSourceRequest aRequest)
aUser
- the TLfnUser
who caused this event, or null
aRequest
- the TLfnEventSourceRequest
that caused this event, or null
protected String getPropertiesString()
String
object that is used in the toString()
method
for describing this event's properties.
Implementing classes can override this method for including specific properties,
as a comma-separated list of key-value pairs.
name
property, the overridden version
of this method should be:
@Override protected String getPropertiesString() { return super.getPropertiesString() + ", name='" + getName() + "'"; }
toString()
method.public final ZonedDateTime getTimestamp()
public Optional<TLfnUser> getUser()
TLfnUser
who caused this event.
Can be an empty Optional when an event is triggered for an action that does not require a user
(for example: accessing a service).TLfnUser
who caused this eventpublic Optional<TLfnEventSourceRequest> getRequest()
TLfnEventSourceRequest
that caused this event. Can be an empty Optional
when an event is triggered for an action that is not related to an HTTP request (for example: queueing a scheduled
job).TLfnEventSourceRequest
that caused this event