public class MonitorManager extends Object implements IMonitorManagerSPI
IMonitorManagerSPI
interface.FRIENDLY_ID_FIELD_EMAIL, FRIENDLY_ID_FIELD_ID, FRIENDLY_ID_FIELD_LOGIN
Constructor and Description |
---|
MonitorManager() |
Modifier and Type | Method and Description |
---|---|
String |
addMonitorUser(UserConfig userConfig)
Adds a new monitor user to persistence.
|
void |
clearRequestRulesCache()
Clears the request rules cache.
|
Collection<IMonitorEvent> |
getAllEvents()
Returns all monitor events.
|
Collection<IMonitorField> |
getAllFields()
Returns all monitor fields.
|
String |
getCurrentMonitorUserId()
Returns the 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.
|
IMonitorValuesProvider |
getMonitorUserValuesProvider(String monitorUserId)
Returns a monitor values provider that returns the values for monitor user
fields.
|
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 |
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.
|
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 |
restartExecutorService()
Restarts executor service.
|
void |
scheduleReindexMonitorUser(String id)
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.
|
void |
updateMonitorDefinition(Set<String> definitionPaths)
Updates the monitor definition from the given file paths.
|
void |
updateMonitorUser(String monitorUserId,
UserConfig userConfig,
UserConfig originalUserConfig)
Updates the data stored in a monitor user with the corresponding data on a portal user.
|
void |
upgradeEventData()
Schedules the upgrade of event data in BigData.
|
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 Lumis Portal 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 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) throws PortalException
IMonitorManagerSPI
initializeMonitoringData
in interface IMonitorManagerSPI
transaction
- the transaction for persistence access.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 scheduleReindexMonitorUser(String id) throws PortalException
IMonitorManagerSPI
scheduleReindexMonitorUser
in interface IMonitorManagerSPI
id
- the monitor user identifier.PortalException
public IMonitorValuesProvider getMonitorUserValuesProvider(String monitorUserId)
IMonitorManagerSPI
getMonitorUserValuesProvider
in interface IMonitorManagerSPI
monitorUserId
- the monitor user identifier.public String getCurrentMonitorUserId()
IMonitorManager
getCurrentMonitorUserId
in interface IMonitorManager
null
if it is not set.public String addMonitorUser(UserConfig userConfig) throws PortalException
IMonitorManagerSPI
addMonitorUser
in interface IMonitorManagerSPI
userConfig
- the portal user.PortalException
public void updateMonitorUser(String monitorUserId, UserConfig userConfig, UserConfig originalUserConfig) throws PortalException
IMonitorManagerSPI
updateMonitorUser
in interface IMonitorManagerSPI
monitorUserId
- the monitor user's identifier.userConfig
- the portal user with the updated information.PortalException
public void mergeMonitorUserDuringAuthentication(String httpSessionId, String srcMonitorUserId, String destMonitorUserId) throws PortalException
IMonitorManagerSPI
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
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
Lumisportal 11.0.0.180924 - Copyright © 2006–2018 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.