Class UsersRepository
java.lang.Object
it.polimi.ingsw.server.repository.UsersRepository
- All Implemented Interfaces:
UsersRepositoryInterface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Connectionprivate static final io.github.cdimascio.dotenv.Dotenvprivate static UsersRepository -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic UsersRepositorygetUserHashedPassword(String username) Get the hashed password of the uservoidsignUpUser(String username, String password) Insert the user in the DB
-
Field Details
-
c
-
instance
-
dotenv
private static final io.github.cdimascio.dotenv.Dotenv dotenv
-
-
Constructor Details
-
UsersRepository
Singleton, private constructor- Throws:
DBNotFoundException- if there is a problem with the connection to the DB
-
-
Method Details
-
getInstance
-
signUpUser
Insert the user in the DB- Specified by:
signUpUserin interfaceUsersRepositoryInterface- Parameters:
username- of the userpassword- of the user- Throws:
DBQueryException- if there is a problem with the DB i.e. username already present
-
getUserHashedPassword
Get the hashed password of the user- Specified by:
getUserHashedPasswordin interfaceUsersRepositoryInterface- Parameters:
username- of the user- Returns:
- the hashed password
- Throws:
DBQueryException- if the is no user with this username, or there is a problem with the DB
-