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 Stringprivate static UserManagerprivate static final Stringprivate Map -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUser(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 uservoiddeleteUser(String userName) removes the user with the specified nameprotected voiddoLoad(InputStream in) protected voiddoSave(OutputStream out) static UserManagerreturns the profile for the user with the specified username otherwise null if there is no such usergetUsers()voidload()load a new UserManager object from the specified input stream.voidsave()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
-
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-
-