|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectmessageServerP.ManagedUsersDatabase
public class ManagedUsersDatabase
The database of managed users.
Field Summary | |
---|---|
private static boolean |
assignBlocked
|
private static java.util.List<ManagedUser> |
users
|
Constructor Summary | |
---|---|
ManagedUsersDatabase()
|
Method Summary | |
---|---|
static void |
addAssignedUser(ManagedUser user)
Adds an already existing user to the managed user list. |
static boolean |
assignationBlocked()
|
static void |
blockAssignation(boolean status)
Sets the block status of the Message Server's Managed Users. |
static void |
blockUser(User user,
boolean blocked)
Blocks a user to not let it receive more messages. |
static void |
createUser(User user,
java.lang.String password)
Creates a user and adds it to the list. |
static boolean |
deleteUser(User userToDelete)
Deletes a user. |
static ManagedUser |
getManaged(User user)
Takes log(N) where N is the number of administrated users. |
static int |
getManagedUsers()
|
static ManagedUser[] |
getManagedUsersArray()
Copies the managed users into an array and returns the array. |
static java.util.List<ManagedUser> |
getManagedUsersList()
|
static int |
getOnlineManagedUsers()
Takes O(N) where N is the number of managed users. |
static int |
getQueuedMessagesNum()
Takes O(N) where N is the number of managed users. |
static boolean |
noneAssigned()
|
static void |
restoreData(java.util.List<ManagedUser> restoredUsers)
Restores the managed users list replacing the current one with the one given by argument. |
static boolean |
userIsFriendOf(User u1,
User u2)
Checks if a user is friend of another. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static boolean assignBlocked
private static java.util.List<ManagedUser> users
Constructor Detail |
---|
public ManagedUsersDatabase()
Method Detail |
---|
public static ManagedUser getManaged(User user)
user
- the user to search for (only the nickname is considered)
public static boolean userIsFriendOf(User u1, User u2)
u1
- the user.u2
- the friend.
public static boolean deleteUser(User userToDelete)
userToDelete
- the user to delete (only the nickname is considered).
public static void blockAssignation(boolean status)
status
- the status to setpublic static boolean assignationBlocked()
public static void blockUser(User user, boolean blocked)
user
- the user to blockpublic static void createUser(User user, java.lang.String password)
user
- the user to create.password
- the user's password.public static void addAssignedUser(ManagedUser user)
user
- the managed user to addpublic static int getManagedUsers()
public static ManagedUser[] getManagedUsersArray()
public static int getOnlineManagedUsers()
public static int getQueuedMessagesNum()
public static boolean noneAssigned()
public static void restoreData(java.util.List<ManagedUser> restoredUsers)
restoredUsers
- the new users list.public static java.util.List<ManagedUser> getManagedUsersList()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |