Package com.biglybt.ui.console.multiuser
Class UserManager
java.lang.Object
com.biglybt.ui.console.multiuser.UserManager
The usermanager is responsible for reading the users configuration
file and loading in all of the possible users. It is also responsible
for authenticating a username/password
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
private static UserManager
private static final String
private Map
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addUser
(UserProfile user) adds another user to the users listauthenticate
(String username, String password) attempts to locate a user with the specified username and then verifies that the specified password is the same as the password associated with that uservoid
deleteUser
(String userName) removes the user with the specified nameprotected void
doLoad
(InputStream in) protected void
doSave
(OutputStream out) static UserManager
returns the profile for the user with the specified username otherwise null if there is no such usergetUsers()
void
load()
load a new UserManager object from the specified input stream.void
save()
write the UserManager configuration out to the specified output stream.
-
Field Details
-
USER_DB_CONFIG_FILE
- See Also:
-
instance
-
usersMap
-
fileName
-
-
Constructor Details
-
UserManager
- Parameters:
configFile
-
-
-
Method Details
-
authenticate
attempts to locate a user with the specified username and then verifies that the specified password is the same as the password associated with that user- Parameters:
username
-password
-- Returns:
-
getUser
returns the profile for the user with the specified username otherwise null if there is no such user- Parameters:
username
-- Returns:
-
addUser
adds another user to the users list- Parameters:
user
-
-
getUsers
-
load
load a new UserManager object from the specified input stream. The input stream should contain an XML document as encoded by the save() method- Parameters:
in
-- Throws:
FileNotFoundException
-
doLoad
-
save
write the UserManager configuration out to the specified output stream. the configuration is stored in XML format as specified by the XMLEncoder class- Parameters:
out
-- Throws:
FileNotFoundException
- See Also:
-
doSave
-
getInstance
-
deleteUser
removes the user with the specified name- Parameters:
userName
-
-