info.magnolia.module.exchangesimple.monitor
Class ActivationMonitor

java.lang.Object
  extended by info.magnolia.module.exchangesimple.monitor.ActivationMonitor
All Implemented Interfaces:
ActivationMonitorMBean, ActivationStorage

public class ActivationMonitor
extends Object
implements ActivationMonitorMBean

Activation monitor which provides useful informations about activation.


Constructor Summary
ActivationMonitor(ModuleRegistry moduleRegistry)
           
 
Method Summary
 void addActivationTime(long time)
          Adds time needed for activation to complete.
 void addCommitedTransaction()
          Increase number of commited transactions by 1.
 void addRollbackedTransaction()
          Increase number of rollbacked transactions by 1.
 void addSizeOfActivatedContent(long size)
          Adds size of content that is being activated.
 Collection<ActivationLogEntry> getActivationErrorLog()
          Gets collection of errors that occurred during activation.
 int getActivationErrors()
          Gets number of activation errors since last restart.
 Collection<ActivationLogEntry> getActivationLog()
          Gets activation log.
 int getActivations()
          Gets number of activations since last restart.
 Collection<ActivationLogEntry> getActivationsMadeByUser(String user)
          Gets activations made by a specified user.
 Map<String,Integer> getActivationsPerWorkspace()
          Gets activations per workspace since last restart.
 long getActivationTime()
          Gets time that was spent on activations.
 int getCommitedTransactions()
          Gets number of commited transactions since last restart.
 int getDeactivations()
          Gets number of deactivations since last restart.
 Date getLastRestartDate()
          Gets date from last restart.
 int getRollbackedTransactions()
          Gets number of rollbacked transactions since last restart.
 long getSizeOfActivatedContent()
          Gets size of activated content since last restart (in kilobytes).
 Map<String,ResponseTimeEntry> getSubscriberResponseTimes()
          Gets response times for subscribers.
 void logActivation(String path, String user, String workspaceName, String subscriber, boolean deactivation, boolean success)
          Logs activation request.
 void logError(String path, String user, String workspaceName, String subscriber, Throwable t, boolean deactivation)
          Logs error that occurred during activation.
 void setSubscriberResponseTime(String subscriber, long time)
          Logs subscriber response time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivationMonitor

@Inject
public ActivationMonitor(ModuleRegistry moduleRegistry)
Method Detail

logActivation

public void logActivation(String path,
                          String user,
                          String workspaceName,
                          String subscriber,
                          boolean deactivation,
                          boolean success)
Description copied from interface: ActivationStorage
Logs activation request.

Specified by:
logActivation in interface ActivationStorage
user - user that made activation request
deactivation - true if is deactivation, false if activation

getActivations

public int getActivations()
Description copied from interface: ActivationStorage
Gets number of activations since last restart.

Specified by:
getActivations in interface ActivationStorage
Returns:
number of activations

getDeactivations

public int getDeactivations()
Description copied from interface: ActivationStorage
Gets number of deactivations since last restart.

Specified by:
getDeactivations in interface ActivationStorage
Returns:
number of deactivations

getActivationErrors

public int getActivationErrors()
Description copied from interface: ActivationStorage
Gets number of activation errors since last restart.

Specified by:
getActivationErrors in interface ActivationStorage
Returns:
number of activation errors

getSizeOfActivatedContent

public long getSizeOfActivatedContent()
Description copied from interface: ActivationStorage
Gets size of activated content since last restart (in kilobytes).

Specified by:
getSizeOfActivatedContent in interface ActivationStorage
Returns:
size of activated content (in kilobytes)

getActivationLog

public Collection<ActivationLogEntry> getActivationLog()
Description copied from interface: ActivationStorage
Gets activation log.

Specified by:
getActivationLog in interface ActivationStorage
Returns:
map containing activation log

getActivationsMadeByUser

public Collection<ActivationLogEntry> getActivationsMadeByUser(String user)
Description copied from interface: ActivationStorage
Gets activations made by a specified user.

Specified by:
getActivationsMadeByUser in interface ActivationStorage
Parameters:
user - name of user
Returns:
map with items that has been activated by specific user

getActivationsPerWorkspace

public Map<String,Integer> getActivationsPerWorkspace()
Description copied from interface: ActivationStorage
Gets activations per workspace since last restart.

Specified by:
getActivationsPerWorkspace in interface ActivationStorage
Returns:
activations per workspace

getSubscriberResponseTimes

public Map<String,ResponseTimeEntry> getSubscriberResponseTimes()
Description copied from interface: ActivationStorage
Gets response times for subscribers.

Specified by:
getSubscriberResponseTimes in interface ActivationStorage
Returns:
response times for subscribers

logError

public void logError(String path,
                     String user,
                     String workspaceName,
                     String subscriber,
                     Throwable t,
                     boolean deactivation)
Description copied from interface: ActivationStorage
Logs error that occurred during activation.

Specified by:
logError in interface ActivationStorage
Parameters:
path - node path
user - user's name
t - exception that occurred during activation
deactivation - true if deactivation, false if activation

setSubscriberResponseTime

public void setSubscriberResponseTime(String subscriber,
                                      long time)
Description copied from interface: ActivationStorage
Logs subscriber response time.

Specified by:
setSubscriberResponseTime in interface ActivationStorage
Parameters:
subscriber - name of subscriber
time - time in miliseconds

getActivationErrorLog

public Collection<ActivationLogEntry> getActivationErrorLog()
Description copied from interface: ActivationStorage
Gets collection of errors that occurred during activation.

Specified by:
getActivationErrorLog in interface ActivationStorage
Returns:
collection of errors

getCommitedTransactions

public int getCommitedTransactions()
Description copied from interface: ActivationStorage
Gets number of commited transactions since last restart.

Specified by:
getCommitedTransactions in interface ActivationStorage
Returns:
number of commited transactions

getRollbackedTransactions

public int getRollbackedTransactions()
Description copied from interface: ActivationStorage
Gets number of rollbacked transactions since last restart.

Specified by:
getRollbackedTransactions in interface ActivationStorage
Returns:
number of rollbacked transactions

addSizeOfActivatedContent

public void addSizeOfActivatedContent(long size)
Description copied from interface: ActivationStorage
Adds size of content that is being activated.

Specified by:
addSizeOfActivatedContent in interface ActivationStorage

addActivationTime

public void addActivationTime(long time)
Description copied from interface: ActivationStorage
Adds time needed for activation to complete.

Specified by:
addActivationTime in interface ActivationStorage
Parameters:
time - time in milliseconds

getActivationTime

public long getActivationTime()
Description copied from interface: ActivationStorage
Gets time that was spent on activations.

Specified by:
getActivationTime in interface ActivationStorage
Returns:
time in milliseconds

getLastRestartDate

public Date getLastRestartDate()
Description copied from interface: ActivationStorage
Gets date from last restart.

Specified by:
getLastRestartDate in interface ActivationStorage
Returns:
date

addCommitedTransaction

public void addCommitedTransaction()
Description copied from interface: ActivationStorage
Increase number of commited transactions by 1.

Specified by:
addCommitedTransaction in interface ActivationStorage

addRollbackedTransaction

public void addRollbackedTransaction()
Description copied from interface: ActivationStorage
Increase number of rollbacked transactions by 1.

Specified by:
addRollbackedTransaction in interface ActivationStorage


Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.