Class ALfnEvent
java.lang.Object
com.luciad.fusion.platform.event.object.ALfnEvent
- Direct Known Subclasses:
ALfnDataEvent
,ALfnDataRootEvent
,ALfnJobEvent
,ALfnProductEvent
,ALfnServiceEvent
,ALfnStyleEvent
,TLfnDataQueryEvent
,TLfnProductQueryEvent
,TLfnServiceQueryEvent
,TLfnStyleQueryEvent
Abstract class that all LuciadFusion events will extend.
An event will always have a valid reference to the date and time when it was created: see
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.- Since:
- 2022.1
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Create a new LuciadFusion event.protected
ALfnEvent
(TLfnUser aUser, TLfnEventSourceRequest aRequest) Create a new LuciadFusion event. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Get theString
object that is used in thetoString()
method for describing this event's properties.Returns an Optional containing theTLfnEventSourceRequest
that caused this event.final ZonedDateTime
Returns the date and time when the event happened.getUser()
Returns an Optional containing theTLfnUser
who caused this event.final String
toString()
-
Constructor Details
-
ALfnEvent
Create a new LuciadFusion event. The event will have the given user, and will have no request.- Parameters:
aUser
- theTLfnUser
who caused this event, ornull
-
ALfnEvent
Create a new LuciadFusion event. The event will have the given user and request.- Parameters:
aUser
- theTLfnUser
who caused this event, ornull
aRequest
- theTLfnEventSourceRequest
that caused this event, ornull
-
-
Method Details
-
getPropertiesString
Get theString
object that is used in thetoString()
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.
For example, if a subclass has aname
property, the overridden version of this method should be:@Override protected String getPropertiesString() { return super.getPropertiesString() + ", name='" + getName() + "'"; }
- Returns:
- the String that is used in the
toString()
method.
-
getTimestamp
Returns the date and time when the event happened.- Returns:
- the date and time when the event happened
-
getUser
Returns an Optional containing theTLfnUser
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).- Returns:
- an Optional containing the
TLfnUser
who caused this event
-
getRequest
Returns an Optional containing theTLfnEventSourceRequest
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).- Returns:
- an Optional containing the
TLfnEventSourceRequest
that caused this event
-
toString
-