public class UserActivityScheduler extends Object
start(boolean)
).Modifier | Constructor and Description |
---|---|
protected |
UserActivityScheduler(Collection<UserInfo> aUserInfoCollection,
long aTimeoutInterval)
Creates a new UserActivityScheduler with a reference to a Collection of
UserInfo . |
Modifier and Type | Method and Description |
---|---|
void |
addTimeoutListener(UserTimeoutListener aTimeoutListener)
Adds a
UserTimeoutListener to the UserActivityScheduler . |
long |
getTimeoutInterval()
Returns the configured timeout time/interval.
|
boolean |
isActive()
Returns the state of the UserActivityScheduler.
|
void |
removeTimeoutListener(UserTimeoutListener aTimeoutListener)
Removes a
UserTimeoutListener from the UserActivityScheduler . |
void |
removeTimeoutListeners()
Removes all
UserTimeoutListener from the UserActivityScheduler . |
void |
reportUserActivity(UserInfo aUserInfo)
That method must be called to report a user activity and protects the user from a timeout for the time of the
timeout interval (
EventServiceConfiguration.getTimeoutTime() ). |
void |
start(boolean isAutoClean)
That method starts the UserActivityScheduler to observe the users/clients.
|
void |
stop()
Stops the UserActivityScheduler.
|
protected UserActivityScheduler(Collection<UserInfo> aUserInfoCollection, long aTimeoutInterval)
UserInfo
.aUserInfoCollection
- all UserInfo instances to observeaTimeoutInterval
- milliseconds to the timeoutpublic void addTimeoutListener(UserTimeoutListener aTimeoutListener)
UserTimeoutListener
to the UserActivityScheduler
.aTimeoutListener
- listener to get reported timeoutspublic void removeTimeoutListener(UserTimeoutListener aTimeoutListener)
UserTimeoutListener
from the UserActivityScheduler
.aTimeoutListener
- listener to get reported timeoutspublic void removeTimeoutListeners()
UserTimeoutListener
from the UserActivityScheduler
.public void start(boolean isAutoClean)
EventServiceConfiguration.getTimeoutTime()
).isAutoClean
- when set to true, the users/clients are removed automatically on timeoutpublic void stop()
public boolean isActive()
start(boolean)
) and false when the UserActivityScheduler isn't started or stopped
(stop()
).public long getTimeoutInterval()
public void reportUserActivity(UserInfo aUserInfo)
EventServiceConfiguration.getTimeoutTime()
).aUserInfo
- user/client to refreshCopyright © 2012. All Rights Reserved.