Class CustomEvent
java.lang.Object
com.novomind.ecom.api.iagent.common.event.CustomEvent
- All Implemented Interfaces:
Event
,com.novomind.ecom.common.api.attribute.Named
public class CustomEvent
extends Object
implements Event, com.novomind.ecom.common.api.attribute.Named
The
CustomEvent
is an object that can be used to be
sent as event between different apps and plugins even between
different processes. CustomEvent
can be raised by the
CustomEventHandler.raiseEvent(CustomEvent)
method
and processed by any appropriate CustomEventListener
even in a different process.- Since:
- 12.20
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal String
getAttribute
(String key) Get attributes of the event.Provides the attributes as map.Returns theDate
when the event has occurred.final String
getName()
final CustomEvent
setAttribute
(String key, String value) Set attributes of the event as key-value-pairs.toString()
-
Constructor Details
-
CustomEvent
Constructs aCustomEvent
with the given name. The name of the event is used to address the correspondingCustomEventListener
to process the event. The correspondingCustomEventListener
must be annotated with the annotationCustomEventFilter
and specify a list of names of the events theCustomEventListener
wants to listen to. TheCustomEventListener
will only be notified for events that are specified in the names attribute of the annotationCustomEventFilter
.- Parameters:
name
- the name of the event- Since:
- 12.20
-
-
Method Details
-
setAttribute
Set attributes of the event as key-value-pairs. Please note that the maximum size of all attribute values must not exceed a sum of 100 kilo bytes of characters.- Parameters:
key
- the key of the attributevalue
- the value of the attribute- Returns:
- the instance of
CustomEvent
- Since:
- 12.20
-
getAttribute
Get attributes of the event.- Parameters:
key
- the key of the attribute- Returns:
- the value of the attribute
- Since:
- 12.20
-
getName
- Specified by:
getName
in interfacecom.novomind.ecom.common.api.attribute.Named
-
getAttributes
Provides the attributes as map.- Returns:
- the attribute map
- Since:
- 12.20
-
getEventDate
Description copied from interface:Event
Returns theDate
when the event has occurred.- Specified by:
getEventDate
in interfaceEvent
- Returns:
- the
Date
of the event
-
toString
-