Directory

← Back

ActivityMonitor Add-on

Tracks user activity and idleness

Author

Rating

Popularity

<100

ActivityMonitor is a UI extension add-on for Vaadin 8 that tracks whether or not a user is active on the app or not. Provides two timers by default - "idle" and "inactive". When the user touches the keyboard, mouse or touchscreen, they are considered active. After they haven't interacted with the application for some time, the server is notified of this. By default, the server gets notified that the client is "idle" after 30 seconds. After 60 seconds, the client is considered "inactive". As soon as the user interacts with the application again, the server is notified that they are "active". Additional timers with custom timeouts can be added.

This state information can be used to throttle or kick inactive user sessions in order to save on resources.

Sample code

        ////////////////////////////////
        // ActivityMonitor setup
        ////////////////////////////////

        ActivityMonitor monitor = new ActivityMonitor();
        monitor.setIdleTimeThreshold(5000);
        monitor.setInactiveTimeThreshold(10000);
        monitor.addClientStatusChangeListener(status -> {
            System.out.println("Client status is now " + status.toString());
        });

        monitor.addCustomTimer("A", 15000);
        monitor.addCustomTimer("B", 20000);
        monitor.addCustomTimerListener(customTimer -> {
            System.out.println("Custom timer " + customTimer + " fired");
        });

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

  • Fixed enable/disable logic of the client-side timers
  • Improved code formatting
  • Updated Javadoc
Released
2022-06-08
Maturity
BETA
License
Apache License 2.0

Compatibility

Framework
Vaadin 8.10+
Browser
Browser Independent

ActivityMonitor Add-on - Vaadin Add-on Directory

Tracks user activity and idleness ActivityMonitor Add-on - Vaadin Add-on Directory
ActivityMonitor is a UI extension add-on for Vaadin 8 that tracks whether or not a user is active on the app or not. Provides two timers by default - "idle" and "inactive". When the user touches the keyboard, mouse or touchscreen, they are considered active. After they haven't interacted with the application for some time, the server is notified of this. By default, the server gets notified that the client is "idle" after 30 seconds. After 60 seconds, the client is considered "inactive". As soon as the user interacts with the application again, the server is notified that they are "active". Additional timers with custom timeouts can be added. This state information can be used to throttle or kick inactive user sessions in order to save on resources.
Online