1515import java .util .HashSet ;
1616import java .util .Map ;
1717
18+ //TODO Create resetInstance() method to allow a new instance to be initialized.
19+
1820/**
1921 * Manages all tasks related to a user account including sessions and user roles.
2022 * @since 1.5.0
@@ -84,7 +86,7 @@ public static AuthManager getNewInstance(final Database db, final String appIcon
8486
8587 //region User Manager Methods
8688 /**
87- * Creates a new user in the database using SHA-512 password hashing.
89+ * Creates a new user in the database using BCrypt password hashing.
8890 * @param username the username to add
8991 * @param password the password for the new user
9092 * @param userRole the system user role for the new user
@@ -101,7 +103,7 @@ public boolean createUser(final String username,
101103 }
102104
103105 /**
104- * Creates a new user in the database using SHA-512 password hashing.
106+ * Creates a new user in the database using BCrypt password hashing.
105107 * @param username the username to add
106108 * @param password the password for the new user
107109 * @param userRole the name of the user role for the new user
@@ -169,6 +171,7 @@ public String getUserCreationDate(final String username, final String format) {
169171 * @throws TableNotFoundException if users table is missing
170172 * @throws UserManagerException if an error occurs during lookup
171173 */
174+ //TODO create UserManager implementation to reduce database activity
172175 public boolean isUserLocked (final String username ) { return getUser (username ).isLocked (); }
173176
174177 /**
@@ -212,6 +215,7 @@ private boolean setLocked(final String username, final boolean status) {
212215 * @throws TableNotFoundException if users table is missing
213216 * @throws UserManagerException if an error occurs during lookup
214217 */
218+ //TODO create UserManager implementation to reduce database activity
215219 public boolean isPasswordExpired (final String username ) { return getUser (username ).isPasswordExpired (); }
216220
217221 /**
@@ -222,6 +226,7 @@ private boolean setLocked(final String username, final boolean status) {
222226 * @throws TableNotFoundException if users table is missing
223227 * @throws UserManagerException if an error occurs during lookup
224228 */
229+ //TODO create UserManager implementation to reduce database activity
225230 public boolean isPasswordSetToExpire (final String username ) { return getUser (username ).hasPasswordExpiration (); }
226231
227232 /**
@@ -232,6 +237,7 @@ private boolean setLocked(final String username, final boolean status) {
232237 * @throws TableNotFoundException if users table is missing
233238 * @throws UserManagerException if an error occurs during lookup
234239 */
240+ //TODO create UserManager implementation to reduce database activity
235241 public LocalDateTime getPasswordExpirationDate (final String username ) {
236242 return getUser (username ).getPasswordExpirationDate ();
237243 }
@@ -245,6 +251,7 @@ public LocalDateTime getPasswordExpirationDate(final String username) {
245251 * @throws TableNotFoundException if users table is missing
246252 * @throws UserManagerException if an error occurs during lookup
247253 */
254+ //TODO create UserManager implementation to reduce database activity
248255 public String getPasswordExpirationDate (final String username , final String format ) {
249256 if (format == null || format .trim ().isEmpty ()) {
250257 throw new IllegalArgumentException ("Format Cannot Be Null Or Empty!" );
@@ -304,7 +311,7 @@ public boolean disablePasswordExpiration(final String username) {
304311 * @return true if no errors occurred
305312 * @throws IllegalArgumentException if values are null or empty
306313 * @throws TableNotFoundException if users table is missing
307- * @throws UserManagerException if an error occurs while changing user type
314+ * @throws UserManagerException if an error occurs while changing user role
308315 */
309316 public boolean setUserRole (final String username ,
310317 final UserRoleManager .SystemUserRoles userRole ) {
@@ -318,14 +325,14 @@ public boolean setUserRole(final String username,
318325 * @return true if no errors occurred
319326 * @throws IllegalArgumentException if values are null or empty
320327 * @throws TableNotFoundException if users table is missing
321- * @throws UserManagerException if an error occurs while changing user type
328+ * @throws UserManagerException if an error occurs while changing user role
322329 */
323330 public boolean setUserRole (final String username , final String userRole ) {
324331 return userManager .setUserRole (username , userRole );
325332 }
326333
327334 /**
328- * Sets a new password for an existing user using SHA-512 password hashing.
335+ * Sets a new password for an existing user using BCrypt password hashing.
329336 * @param username the username to change
330337 * @param password the new password
331338 * @return true if password is changed successfully
@@ -361,8 +368,8 @@ public boolean checkPasswordMatches(final String username, final String password
361368 public HashSet <UserAccount > getUsersList () { return userManager .getUsersList (); }
362369
363370 /**
364- * Returns a list of the user names in the database.
365- * @return a list of the user names in the database
371+ * Returns a list of the usernames in the database.
372+ * @return a list of the usernames in the database
366373 * @throws TableNotFoundException if users table is missing
367374 */
368375 public HashSet <String > getUsernameList () { return userManager .getUsernameList (); }
0 commit comments