public class MonitorManager extends Object implements IMonitorManagerSPI
IMonitorManagerSPI
interface.Modifier and Type | Field and Description |
---|---|
static String |
BIG_DATA_ANONYMIZATION_STRING_VALUE |
FRIENDLY_ID_FIELD_EMAIL, FRIENDLY_ID_FIELD_ID, FRIENDLY_ID_FIELD_LOGIN
Constructor and Description |
---|
MonitorManager() |
Modifier and Type | Method and 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.
|
static void |
anonymizeMonitorUserPendingData(MonitorUser monitorUser)
Anonymizes data for the given user that should be anonimized but it is not.
|
void |
anonymizeMonitorUsers(Collection<String> monitorUserIds)
Anonymizes the given monitor users.
|
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<IMonitorField> |
getAllFields()
Returns all monitor fields.
|
String |
getCurrentMonitorUserId()
Returns the identifier of the current monitor user.
|
String |
getCurrentMonitorUserTrackId()
Returns the track identifier of the current monitor user.
|
IMonitorEventSPI |
getEvent(String eventId)
Returns an unmodifiable event.
|
ExecutorService |
getExecutorService()
Returns the executor service to be used when monitoring values.
|
IMonitorFieldSPI |
getField(String fieldId)
Returns an unmodifiable field.
|
IMonitorFieldGroup |
getFieldGroup(String fieldGroupId)
Returns an unmodifiable field group.
|
String |
getFriendlyIdUserField()
Returns the field used to calculated the monitor user's friendly id for portal users.
|
lumis.portal.monitor.impl.MonitorContext |
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,
boolean forceEventProcess)
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 to
IUserConfigInitializer . |
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.
|
IMonitor |
monitor(String eventId)
Returns the monitor for an event with the given identifier.
|
IMonitor |
monitor(String eventId,
ITransaction transaction)
Returns the monitor for an event with the given identifier.
|
boolean |
monitorUserHasPortalUser(String monitorUserId)
Returns whether the monitor user with the given identifier has a portal user.
|
protected void |
persistFieldRecursively(org.hibernate.Session session,
IMonitorField field)
Persist the given field and any inner fields recursively.
|
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 requestField)
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.
|
IMonitor |
syncMonitor(String eventId)
Returns a synchronous monitor.
|
void |
updateAllEventsDocumentTypes()
Updates all events document types.
|
void |
updateAllMonitorEventDocumentTypes()
Updates all monitor event document types.
|
void |
updateMonitorDefinition(Set<String> definitionPaths)
Updates the monitor definition from the given file paths.
|
void |
updateMonitorUser(UserConfig userConfig,
UserConfig originalUserConfig)
Updates the data stored in a monitor user with the corresponding data on a portal user.
|
void |
updateMonitorUserDocumentType(IBigDataRepository repository)
Updates monitor user document types.
|
void |
upgradeEventData()
Schedules the upgrade of event data in BigData.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
updateMonitorUserDocumentType
public static final String BIG_DATA_ANONYMIZATION_STRING_VALUE
public IMonitorStatistics getStatistics()
IMonitorManagerSPI
getStatistics
in interface IMonitorManagerSPI
public lumis.portal.monitor.impl.MonitorContext getMonitorContext()
IMonitorManager
getMonitorContext
in interface IMonitorManager
getMonitorContext
in interface IMonitorManagerSPI
public IMonitor monitor(String eventId) throws PortalException
IMonitorManager
The call to this method is equivalent of
monitor(eventId, null)
.
monitor
in interface IMonitorManager
eventId
- the event identifier.PortalException
IMonitor
,
IMonitorManager.monitor(String, ITransaction)
public IMonitor monitor(String eventId, ITransaction transaction) throws PortalException
IMonitorManager
If no event with the given identifier exists then a warn message will be generated in the LumisXP log.
If no event with the given identifier exists or if the event is disabled then a dummy monitor object will be
returned (a IMonitor
implementation that will not persist any data).
If the given transaction is not null
, the monitoring data will be saved after the transaction has
terminated (either by a successful commit or by a rollback) and the monitor has been
closed
.
If the given transaction is null
, the monitoring data will be saved when the monitor has been
closed
.
If the given transaction is not null
, values for transaction result
fields will provided automatically if the event has any of those fields.
monitor
in interface IMonitorManager
eventId
- the event identifier.transaction
- the transaction the given monitor will be bound to.PortalException
IMonitor
public IMonitor syncMonitor(String eventId) throws PortalException
IMonitorManagerSPI
syncMonitor
in interface IMonitorManagerSPI
eventId
- the event identifierPortalException
IMonitorManager.monitor(String)
public IMonitorEventSPI getEvent(String eventId) throws PortalException
IMonitorManager
getEvent
in interface IMonitorManager
eventId
- the event's identifier.PortalObjectNotFoundException
- if no event with such id was found.PortalException
public IMonitorFieldSPI getField(String fieldId) throws PortalException
IMonitorManager
getField
in interface IMonitorManager
fieldId
- the field's identifier.PortalObjectNotFoundException
- if no field with such id was found.PortalException
public void initializeMonitoringData(ITransaction transaction, boolean forceEventProcess) throws PortalException
IMonitorManagerSPI
initializeMonitoringData
in interface IMonitorManagerSPI
transaction
- the transaction for persistence access.forceEventProcess
- if true
will reprocess all events, otherwise false
will only process the needed events.PortalException
protected void persistFieldRecursively(org.hibernate.Session session, IMonitorField field)
session
- the session.field
- the field.public void init()
IMonitorManagerSPI
init
in interface IMonitorManagerSPI
public void shutdown()
IMonitorManagerSPI
shutdown
in interface IMonitorManagerSPI
public ExecutorService getExecutorService()
IMonitorManagerSPI
getExecutorService
in interface IMonitorManagerSPI
public void restartExecutorService()
IMonitorManagerSPI
restartExecutorService
in interface IMonitorManagerSPI
public IMonitorFieldGroup getFieldGroup(String fieldGroupId) throws PortalException
IMonitorManager
getFieldGroup
in interface IMonitorManager
fieldGroupId
- the field group's identifier.PortalObjectNotFoundException
- if no such field group was found.PortalException
public void updateMonitorDefinition(Set<String> definitionPaths) throws PortalException
IMonitorManagerSPI
updateMonitorDefinition
in interface IMonitorManagerSPI
definitionPaths
- the definition paths.PortalException
public void updateAllEventsDocumentTypes()
IMonitorManagerSPI
updateAllEventsDocumentTypes
in interface IMonitorManagerSPI
public void scheduleReindexMonitorUser(String id, Long visitorId) throws PortalException
IMonitorManagerSPI
scheduleReindexMonitorUser
in interface IMonitorManagerSPI
id
- the monitor user identifier.visitorId
- the monitor user visitor identifier.PortalException
public IMonitorValuesProvider createMonitorUserValuesProviderForUserId(String monitorUserId)
IMonitorManagerSPI
createMonitorUserValuesProviderForUserId
in interface IMonitorManagerSPI
monitorUserId
- the monitor user identifier.public IMonitorValuesProvider createMonitorUserValuesProviderForTrackId(String trackId)
IMonitorManagerSPI
createMonitorUserValuesProviderForTrackId
in interface IMonitorManagerSPI
trackId
- the monitor user track identifier.public String getCurrentMonitorUserId()
IMonitorManager
getCurrentMonitorUserId
in interface IMonitorManager
null
if it is not set.public String getCurrentMonitorUserTrackId()
IMonitorManagerSPI
getCurrentMonitorUserTrackId
in interface IMonitorManagerSPI
null
if it is not set.public void addMonitorUser(UserConfig userConfig) throws PortalException
IMonitorManagerSPI
addMonitorUser
in interface IMonitorManagerSPI
userConfig
- the portal user.PortalException
public void updateMonitorUser(UserConfig userConfig, UserConfig originalUserConfig) throws PortalException
IMonitorManagerSPI
updateMonitorUser
in interface IMonitorManagerSPI
userConfig
- the portal user with the updated information.PortalException
public void mergeMonitorUserDuringAuthentication(String httpSessionId, String srcMonitorUserId, String destMonitorUserId) throws PortalException
IMonitorManagerSPI
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.
mergeMonitorUserDuringAuthentication
in interface IMonitorManagerSPI
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.PortalException
public Collection<IMonitorEvent> getAllEvents()
IMonitorManagerSPI
getAllEvents
in interface IMonitorManagerSPI
public Collection<IMonitorField> getAllFields()
IMonitorManagerSPI
getAllFields
in interface IMonitorManagerSPI
public boolean shouldMonitorRequest(HttpServletRequest request) throws PortalException
IMonitorManagerSPI
shouldMonitorRequest
in interface IMonitorManagerSPI
request
- the request.PortalException
public void initializeMonitorRequestRules() throws PortalException
IMonitorManagerSPI
initializeMonitorRequestRules
in interface IMonitorManagerSPI
PortalException
public void clearRequestRulesCache() throws PortalException
IMonitorManagerSPI
clearRequestRulesCache
in interface IMonitorManagerSPI
PortalException
public void reindexAllMonitorUser() throws PortalException
IMonitorManagerSPI
reindexAllMonitorUser
in interface IMonitorManagerSPI
PortalException
public void setFriendlyIdUserField(String requestField) throws PortalException
IMonitorManagerSPI
Note: this method uses its own transaction.
setFriendlyIdUserField
in interface IMonitorManagerSPI
requestField
- one of IMonitorManagerSPI.FRIENDLY_ID_FIELD_ID
, IMonitorManagerSPI.FRIENDLY_ID_FIELD_LOGIN
,
IMonitorManagerSPI.FRIENDLY_ID_FIELD_EMAIL
, the identifier of a UserAttribute
or null
to indicate no
friendly id.PortalException
public String getFriendlyIdUserField() throws PortalException
IMonitorManagerSPI
getFriendlyIdUserField
in interface IMonitorManagerSPI
IMonitorManagerSPI.FRIENDLY_ID_FIELD_ID
, IMonitorManagerSPI.FRIENDLY_ID_FIELD_LOGIN
,
IMonitorManagerSPI.FRIENDLY_ID_FIELD_EMAIL
, the identifier of a UserAttribute
or null
to indicate no
friendly id.PortalException
public void reindexGroupMember(Collection<String> principalIds) throws PortalException
IMonitorManagerSPI
reindexGroupMember
in interface IMonitorManagerSPI
principalIds
- the principal identifiers where all monitor users that belongs to them must be reindexed.PortalException
- if the reindexing could not be scheduled.public void upgradeEventData() throws PortalException
IMonitorManagerSPI
upgradeEventData
in interface IMonitorManagerSPI
PortalException
public void mergeMonitorUsers(String srcMonitorUserId, String destMonitorUserId) throws PortalException
IMonitorManagerSPI
mergeMonitorUsers
in interface IMonitorManagerSPI
PortalException
public boolean monitorUserHasPortalUser(String monitorUserId)
IMonitorManagerSPI
monitorUserHasPortalUser
in interface IMonitorManagerSPI
monitorUserId
- the monitor user identifier.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.public String getMonitorUserTrackId(String monitorUserId)
IMonitorManagerSPI
getMonitorUserTrackId
in interface IMonitorManagerSPI
monitorUserId
- the monitor user identifier.null
if no such monitor user is available.public String getMonitorUserIdByTrackId(String monitorUserTrackId)
IMonitorManagerSPI
getMonitorUserIdByTrackId
in interface IMonitorManagerSPI
monitorUserTrackId
- the track identifier.null
if no such track identifier is unavailable.public void deleteMonitorUser(String userId)
IMonitorManagerSPI
deleteMonitorUser
in interface IMonitorManagerSPI
userId
- the user identifier.public void deleteUserActivities(String userId) throws PortalException
IMonitorManagerSPI
deleteUserActivities
in interface IMonitorManagerSPI
userId
- the user identifier.PortalException
public void loadMonitorUserInfo(String userId, IUserConfigInitializer userConfigInitializer) throws PortalException
IMonitorManagerSPI
IUserConfigInitializer
.loadMonitorUserInfo
in interface IMonitorManagerSPI
userId
- the user identifier.userConfigInitializer
- the initializer.PortalException
public PrincipalConfig getMonitorUserPrincipal(String principalId)
IMonitorManagerSPI
getMonitorUserPrincipal
in interface IMonitorManagerSPI
principalId
- the principal identifier.null
if no such monitor user exists.public void updateAllMonitorEventDocumentTypes() throws PortalException
IMonitorManagerSPI
updateAllMonitorEventDocumentTypes
in interface IMonitorManagerSPI
PortalException
public void updateMonitorUserDocumentType(IBigDataRepository repository) throws PortalException
IMonitorManagerSPI
updateMonitorUserDocumentType
in interface IMonitorManagerSPI
repository
- the big data repository to use.PortalException
public void anonymizeAllMonitorUser() throws PortalException
IMonitorManagerSPI
anonymizeAllMonitorUser
in interface IMonitorManagerSPI
PortalException
public static void anonymizeMonitorUserPendingData(MonitorUser monitorUser) throws PortalException
monitorUser
- the monitor user to perform the operation.PortalException
public void anonymizeMonitorUser(String monitorUserId) throws PortalException
IMonitorManagerSPI
anonymizeMonitorUser
in interface IMonitorManagerSPI
monitorUserId
- the monitor user identifier.PortalException
public void anonymizeMonitorUsers(Collection<String> monitorUserIds) throws PortalException
IMonitorManagerSPI
anonymizeMonitorUsers
in interface IMonitorManagerSPI
monitorUserIds
- the monitor user identifiers.PortalException
public void reindexMonitorUsers(Collection<String> monitorUserIds) throws PortalException
IMonitorManagerSPI
reindexMonitorUsers
in interface IMonitorManagerSPI
monitorUserIds
- the monitor user identifiers.PortalException
public void deleteMonitorElementsFromServiceInstance(ServiceInstanceConfig serviceInstance)
IMonitorManagerSPI
deleteMonitorElementsFromServiceInstance
in interface IMonitorManagerSPI
serviceInstance
- the service instanceLumisXP 12.5.0.200928 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.