Großmarkt

market
Class UMUserBase

java.lang.Object
  |
  +--users.UserManager
        |
        +--market.UMUserBase
All Implemented Interfaces:
Serializable

public class UMUserBase
extends UserManager

The market's UserManager.

See Also:
Serialized Form

Field Summary
static int CUSTOMER
           
static int MANAGER
           
static int SELLER
           
static int WAREHOUSE_WORKER
           
 
Fields inherited from class users.UserManager
m_lhListeners
 
Constructor Summary
UMUserBase()
           
 
Method Summary
static User createUser(String sName, int type, String qualification)
          creates a new User with given name, type and qualification
static void deleteUser(UPerson user)
          Removes a User from market.
 int getCurrentWages()
          Sums up and returns wages of all currently employed persons.
 UserFilter getCustomers()
          Gets the customer filter.
static UMUserBase getGlobalBase()
          Static method that gets the global user manager.
 UserFilter getManager()
          Gets the mangaer filter.
static int getNumberOfManagers()
          Counts and returns the number of Users that are managers.
 UserFilter getSeller()
          Gets the sellers filter.
 UserFilter getStaff()
          Gets the staff filter.
 UserFilter getWarehouseWorker()
          Gets the warehouse worker filter.
static boolean isLoggedOn(User user)
          Checks whether there is a SalesPoint with the searched User logged on.
static boolean isUser(String userName)
          Checks the global UserManager for a String.
 
Methods inherited from class users.UserManager
addUser, addUserDataListener, createUser, deleteUser, fireUserAdded, fireUserDeleted, getCurrentUser, getGlobalUM, getUser, getUserNames, getUsers, logOff, logOn, removeUserDataListener, setDefaultCapability, setDefaultCaps, setGlobalUM, setUserCreator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CUSTOMER

public static final int CUSTOMER
See Also:
Constant Field Values

WAREHOUSE_WORKER

public static final int WAREHOUSE_WORKER
See Also:
Constant Field Values

SELLER

public static final int SELLER
See Also:
Constant Field Values

MANAGER

public static final int MANAGER
See Also:
Constant Field Values
Constructor Detail

UMUserBase

public UMUserBase()
Method Detail

getGlobalBase

public static UMUserBase getGlobalBase()
Static method that gets the global user manager.

Returns:
the global user manager.

createUser

public static User createUser(String sName,
                              int type,
                              String qualification)
creates a new User with given name, type and qualification

Parameters:
sName - the User's ID
type - the User's type: 1 for customer, other numbers for employees.
qualification - the employee's qualification (manager, seller, warehouse worker)

isUser

public static boolean isUser(String userName)
Checks the global UserManager for a String.

Parameters:
userName - the name of the user
Returns:
true if a User could be identified by userName, otherwise false.

getCustomers

public UserFilter getCustomers()
Gets the customer filter.

Returns:
the customer filter.

getWarehouseWorker

public UserFilter getWarehouseWorker()
Gets the warehouse worker filter.

Returns:
the warehouse worker filter.

getSeller

public UserFilter getSeller()
Gets the sellers filter.

Returns:
the sellers filter.

getManager

public UserFilter getManager()
Gets the mangaer filter.

Returns:
the manager filter.

getStaff

public UserFilter getStaff()
Gets the staff filter.

Returns:
the staff filter.

getNumberOfManagers

public static int getNumberOfManagers()
Counts and returns the number of Users that are managers.

Returns:
the number of the market's managers.

isLoggedOn

public static boolean isLoggedOn(User user)
Checks whether there is a SalesPoint with the searched User logged on.

Parameters:
user - the searched user.
Returns:
true if the user is logged on on any open SalesPoint, otherwise false.

deleteUser

public static void deleteUser(UPerson user)
                       throws VetoException
Removes a User from market.

Parameters:
user - the user to be removed.
Throws:
VetoException - if user to be removed is currently logged on.

getCurrentWages

public int getCurrentWages()
Sums up and returns wages of all currently employed persons.

Returns:
the sum of all employee's wages.

Großmarkt