Package lumis.portal.monitor.impl
Class MonitorEvent
- java.lang.Object
-
- lumis.portal.monitor.impl.MonitorEvent
-
- All Implemented Interfaces:
IMonitorElementSPI<IMonitorEventSPI>
,IMonitorEvent
,IMonitorEventSPI
public class MonitorEvent extends Object implements IMonitorEventSPI
Defines events to monitor. For field descriptions, see thedatabasedefinition.xml
.- Since:
- 9.0.0
- Version:
- $Revision: 24476 $ $Date: 2021-04-28 11:28:23 -0300 (Wed, 28 Apr 2021) $
-
-
Field Summary
Fields Modifier and Type Field Description protected String
id
-
Fields inherited from interface lumis.portal.monitor.IMonitorEvent
DEFAULT_EVENT_PREFIX
-
-
Constructor Summary
Constructors Constructor Description MonitorEvent(String id, String serviceInstanceId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IMonitorEventSPI
addField(IMonitorField field, boolean required)
Adds the given field in this event.IMonitorEventSPI
addFieldGroup(IMonitorFieldGroup fieldGroup, boolean required)
Adds the given field group in this event.String
getDescription()
Returns the description of this event.Collection<IMonitorFieldInstance>
getDirectFields()
Returns the fields that are associated with this event directly (not through a field group).Collection<IMonitorFieldInstance>
getFields()
Returns an unmodifiable collection of the fields that should be collected for this event.Collection<IMonitorFieldGroupInstance>
getFieldsGroups()
Returns the field groups associated with this event.String
getId()
Returns the identifier of this element.String
getImage()
Returns the image.String
getLocalizedDescription()
Returns the localized description of this event.String
getLocalizedName()
Returns the localized name of this event.String
getLocalizedVerb()
Returns the localized verb of this event.String
getName()
Returns the name of this event.String
getServiceInstanceId()
Returns the identifier of the service instance this element belongs to.String
getStringResourcePath()
The string resource path for localizing this event's strings.String
getVerb()
Returns the verb.boolean
isEnabled()
Returns if the monitoring for this event is enabled.boolean
isProcessActionEvent()
Returns if the event is a process action event.IMonitorEventSPI
removeDirectFields(Collection<String> fieldsIds)
Removes the direct fields that has their ids in the given ids collection.IMonitorEventSPI
removeField(String fieldId)
Removes the given field.IMonitorEventSPI
removeFieldGroup(String fieldGroupId)
Removes the given field group.IMonitorEventSPI
removeFieldsGroups(Collection<String> fieldsGroupsIds)
Removes the fields groups that has their ids in the given ids collection.IMonitorEventSPI
setDescription(String description)
Sets the description for this event.IMonitorEventSPI
setEnabled(boolean enabled)
Enables or disables the monitoring of this event.IMonitorEventSPI
setImage(String image)
Sets the image.IMonitorEventSPI
setName(String name)
Sets the name for this event.IMonitorEventSPI
setProcessActionEvent(boolean isProcessActionEvent)
Sets this event either as process action event or a normal one.IMonitorEventSPI
setStandard(boolean isStandard)
Sets this event either as standard or custom (non-standard).IMonitorEventSPI
setStringResourcePath(String stringResourcePath)
Sets the string resource path for this event.IMonitorEventSPI
setVerb(String verb)
Sets the image.protected void
validateLocalId(String localId)
Validates the part of the identifier without the service instance identifier prefix, when the element belongs to a service instance.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface lumis.portal.monitor.IMonitorElementSPI
getId, getServiceInstanceId
-
Methods inherited from interface lumis.portal.monitor.IMonitorEvent
getId
-
-
-
-
Field Detail
-
id
protected String id
-
-
Constructor Detail
-
MonitorEvent
public MonitorEvent(String id, String serviceInstanceId) throws PortalException
- Throws:
PortalException
-
-
Method Detail
-
validateLocalId
protected void validateLocalId(String localId) throws PortalException
Validates the part of the identifier without the service instance identifier prefix, when the element belongs to a service instance.- Parameters:
localId
- the part of the identifier without the service instance identifier prefix.- Throws:
PortalException
- if the validation fails.
-
getDescription
public String getDescription()
Description copied from interface:IMonitorEvent
Returns the description of this event. The description is localizable usingIMonitorEvent.getStringResourcePath()
.- Specified by:
getDescription
in interfaceIMonitorEvent
- Returns:
- the description of this event.
-
setDescription
public IMonitorEventSPI setDescription(String description)
Description copied from interface:IMonitorEventSPI
Sets the description for this event.- Specified by:
setDescription
in interfaceIMonitorEventSPI
- Parameters:
description
- the description to set.- Returns:
- this event for chaining.
- See Also:
IMonitorEvent.getDescription()
-
isEnabled
public boolean isEnabled()
Description copied from interface:IMonitorEvent
Returns if the monitoring for this event is enabled.- Specified by:
isEnabled
in interfaceIMonitorEvent
- Returns:
- true if enabled or false if disabled.
-
setEnabled
public IMonitorEventSPI setEnabled(boolean enabled)
Description copied from interface:IMonitorEventSPI
Enables or disables the monitoring of this event.- Specified by:
setEnabled
in interfaceIMonitorEventSPI
- Parameters:
enabled
- true to enable or false to disable.- Returns:
- this event for chaining.
-
getName
public String getName()
Description copied from interface:IMonitorEvent
Returns the name of this event. The name is localizable usingIMonitorEvent.getStringResourcePath()
.- Specified by:
getName
in interfaceIMonitorEvent
- Returns:
- the name of this event.
-
setName
public IMonitorEventSPI setName(String name)
Description copied from interface:IMonitorEventSPI
Sets the name for this event.- Specified by:
setName
in interfaceIMonitorEventSPI
- Parameters:
name
- the name- Returns:
- this event for chaining.
- See Also:
IMonitorEvent.getName()
-
getStringResourcePath
public String getStringResourcePath()
Description copied from interface:IMonitorEvent
The string resource path for localizing this event's strings.- Specified by:
getStringResourcePath
in interfaceIMonitorEvent
- Returns:
- the string resource path.
-
setStringResourcePath
public IMonitorEventSPI setStringResourcePath(String stringResourcePath)
Description copied from interface:IMonitorEventSPI
Sets the string resource path for this event.- Specified by:
setStringResourcePath
in interfaceIMonitorEventSPI
- Parameters:
stringResourcePath
- the string resource path.- Returns:
- this event for chaining.
- See Also:
IMonitorEvent.getStringResourcePath()
-
getFields
public Collection<IMonitorFieldInstance> getFields()
Description copied from interface:IMonitorEvent
Returns an unmodifiable collection of the fields that should be collected for this event.- Specified by:
getFields
in interfaceIMonitorEvent
- Returns:
- an unmodifiable collection of the fields that should be collected for this event.
-
addField
public IMonitorEventSPI addField(IMonitorField field, boolean required)
Description copied from interface:IMonitorEventSPI
Adds the given field in this event.- Specified by:
addField
in interfaceIMonitorEventSPI
- Parameters:
field
- the field.required
- indicates whether the given field is required.- Returns:
- this event for chaining.
-
addFieldGroup
public IMonitorEventSPI addFieldGroup(IMonitorFieldGroup fieldGroup, boolean required)
Description copied from interface:IMonitorEventSPI
Adds the given field group in this event.- Specified by:
addFieldGroup
in interfaceIMonitorEventSPI
- Parameters:
fieldGroup
- the field grouprequired
- indicates whether the fields of the given field group are required.- Returns:
- this event for chaining.
-
removeField
public IMonitorEventSPI removeField(String fieldId)
Description copied from interface:IMonitorEventSPI
Removes the given field.- Specified by:
removeField
in interfaceIMonitorEventSPI
- Parameters:
fieldId
- the field identifier.- Returns:
- this event.
-
removeFieldGroup
public IMonitorEventSPI removeFieldGroup(String fieldGroupId)
Description copied from interface:IMonitorEventSPI
Removes the given field group.- Specified by:
removeFieldGroup
in interfaceIMonitorEventSPI
- Parameters:
fieldGroupId
- the field group identifier.- Returns:
- this event.
-
setStandard
public IMonitorEventSPI setStandard(boolean isStandard)
Description copied from interface:IMonitorEventSPI
Sets this event either as standard or custom (non-standard).- Specified by:
setStandard
in interfaceIMonitorEventSPI
- Parameters:
isStandard
- true to mark this event as standard, false to custom.- Returns:
- this event for chaining.
-
setProcessActionEvent
public IMonitorEventSPI setProcessActionEvent(boolean isProcessActionEvent)
Description copied from interface:IMonitorEventSPI
Sets this event either as process action event or a normal one.- Specified by:
setProcessActionEvent
in interfaceIMonitorEventSPI
- Parameters:
isProcessActionEvent
- true to mark this event as a process action one.- Returns:
- this event for chaining.
-
isProcessActionEvent
public boolean isProcessActionEvent()
Description copied from interface:IMonitorEventSPI
Returns if the event is a process action event.- Specified by:
isProcessActionEvent
in interfaceIMonitorEventSPI
- Returns:
- if the event is a process action event
-
getDirectFields
public Collection<IMonitorFieldInstance> getDirectFields()
Description copied from interface:IMonitorEventSPI
Returns the fields that are associated with this event directly (not through a field group).- Specified by:
getDirectFields
in interfaceIMonitorEventSPI
- Returns:
- the fields that are associated with this event directly (not through a field group).
-
removeDirectFields
public IMonitorEventSPI removeDirectFields(Collection<String> fieldsIds)
Removes the direct fields that has their ids in the given ids collection.- Parameters:
fieldsIds
- the identifiers of the fields to be removed- Returns:
- this event for chaining
- Since:
- 14.0.0
-
getFieldsGroups
public Collection<IMonitorFieldGroupInstance> getFieldsGroups()
Description copied from interface:IMonitorEventSPI
Returns the field groups associated with this event.- Specified by:
getFieldsGroups
in interfaceIMonitorEventSPI
- Returns:
- the field groups associated with this event.
-
removeFieldsGroups
public IMonitorEventSPI removeFieldsGroups(Collection<String> fieldsGroupsIds)
Removes the fields groups that has their ids in the given ids collection.- Parameters:
fieldsGroupsIds
- the identifiers of the fields groups to be removed- Returns:
- this event for chaining
- Since:
- 14.0.0
-
getLocalizedDescription
public String getLocalizedDescription()
Description copied from interface:IMonitorEvent
Returns the localized description of this event.- Specified by:
getLocalizedDescription
in interfaceIMonitorEvent
- Returns:
- the description of this event.
-
getLocalizedName
public String getLocalizedName()
Description copied from interface:IMonitorEvent
Returns the localized name of this event.- Specified by:
getLocalizedName
in interfaceIMonitorEvent
- Returns:
- the name for this event.
-
getImage
public String getImage()
Description copied from interface:IMonitorEvent
Returns the image.- Specified by:
getImage
in interfaceIMonitorEvent
- Returns:
- the image
-
setImage
public IMonitorEventSPI setImage(String image)
Description copied from interface:IMonitorEventSPI
Sets the image.- Specified by:
setImage
in interfaceIMonitorEventSPI
- Parameters:
image
- the image value to set.
-
setVerb
public IMonitorEventSPI setVerb(String verb)
Description copied from interface:IMonitorEventSPI
Sets the image.- Specified by:
setVerb
in interfaceIMonitorEventSPI
-
getVerb
public String getVerb()
Description copied from interface:IMonitorEvent
Returns the verb.- Specified by:
getVerb
in interfaceIMonitorEvent
- Returns:
- the verb.
-
getLocalizedVerb
public String getLocalizedVerb()
Description copied from interface:IMonitorEvent
Returns the localized verb of this event.- Specified by:
getLocalizedVerb
in interfaceIMonitorEvent
- Returns:
- the verb for this event.
-
getId
public String getId()
Returns the identifier of this element.- Returns:
- the identifier.
- Since:
- 14.0.0
-
getServiceInstanceId
public String getServiceInstanceId()
Returns the identifier of the service instance this element belongs to.- Returns:
- the identifier of the service instance this element belongs to or
null
if this element is global. - Since:
- 14.0.0
-
-