Package com.io7m.idstore.database.api
Interface IdDatabaseAdminsQueriesType
- All Superinterfaces:
IdDatabaseQueriesType
The database queries involving admins.
-
Field Summary
Fields inherited from interface com.io7m.idstore.database.api.IdDatabaseQueriesType
EARLIEST -
Method Summary
Modifier and TypeMethodDescriptionvoidadminBanCreate(IdBan ban) Create a ban on the given admin account.voidadminBanDelete(IdBan ban) Delete the given ban.adminBanGet(UUID id) Get the ban for the given admin, if one exists.default IdAdminadminCreate(IdName idName, IdRealName realName, IdEmail email, IdPassword password, Set<IdAdminPermission> permissions) Create an admin.adminCreate(UUID id, IdName idName, IdRealName realName, IdEmail email, OffsetDateTime created, IdPassword password, Set<IdAdminPermission> permissions) Create an admin.adminCreateInitial(UUID id, IdName idName, IdRealName realName, IdEmail email, OffsetDateTime created, IdPassword password) Create an (initial) admin.voidadminDelete(UUID id) Delete the given admin.voidadminEmailAdd(UUID id, IdEmail email) Add an email address to the given admin.voidadminEmailRemove(UUID id, IdEmail email) Remove an email address from the given admin.adminGetForEmail(IdEmail email) adminGetForName(IdName name) adminGetForNameRequire(IdName name) adminGetRequire(UUID id) voidadminLogin(UUID id, String userAgent, String host) Record the fact that the given admin has logged in.adminSearch(IdAdminSearchParameters parameters, Optional<List<Object>> seek) List admins.adminSearchByEmail(IdAdminSearchByEmailParameters parameters, Optional<List<Object>> seek) List admins.longDetermine approximate number of results that would be returned in total by a given search.longadminSearchCount(IdAdminSearchParameters parameters) Determine approximate number of results that would be returned in total by a given search.voidadminUpdate(UUID id, Optional<IdName> withIdName, Optional<IdRealName> withRealName, Optional<IdPassword> withPassword, Optional<Set<IdAdminPermission>> withPermissions) Update the given admin.
-
Method Details
-
adminCreateInitial
IdAdmin adminCreateInitial(UUID id, IdName idName, IdRealName realName, IdEmail email, OffsetDateTime created, IdPassword password) throws IdDatabaseException Create an (initial) admin. This method behaves exactly the same asadminCreate(IdName, IdRealName, IdEmail, IdPassword, Set)except that it does not require an existing admin account and does not write to the audit log. The method will fail if any admin account already exists,- Parameters:
id- The admin IDcreated- The creation timeidName- The admin ID namerealName- The admin real nameemail- The admin emailpassword- The hashed password- Returns:
- The created admin
- Throws:
IdDatabaseException- On errors
-
adminCreate
@IdDatabaseRequiresAdmin default IdAdmin adminCreate(IdName idName, IdRealName realName, IdEmail email, IdPassword password, Set<IdAdminPermission> permissions) throws IdDatabaseException Create an admin.- Parameters:
idName- The admin ID namerealName- The admin real nameemail- The admin emailpassword- The hashed passwordpermissions- The permissions the created admin will have- Returns:
- The created admin
- Throws:
IdDatabaseException- On errors
-
adminCreate
@IdDatabaseRequiresAdmin IdAdmin adminCreate(UUID id, IdName idName, IdRealName realName, IdEmail email, OffsetDateTime created, IdPassword password, Set<IdAdminPermission> permissions) throws IdDatabaseException Create an admin.- Parameters:
id- The admin IDcreated- The creation timeidName- The admin ID namerealName- The admin real nameemail- The admin emailpassword- The hashed passwordpermissions- The permissions the created admin will have- Returns:
- The created admin
- Throws:
IdDatabaseException- On errors
-
adminGet
- Parameters:
id- The admin ID- Returns:
- A admin with the given ID
- Throws:
IdDatabaseException- On errors
-
adminGetForName
- Parameters:
name- The admin name- Returns:
- A admin with the given name
- Throws:
IdDatabaseException- On errors
-
adminGetForNameRequire
- Parameters:
name- The admin name- Returns:
- A admin with the given name
- Throws:
IdDatabaseException- On errors
-
adminGetForEmail
- Parameters:
email- The admin email- Returns:
- A admin with the given email
- Throws:
IdDatabaseException- On errors
-
adminLogin
Record the fact that the given admin has logged in.- Parameters:
id- The admin IDuserAgent- The user agenthost- The host from which the admin logged in- Throws:
IdDatabaseException- On errors
-
adminSearch
List<IdAdminSummary> adminSearch(IdAdminSearchParameters parameters, Optional<List<Object>> seek) throws IdDatabaseException List admins.- Parameters:
parameters- The search parametersseek- The record to which to seek, if any- Returns:
- The admins
- Throws:
IdDatabaseException- On errors
-
adminSearchCount
Determine approximate number of results that would be returned in total by a given search.- Parameters:
parameters- The search parameters- Returns:
- The admins
- Throws:
IdDatabaseException- On errors
-
adminSearchByEmail
List<IdAdminSummary> adminSearchByEmail(IdAdminSearchByEmailParameters parameters, Optional<List<Object>> seek) throws IdDatabaseException List admins.- Parameters:
parameters- The search parametersseek- The record to which to seek, if any- Returns:
- The admins
- Throws:
IdDatabaseException- On errors
-
adminSearchByEmailCount
Determine approximate number of results that would be returned in total by a given search.- Parameters:
parameters- The search parameters- Returns:
- The admins
- Throws:
IdDatabaseException- On errors
-
adminGetRequire
- Parameters:
id- The admin ID- Returns:
- A admin with the given ID
- Throws:
IdDatabaseException- On errors
-
adminEmailAdd
Add an email address to the given admin.- Parameters:
id- The admin IDemail- The new email- Throws:
IdDatabaseException- On errors
-
adminEmailRemove
Remove an email address from the given admin.- Parameters:
id- The admin IDemail- The email- Throws:
IdDatabaseException- On errors
-
adminUpdate
@IdDatabaseRequiresAdmin void adminUpdate(UUID id, Optional<IdName> withIdName, Optional<IdRealName> withRealName, Optional<IdPassword> withPassword, Optional<Set<IdAdminPermission>> withPermissions) throws IdDatabaseException Update the given admin.- Parameters:
id- The admin IDwithIdName- The new ID name, if desiredwithRealName- The new real name, if desiredwithPassword- The new password, if desiredwithPermissions- The new permissions, if desired- Throws:
IdDatabaseException- On errors
-
adminDelete
Delete the given admin.- Parameters:
id- The admin ID- Throws:
IdDatabaseException- On errors
-
adminBanCreate
Create a ban on the given admin account.- Parameters:
ban- The ban- Throws:
IdDatabaseException- On errors
-
adminBanGet
Get the ban for the given admin, if one exists.- Parameters:
id- The admin ID- Returns:
- The ban, if any
- Throws:
IdDatabaseException- On errors
-
adminBanDelete
Delete the given ban.- Parameters:
ban- The ban- Throws:
IdDatabaseException- On errors
-