Class DatabaseHandler
- java.lang.Object
-
- de.fraunhofer.iosb.ilt.frostserver.auth.basic.DatabaseHandler
-
public class DatabaseHandler extends Object
- Author:
- scf
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcheckForUpgrades()booleandoUpgrades(Writer out)static DatabaseHandlergetInstance()static voidinit(CoreSettings coreSettings)booleanisValidUser(String userName, String password)booleanuserHasRole(String userName, String roleName)This method checks if the given user exists and has the given role.booleanuserHasRole(String userName, String userPass, String roleName)This method checks if the given user exists with the given password and has the given role.
-
-
-
Method Detail
-
init
public static void init(CoreSettings coreSettings)
-
getInstance
public static DatabaseHandler getInstance()
-
userHasRole
public boolean userHasRole(String userName, String userPass, String roleName)
This method checks if the given user exists with the given password and has the given role.- Parameters:
userName- The username of the user to check the role for.userPass- The password of the user to check the role for.roleName- The role to check.- Returns:
- true if the user exists AND has the given password AND has the given role.
-
userHasRole
public boolean userHasRole(String userName, String roleName)
This method checks if the given user exists and has the given role.- Parameters:
userName- The username of the user to check the role for.roleName- The role to check.- Returns:
- true if the user exists AND has the given password AND has the given role.
-
checkForUpgrades
public String checkForUpgrades()
-
doUpgrades
public boolean doUpgrades(Writer out) throws UpgradeFailedException, IOException
- Throws:
UpgradeFailedExceptionIOException
-
-