Interface IMonitorManagerSPI
-
- All Superinterfaces:
IMonitorManager
- All Known Implementing Classes:
MonitorManager
public interface IMonitorManagerSPI extends IMonitorManager
Monitor SPI interface.- Since:
- 9.0.0
- Version:
- $Revision: 24978 $ $Date: 2022-05-02 16:46:33 -0300 (Mon, 02 May 2022) $
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
FRIENDLY_ID_FIELD_EMAIL
Indicates the field to be used to generate friendly identifier of monitor users fromUserConfig
isUserConfig.getEmail()
.static java.lang.String
FRIENDLY_ID_FIELD_ID
Indicates the field to be used to generate friendly identifier of monitor users fromUserConfig
isUserConfig.getId()
.static java.lang.String
FRIENDLY_ID_FIELD_LOGIN
Indicates the field to be used to generate friendly identifier of monitor users fromUserConfig
isUserConfig.getLogin()
.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
addMonitorUser(UserConfig userConfig)
Adds a new monitor user to persistence.void
anonymizeAllMonitorUser()
Anonymizes all monitor users without consent.void
anonymizeMonitorUser(java.lang.String monitorUserId)
Anonymizes the given monitor user.void
anonymizeMonitorUsers(java.util.Collection<java.lang.String> monitorUserIds)
Anonymizes the given monitor users.void
clearEventsCache(java.lang.String eventId)
Clears the cache relative to the event with the given identifier.void
clearRequestRulesCache()
Clears the request rules cache.IMonitorValuesProvider
createMonitorUserValuesProviderForTrackId(java.lang.String trackId)
Creates a new monitor values provider that returns the values for monitor user fields corresponding to the given track identifier.IMonitorValuesProvider
createMonitorUserValuesProviderForUserId(java.lang.String monitorUserId)
Creates a new monitor values provider that returns the values for monitor user fields corresponding to the given user identifier.void
deleteMonitorElementsFromServiceInstance(ServiceInstanceConfig serviceInstance)
Deletes events, fields and field groups of the given service instance.void
deleteMonitorUser(java.lang.String userId)
Deletes monitor user.void
deleteUserActivities(java.lang.String userId)
Delete monitor user activities.java.util.Collection<IMonitorEvent>
getAllEvents()
Returns all monitor events.java.util.Collection<IMonitorFieldGroup>
getAllFieldGroups()
Returns all monitor field groups.java.util.Collection<IMonitorField>
getAllFields()
Returns all monitor fields.java.lang.String
getCurrentMonitorUserTrackId()
Returns the track identifier of the current monitor user.IMonitorEventSPI
getEventFromCache(java.lang.String eventId)
Returns the event with the given identifier using the internal monitor manager events cache.IMonitorFieldSPI
getFieldFromCache(java.lang.String fieldId)
Returns the field with the given identifier using the internal monitor manager fields cache.java.lang.String
getFriendlyIdUserField()
Returns the field used to calculated the monitor user's friendly id for portal users.IMonitorContextSPI
getMonitorContext()
Returns the current monitor context.java.lang.String
getMonitorUserIdByTrackId(java.lang.String monitorUserTrackId)
Returns the user identifier for a track identifier.PrincipalConfig
getMonitorUserPrincipal(java.lang.String principalId)
Returns the principal object that represents a monitor user.java.lang.String
getMonitorUserTrackId(java.lang.String monitorUserId)
Returns the track identifier for a monitor user.IMonitorStatistics
getStatistics()
Returns statistics about monitoring framework.void
init()
Initializes the monitor manager.void
initializeMonitoringData(ITransaction transaction)
Method called during portal database initialization to populate the monitoring related data.void
initializeMonitorRequestRules()
Initializes the monitor request rules.void
loadMonitorUserInfo(java.lang.String userId, IUserConfigInitializer userConfigInitializer)
Provides a monitor user information toIUserConfigInitializer
.void
mergeMonitorUserDuringAuthentication(java.lang.String httpSessionId, java.lang.String srcMonitorUserId, java.lang.String destMonitorUserId)
Merges a monitor user to another, because a http session identified as the first monitor user was authenticated as the second monitor user.void
mergeMonitorUsers(java.lang.String srcMonitorUserId, java.lang.String destMonitorUserId)
Merger monitor users.boolean
monitorUserHasPortalUser(java.lang.String monitorUserId)
Returns whether the monitor user with the given identifier has a portal user.void
reindexAllMonitorUser()
Reindex all monitor users and their event data.void
reindexGroupMember(java.util.Collection<java.lang.String> principalIds)
Schedule reindex of monitor users due to membership change.void
reindexMonitorUsers(java.util.Collection<java.lang.String> monitorUserIds)
Reindex the given monitor users.void
restartExecutorService()
Restarts executor service.void
scheduleReindexMonitorUser(java.lang.String id, java.lang.Long visitorId)
Schedules the reindexing of the monitor user with the given identifier on big data after the commit of the current transaction.void
setFriendlyIdUserField(java.lang.String field)
Sets the field used to calculated the monitor user's friendly id for portal users.boolean
shouldMonitorRequest(HttpServletRequest request)
Returns whether the given request should have the events monitored.void
shutdown()
Shutdowns the monitor manager.void
submit(java.lang.Runnable task)
Executes the given task at some time in the future using monitor internal executor service.IMonitor
syncMonitor(java.lang.String eventId)
Returns a synchronous monitor.void
updateAllEventsDocumentTypes()
Updates all events document types.void
updateAllMonitorEventDocumentTypes()
Deprecated.Replaced byupdateAllEventsDocumentTypes()
void
updateMonitorDefinition(java.util.Set<java.lang.String> definitionPaths)
Updates the monitor definition from the given file paths.void
updateMonitorUser(UserConfig userConfig, UserConfig original)
Updates the data stored in a monitor user with the corresponding data on a portal user.default void
updateMonitorUserDocumentType()
Updates monitor user document types.void
updateMonitorUserDocumentType(IBigDataRepository repository)
Updates monitor user document types.void
upgradeEventData()
Schedules the upgrade of event data in BigData.-
Methods inherited from interface lumis.portal.monitor.IMonitorManager
getCurrentMonitorUserId, getEvent, getField, getFieldGroup, monitor, monitor
-
-
-
-
Field Detail
-
FRIENDLY_ID_FIELD_EMAIL
static final java.lang.String FRIENDLY_ID_FIELD_EMAIL
Indicates the field to be used to generate friendly identifier of monitor users fromUserConfig
isUserConfig.getEmail()
.- Since:
- 11.0.0
- See Also:
setFriendlyIdUserField(String)
, Constant Field Values
-
FRIENDLY_ID_FIELD_ID
static final java.lang.String FRIENDLY_ID_FIELD_ID
Indicates the field to be used to generate friendly identifier of monitor users fromUserConfig
isUserConfig.getId()
.- Since:
- 11.0.0
- See Also:
setFriendlyIdUserField(String)
, Constant Field Values
-
FRIENDLY_ID_FIELD_LOGIN
static final java.lang.String FRIENDLY_ID_FIELD_LOGIN
Indicates the field to be used to generate friendly identifier of monitor users fromUserConfig
isUserConfig.getLogin()
.- Since:
- 11.0.0friendlyIdUserField
- See Also:
setFriendlyIdUserField(String)
, Constant Field Values
-
-
Method Detail
-
initializeMonitoringData
void initializeMonitoringData(ITransaction transaction) throws PortalException
Method called during portal database initialization to populate the monitoring related data.- Parameters:
transaction
- the transaction for persistence access.- Throws:
PortalException
- Since:
- 9.0.0
-
init
void init()
Initializes the monitor manager.- Since:
- 9.0.0
-
shutdown
void shutdown()
Shutdowns the monitor manager.- Since:
- 9.0.0
-
submit
void submit(java.lang.Runnable task)
Executes the given task at some time in the future using monitor internal executor service.- Parameters:
task
- the runnable task.- Throws:
java.util.concurrent.RejectedExecutionException
- if this task cannot be accepted for execution.java.lang.NullPointerException
- if command is null.- Since:
- 14.0.0
-
restartExecutorService
void restartExecutorService()
Restarts executor service.- Since:
- 9.0.0
-
updateMonitorDefinition
void updateMonitorDefinition(java.util.Set<java.lang.String> definitionPaths) throws PortalException
Updates the monitor definition from the given file paths. The files will be read from the class loader.- Parameters:
definitionPaths
- the definition paths.- Throws:
PortalException
- Since:
- 11.0.0
-
scheduleReindexMonitorUser
void scheduleReindexMonitorUser(java.lang.String id, java.lang.Long visitorId) throws PortalException
Schedules the reindexing of the monitor user with the given identifier on big data after the commit of the current transaction.- Parameters:
id
- the monitor user identifier.visitorId
- the monitor user visitor identifier.- Throws:
PortalException
- Since:
- 12.0.0
-
createMonitorUserValuesProviderForUserId
IMonitorValuesProvider createMonitorUserValuesProviderForUserId(java.lang.String monitorUserId)
Creates a new monitor values provider that returns the values for monitor user fields corresponding to the given user identifier. This provider will persist a monitor user when requested for values if no monitor user with the given identifier exists.- Parameters:
monitorUserId
- the monitor user identifier.- Returns:
- the monitor values provider.
- Since:
- 12.0.0
-
createMonitorUserValuesProviderForTrackId
IMonitorValuesProvider createMonitorUserValuesProviderForTrackId(java.lang.String trackId)
Creates a new monitor values provider that returns the values for monitor user fields corresponding to the given track identifier. This provider will persist a monitor user when requested for values if no monitor user with the given identifier exists.- Parameters:
trackId
- the monitor user track identifier.- Returns:
- the monitor values provider.
- Since:
- 12.0.0
-
addMonitorUser
void addMonitorUser(UserConfig userConfig) throws PortalException
Adds a new monitor user to persistence.- Parameters:
userConfig
- the portal user.- Throws:
PortalException
- Since:
- 11.0.0
-
updateMonitorUser
void updateMonitorUser(UserConfig userConfig, UserConfig original) throws PortalException
Updates the data stored in a monitor user with the corresponding data on a portal user.- Parameters:
userConfig
- the portal user with the updated information.userConfig
- the portal user with its information before update was done on it.- Throws:
PortalException
- Since:
- 12.0.0
-
mergeMonitorUserDuringAuthentication
void mergeMonitorUserDuringAuthentication(java.lang.String httpSessionId, java.lang.String srcMonitorUserId, java.lang.String destMonitorUserId) throws PortalException
Merges a monitor user to another, because a http session identified as the first monitor user was authenticated as the second monitor user.This method uses its own transaction for this operation.
If the source monitor user has some identification (an associated portal user or friendlyId set) then a partial merge will be performed. Otherwise a full merge will be performed.
A partial merge will move non-authenticated event data that belongs to the specified HTTP session and the source monitor user to the destination monitor user.
A full merge will move all event data that belongs to the source monitor user to the destination monitor user, will copy source monitor user's properties to the destination monitor user (but will not overwrite data of destination monitor user's portal user as per monitor user standard behavior) and will delete the source monitor user.
- Parameters:
httpSessionId
- http session identifier used for partial merge.srcMonitorUserId
- the monitor user that will be merged to another.destMonitorUserId
- the monitor user destination of the merge.- Throws:
java.lang.IllegalArgumentException
- ifdestMonitorUserId
represents a monitor user without an associated portal user.java.lang.IllegalArgumentException
- ifsrcMonitorUserId
anddestMonitorUserId
are equal.PortalException
- Since:
- 11.0.0
-
getAllEvents
java.util.Collection<IMonitorEvent> getAllEvents() throws PortalException
Returns all monitor events.- Returns:
- all monitor events.
- Throws:
PortalException
- Since:
- 11.0.0
-
getAllFields
java.util.Collection<IMonitorField> getAllFields() throws PortalException
Returns all monitor fields.- Returns:
- all monitor fields.
- Throws:
PortalException
- Since:
- 11.0.0
-
getAllFieldGroups
java.util.Collection<IMonitorFieldGroup> getAllFieldGroups() throws PortalException
Returns all monitor field groups.- Returns:
- all monitor field groups.
- Throws:
PortalException
- Since:
- 14.0.0
-
getMonitorContext
IMonitorContextSPI getMonitorContext()
Description copied from interface:IMonitorManager
Returns the current monitor context.- Specified by:
getMonitorContext
in interfaceIMonitorManager
- Returns:
- the current monitor context, or null if there is no current monitor context.
-
shouldMonitorRequest
boolean shouldMonitorRequest(HttpServletRequest request) throws PortalException
Returns whether the given request should have the events monitored.- Parameters:
request
- the request.- Returns:
- whether the given request should have the events monitored.
- Throws:
PortalException
- Since:
- 11.0.0
-
initializeMonitorRequestRules
void initializeMonitorRequestRules() throws PortalException
Initializes the monitor request rules.- Throws:
PortalException
- Since:
- 11.0.0
-
clearRequestRulesCache
void clearRequestRulesCache() throws PortalException
Clears the request rules cache.- Throws:
PortalException
- Since:
- 11.0.0
-
reindexAllMonitorUser
void reindexAllMonitorUser() throws PortalException
Reindex all monitor users and their event data.- Throws:
PortalException
- Since:
- 11.0.0
-
setFriendlyIdUserField
void setFriendlyIdUserField(java.lang.String field) throws PortalException
Sets the field used to calculated the monitor user's friendly id for portal users.Note: this method uses its own transaction.
- Parameters:
field
- one ofFRIENDLY_ID_FIELD_ID
,FRIENDLY_ID_FIELD_LOGIN
,FRIENDLY_ID_FIELD_EMAIL
, the identifier of aUserAttribute
ornull
to indicate no friendly id.- Throws:
PortalException
- Since:
- 11.0.0
-
getFriendlyIdUserField
java.lang.String getFriendlyIdUserField() throws PortalException
Returns the field used to calculated the monitor user's friendly id for portal users.- Returns:
- the friendly identifier field. One of
FRIENDLY_ID_FIELD_ID
,FRIENDLY_ID_FIELD_LOGIN
,FRIENDLY_ID_FIELD_EMAIL
, the identifier of aUserAttribute
ornull
to indicate no friendly id. - Throws:
PortalException
- Since:
- 11.0.0
-
reindexGroupMember
void reindexGroupMember(java.util.Collection<java.lang.String> principalIds) throws PortalException
Schedule reindex of monitor users due to membership change.- Parameters:
principalIds
- the principal identifiers where all monitor users that belongs to them must be reindexed.- Throws:
PortalException
- if the reindexing could not be scheduled.- Since:
- 11.0.0
-
upgradeEventData
void upgradeEventData() throws PortalException
Schedules the upgrade of event data in BigData.- Throws:
PortalException
- Since:
- 11.0.0
-
mergeMonitorUsers
void mergeMonitorUsers(java.lang.String srcMonitorUserId, java.lang.String destMonitorUserId) throws PortalException
Merger monitor users.- Throws:
PortalException
- Since:
- 11.0.0
-
syncMonitor
IMonitor syncMonitor(java.lang.String eventId) throws PortalException
Returns a synchronous monitor.- Parameters:
eventId
- the event identifier- Returns:
- a synchronous monitor.
- Throws:
PortalException
- Since:
- 12.0.0
- See Also:
IMonitorManager.monitor(String)
-
monitorUserHasPortalUser
boolean monitorUserHasPortalUser(java.lang.String monitorUserId)
Returns whether the monitor user with the given identifier has a portal user.- Parameters:
monitorUserId
- the monitor user identifier.- Returns:
true
if the corresponding monitor user has a portal user,false
if the monitor user does not have a portal user or if it was not found.- Since:
- 12.0.0
-
getMonitorUserTrackId
java.lang.String getMonitorUserTrackId(java.lang.String monitorUserId)
Returns the track identifier for a monitor user.- Parameters:
monitorUserId
- the monitor user identifier.- Returns:
- the track identifier, or
null
if no such monitor user is available. - Since:
- 12.0.0
-
getMonitorUserIdByTrackId
java.lang.String getMonitorUserIdByTrackId(java.lang.String monitorUserTrackId)
Returns the user identifier for a track identifier.- Parameters:
monitorUserTrackId
- the track identifier.- Returns:
- the user identifier, or
null
if no such track identifier is unavailable. - Since:
- 12.0.0
-
getCurrentMonitorUserTrackId
java.lang.String getCurrentMonitorUserTrackId()
Returns the track identifier of the current monitor user.- Returns:
- the monitor user track identifier, or
null
if it is not set. - Since:
- 12.0.0
-
deleteMonitorUser
void deleteMonitorUser(java.lang.String userId)
Deletes monitor user. This is to be used internally when a portal user will be deleted.- Parameters:
userId
- the user identifier.- Since:
- 12.0.0
-
deleteUserActivities
void deleteUserActivities(java.lang.String userId) throws PortalException
Delete monitor user activities.- Parameters:
userId
- the user identifier.- Throws:
PortalException
- Since:
- 12.3.0
-
loadMonitorUserInfo
void loadMonitorUserInfo(java.lang.String userId, IUserConfigInitializer userConfigInitializer) throws PortalException
Provides a monitor user information toIUserConfigInitializer
.- Parameters:
userId
- the user identifier.userConfigInitializer
- the initializer.- Throws:
PortalException
- Since:
- 12.0.0
-
getMonitorUserPrincipal
PrincipalConfig getMonitorUserPrincipal(java.lang.String principalId)
Returns the principal object that represents a monitor user.- Parameters:
principalId
- the principal identifier.- Returns:
- the principal or
null
if no such monitor user exists. - Since:
- 12.0.0
-
getStatistics
IMonitorStatistics getStatistics()
Returns statistics about monitoring framework.- Returns:
- statistics about monitoring framework.
- Since:
- 12.2.0
-
updateAllMonitorEventDocumentTypes
@Deprecated void updateAllMonitorEventDocumentTypes() throws PortalException
Deprecated.Replaced byupdateAllEventsDocumentTypes()
Updates all monitor event document types. Ignores the events that doesn't have the document types created.- Throws:
PortalException
- Since:
- 12.2.0
-
updateMonitorUserDocumentType
default void updateMonitorUserDocumentType() throws PortalException
Updates monitor user document types. Ignores the events that doesn't have the document types created. CallsupdateMonitorUserDocumentType(IBigDataRepository)
using the default repository.- Throws:
PortalException
- Since:
- 12.2.0
-
updateMonitorUserDocumentType
void updateMonitorUserDocumentType(IBigDataRepository repository) throws PortalException
Updates monitor user document types. Ignores the events that doesn't have the document types created.- Parameters:
repository
- the big data repository to use.- Throws:
PortalException
- Since:
- 12.2.0
-
anonymizeAllMonitorUser
void anonymizeAllMonitorUser() throws PortalException
Anonymizes all monitor users without consent.- Throws:
PortalException
- Since:
- 12.3.0
-
anonymizeMonitorUser
void anonymizeMonitorUser(java.lang.String monitorUserId) throws PortalException
Anonymizes the given monitor user. Any consents in the given user will be removed.- Parameters:
monitorUserId
- the monitor user identifier.- Throws:
PortalException
- Since:
- 12.3.0
-
anonymizeMonitorUsers
void anonymizeMonitorUsers(java.util.Collection<java.lang.String> monitorUserIds) throws PortalException
Anonymizes the given monitor users. Any consents in the given user will be removed. This operation will be performed in background.- Parameters:
monitorUserIds
- the monitor user identifiers.- Throws:
PortalException
- Since:
- 12.3.0
-
reindexMonitorUsers
void reindexMonitorUsers(java.util.Collection<java.lang.String> monitorUserIds) throws PortalException
Reindex the given monitor users.- Parameters:
monitorUserIds
- the monitor user identifiers.- Throws:
PortalException
- Since:
- 12.3.0
-
updateAllEventsDocumentTypes
void updateAllEventsDocumentTypes() throws PortalException
Updates all events document types. Ignores the events that doesn't have the document types created.- Throws:
PortalException
- Since:
- 12.4.0
-
deleteMonitorElementsFromServiceInstance
void deleteMonitorElementsFromServiceInstance(ServiceInstanceConfig serviceInstance)
Deletes events, fields and field groups of the given service instance.- Parameters:
serviceInstance
- the service instance- Since:
- 12.5.0
-
clearEventsCache
void clearEventsCache(java.lang.String eventId) throws PortalException
Clears the cache relative to the event with the given identifier.- Parameters:
eventId
- the event identifier.- Throws:
PortalException
- Since:
- 14.0.0
-
getEventFromCache
IMonitorEventSPI getEventFromCache(java.lang.String eventId) throws PortalException
Returns the event with the given identifier using the internal monitor manager events cache. This method is intended to be the most performance efficient possible. It is more efficient thanIMonitorManager.getEvent(String)
, but the the event returned here is detached.- Parameters:
eventId
- the event identifier.- Returns:
- the detached event, or
null
if no event with the given identifier was found. - Throws:
PortalException
- Since:
- 14.0.0
-
getFieldFromCache
IMonitorFieldSPI getFieldFromCache(java.lang.String fieldId) throws PortalException
Returns the field with the given identifier using the internal monitor manager fields cache. This method is intended to be the most performance efficient possible. It is more efficient thanIMonitorManager.getField(String)
, but the the field returned here is detached. UnlikeIMonitorManager.getField(String)
, this method returnsnull
if the field is not found (instead of throwingPortalObjectNotFoundException
).- Parameters:
fieldId
- the field identifier- Returns:
- the detached field or
null
if no such field was found. - Throws:
PortalException
- Since:
- 14.2.0
-
-