architectureInterface
Interface UserDatabaseInterface

All Known Implementing Classes:
UserDatabaseController

public interface UserDatabaseInterface

Architecture interface for component UserDatabase.

Used to store user-specific data (e. g. identifiers, session keys and buffers).

Must be thread-safe.

Author:
Karl-Peter Fuchs

Method Summary
 void addUser(User user)
          Must add the bypassed User to the internal database.
 java.util.Collection<User> getActiveUsers()
          Must return all Users currently active.
 int getSize()
          Must return the number of Users currently stored in the internal database.
 User getUser(int identifier)
          Must return the User with the bypassed identifier.
 User getUserByNextMixIdentifier(int nextMixIdentifier)
          Must return the User with the bypassed identifier.
 boolean isExistingUser(int identifier)
          Must return whether a User with the bypassed identifier is present in the internal database or not.
 void removeUser(int identifier)
          Must remove the User with the bypassed identifier.
 

Method Detail

addUser

void addUser(User user)
             throws UserAlreadyExistingException
Must add the bypassed User to the internal database.

Parameters:
user - The User to be added.
Throws:
UserAlreadyExistingException - Thrown when the bypassed User has already been added (user's identifier already in use).

removeUser

void removeUser(int identifier)
                throws UnknownUserException
Must remove the User with the bypassed identifier.

Parameters:
identifier - Identifier of the User to be removed from the internal database.
Throws:
UnknownUserException - Thrown when no User with the bypassed identifier is existent.

getUser

User getUser(int identifier)
             throws UnknownUserException
Must return the User with the bypassed identifier.

Parameters:
identifier - Identifier of the User to be returned.
Returns:
User with the bypassed identifier.
Throws:
UnknownUserException - Thrown when no User with the bypassed identifier is existent.

getUserByNextMixIdentifier

User getUserByNextMixIdentifier(int nextMixIdentifier)
                                throws UnknownUserException
Must return the User with the bypassed identifier.

Parameters:
nextMixIdentifier - Identifier of the User to be returned.
Returns:
User with the bypassed identifier.
Throws:
UnknownUserException - Thrown when no User with the bypassed identifier is existent.

isExistingUser

boolean isExistingUser(int identifier)
Must return whether a User with the bypassed identifier is present in the internal database or not.

Parameters:
identifier - Identifier to search for.
Returns:
User present or not.

getSize

int getSize()
Must return the number of Users currently stored in the internal database.

Returns:
Number of Users currently stored in the internal database.

getActiveUsers

java.util.Collection<User> getActiveUsers()
Must return all Users currently active.

Returns:
Collection of all Users currently active.