Interface IMonitorManagerSPI
-
- All Superinterfaces:
IMonitorManager
- All Known Implementing Classes:
MonitorManager
public interface IMonitorManagerSPI extends IMonitorManager
Monitor SPI interface.- Since:
- 9.0.0
- Version:
- $Revision: 24985 $ $Date: 2022-05-02 23:04:30 -0300 (Mon, 02 May 2022) $
-
-
Field Summary
Fields Modifier and Type Field Description static String
FRIENDLY_ID_FIELD_EMAIL
Indicates the field to be used to generate friendly identifier of monitor users fromUserConfig
isUserConfig.getEmail()
.static String
FRIENDLY_ID_FIELD_ID
Indicates the field to be used to generate friendly identifier of monitor users fromUserConfig
isUserConfig.getId()
.static 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(String monitorUserId)
Anonymizes the given monitor user.void
anonymizeMonitorUsers(Collection<String> monitorUserIds)
Anonymizes the given monitor users.void
clearEventsCache(String eventId)
Clears the cache relative to the event with the given identifier.void
clearRequestRulesCache()
Clears the request rules cache.IMonitorValuesProvider
createMonitorUserValuesProviderForTrackId(String trackId)
Creates a new monitor values provider that returns the values for monitor user fields corresponding to the given track identifier.IMonitorValuesProvider
createMonitorUserValuesProviderForUserId(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(String userId)
Deletes monitor user.void
deleteUserActivities(String userId)
Delete monitor user activities.Collection<IMonitorEvent>
getAllEvents()
Returns all monitor events.Collection<IMonitorFieldGroup>
getAllFieldGroups()
Returns all monitor field groups.Collection<IMonitorField>
getAllFields()
Returns all monitor fields.String
getCurrentMonitorUserTrackId()
Returns the track identifier of the current monitor user.IMonitorEventSPI
getEventFromCache(String eventId)
Returns the event with the given identifier using the internal monitor manager events cache.IMonitorFieldSPI
getFieldFromCache(String fieldId)
Returns the field with the given identifier using the internal monitor manager fields cache.String
getFriendlyIdUserField()
Returns the field used to calculated the monitor user's friendly id for portal users.IMonitorContextSPI
getMonitorContext()
Returns the current monitor context.String
getMonitorUserIdByTrackId(String monitorUserTrackId)
Returns the user identifier for a track identifier.PrincipalConfig
getMonitorUserPrincipal(String principalId)
Returns the principal object that represents a monitor user.String
getMonitorUserTrackId(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(String userId, IUserConfigInitializer userConfigInitializer)
Provides a monitor user information toIUserConfigInitializer
.void
mergeMonitorUserDuringAuthentication(String httpSessionId, String srcMonitorUserId, 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(String srcMonitorUserId, String destMonitorUserId)
Merger monitor users.boolean
monitorUserHasPortalUser(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(Collection<String> principalIds)
Schedule reindex of monitor users due to membership change.void
reindexMonitorUsers(Collection<String> monitorUserIds)
Reindex the given monitor users.void
restartExecutorService()
Restarts executor service.void
scheduleReindexMonitorUser(String id, 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(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(Runnable task)
Executes the given task at some time in the future using monitor internal executor service.IMonitor
syncMonitor(String eventId)
Returns a synchronous monitor.void
updateAllEventsDocumentTypes()
Updates all events document types.void
updateAllMonitorEventDocumentTypes()
Deprecated.Replaced byupdateAllEventsDocumentTypes()
void
updateMonitorDefinition(Set<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 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 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 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(Runnable task)
Executes the given task at some time in the future using monitor internal executor service.- Parameters:
task
- the runnable task.- Throws:
RejectedExecutionException
- if this task cannot be accepted for execution.NullPointerException
- if command is null.- Since:
- 14.0.0
-
restartExecutorService
void restartExecutorService()
Restarts executor service.- Since:
- 9.0.0
-
updateMonitorDefinition
void updateMonitorDefinition(Set<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(String id, 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(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(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(String httpSessionId, String srcMonitorUserId, 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:
IllegalArgumentException
- ifdestMonitorUserId
represents a monitor user without an associated portal user.IllegalArgumentException
- ifsrcMonitorUserId
anddestMonitorUserId
are equal.PortalException
- Since:
- 11.0.0
-
getAllEvents
Collection<IMonitorEvent> getAllEvents() throws PortalException
Returns all monitor events.- Returns:
- all monitor events.
- Throws:
PortalException
- Since:
- 11.0.0
-
getAllFields
Collection<IMonitorField> getAllFields() throws PortalException
Returns all monitor fields.- Returns:
- all monitor fields.
- Throws:
PortalException
- Since:
- 11.0.0
-
getAllFieldGroups
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(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
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(Collection<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(String srcMonitorUserId, String destMonitorUserId) throws PortalException
Merger monitor users.- Throws:
PortalException
- Since:
- 11.0.0
-
syncMonitor
IMonitor syncMonitor(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(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
String getMonitorUserTrackId(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
String getMonitorUserIdByTrackId(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
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(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(String userId) throws PortalException
Delete monitor user activities.- Parameters:
userId
- the user identifier.- Throws:
PortalException
- Since:
- 12.3.0
-
loadMonitorUserInfo
void loadMonitorUserInfo(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(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(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(Collection<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(Collection<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(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(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(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
-
-