de.novanic.eventservice.service.registry.user
Interface UserManager

All Known Implementing Classes:
DefaultUserManager

public interface UserManager

The UserManager is a container for UserInfo and provides various methods to manage users. To activate the user timeout recognition, the method activateUserActivityScheduler()) must be called. The UserManager can be created with UserManagerFactory.getUserManager(long)) as a singleton.

Author:
sstrohschein
Date: 03.02.2009
Time: 00:20:09

Method Summary
 void activateUserActivityScheduler()
          Activates the UserActivityScheduler to observe the user activities.
 void activateUserActivityScheduler(boolean isAutoClean)
          Activates the UserActivityScheduler to observe the user activities.
 UserInfo addUser(java.lang.String aUserId)
          Creates and adds the UserInfo for the user id.
 void addUser(UserInfo aUserInfo)
          Adds the UserInfo to the UserManager.
 void deactivateUserActivityScheduler()
          Deactivates the UserActivityScheduler.
 UserInfo getUser(java.lang.String aUserId)
          Returns the UserInfo for the user id.
 UserActivityScheduler getUserActivityScheduler()
          Returns the UserActivityScheduler which is instantiated with the UserManager.
 int getUserCount()
          Returns the count of the added UserInfo objects.
 java.util.Collection<UserInfo> getUsers()
          Returns all added UserInfo objects.
 boolean isUserContained(UserInfo aUserInfo)
          Checks if a user is added to a domain.
 UserInfo removeUser(java.lang.String aUserId)
          Removes the UserInfo for the user id.
 boolean removeUser(UserInfo aUserInfo)
          Removes the UserInfo.
 void removeUsers()
          Removes all added UserInfo objects.
 

Method Detail

addUser

UserInfo addUser(java.lang.String aUserId)
Creates and adds the UserInfo for the user id.

Parameters:
aUserId - id of the user to add
Returns:
created UserInfo

addUser

void addUser(UserInfo aUserInfo)
Adds the UserInfo to the UserManager.

Parameters:
aUserInfo - UserInfo to add

removeUser

UserInfo removeUser(java.lang.String aUserId)
Removes the UserInfo for the user id.

Parameters:
aUserId - user id of the UserInfo to remove
Returns:
removed UserInfo

removeUser

boolean removeUser(UserInfo aUserInfo)
Removes the UserInfo.

Parameters:
aUserInfo - UserInfo to remove
Returns:
true if it had an effect, otherwise false

removeUsers

void removeUsers()
Removes all added UserInfo objects.


isUserContained

boolean isUserContained(UserInfo aUserInfo)
Checks if a user is added to a domain.

Parameters:
aUserInfo - user
Returns:
true when the user is added to a domain, otherwise false

getUser

UserInfo getUser(java.lang.String aUserId)
Returns the UserInfo for the user id. It returns NULL when no UserInfo for the user id is added.

Parameters:
aUserId - user id of the requested UserInfo
Returns:
UserInfo for the user id. NULL when no UserInfo for the user id is added.

getUserCount

int getUserCount()
Returns the count of the added UserInfo objects.

Returns:
count of the added UserInfo objects

getUsers

java.util.Collection<UserInfo> getUsers()
Returns all added UserInfo objects. It returns an empty Collection when no UserInfo objects are added.

Returns:
all added UserInfo objects

activateUserActivityScheduler

void activateUserActivityScheduler()
Activates the UserActivityScheduler to observe the user activities. When the users/clients should be removed automatically, please use activateUserActivityScheduler(boolean).


activateUserActivityScheduler

void activateUserActivityScheduler(boolean isAutoClean)
Activates the UserActivityScheduler to observe the user activities.

Parameters:
isAutoClean - when set to true, the users/clients are removed automatically on timeout

deactivateUserActivityScheduler

void deactivateUserActivityScheduler()
Deactivates the UserActivityScheduler. See UserActivityScheduler for more information.


getUserActivityScheduler

UserActivityScheduler getUserActivityScheduler()
Returns the UserActivityScheduler which is instantiated with the UserManager. The method activateUserActivityScheduler() must be called to start the UserActivityScheduler.

Returns:
the UserActivityScheduler which is instantiated with the UserManager