Class IdAClient
java.lang.Object
com.io7m.idstore.admin_client.internal.IdAClient
- All Implemented Interfaces:
IdAClientAdminsType,IdAClientAuditType,IdAClientType,IdAClientUsersType,Closeable,AutoCloseable
The default client implementation.
-
Constructor Summary
ConstructorsConstructorDescriptionIdAClient(Locale inLocale, IdAStrings inStrings, HttpClient inHttpClient, IdAClientProtocolHandlerType inHandler) The default client implementation. -
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.adminCreate(Optional<UUID> id, IdName idName, IdRealName realName, IdEmail email, IdPassword password, IdAdminPermissionSet permissions) Create a admin.voidadminDelete(UUID id) Delete the given admin.adminEmailAdd(UUID id, IdEmail email) Add an email to the given admin.adminEmailRemove(UUID id, IdEmail email) Remove an email from the given admin.Fetch the given admin.adminGetByEmail(IdEmail email) Fetch the given admin.adminPermissionGrant(UUID id, IdAdminPermission permission) Grant a permission to the given admin.adminPermissionRevoke(UUID id, IdAdminPermission permission) Revoke a permission from the given admin.adminSearchBegin(IdAdminSearchParameters parameters) Start searching/listing admins.Start searching/listing admins.Continue searching/listing admins.Continue searching/listing admins.Continue searching/listing admins.Continue searching/listing admins.Retrieve the current admin profile.adminUpdate(UUID admin, Optional<IdName> idName, Optional<IdRealName> realName, Optional<IdPassword> password) Update the given admin.auditSearchBegin(IdTimeRange timeRange, Optional<String> owner, Optional<String> type, Optional<String> message, int pageSize) Start searching/listing audit events.Continue searching/listing events.Continue searching/listing events.voidclose()Log in.toString()voiduserBanCreate(IdBan ban) Create a ban on the given user account.voiduserBanDelete(IdBan ban) Delete the given ban.userBanGet(UUID id) Get the ban for the given user, if one exists.userCreate(Optional<UUID> id, IdName idName, IdRealName realName, IdEmail email, IdPassword password) Create a user.voiduserDelete(UUID id) Delete the given user.userEmailAdd(UUID id, IdEmail email) Add an email to the given user.userEmailRemove(UUID id, IdEmail email) Remove an email from the given user.Fetch the given user.userGetByEmail(IdEmail email) Fetch the given user.userLoginHistory(UUID id) List the login history for the given user.userSearchBegin(IdUserSearchParameters parameters) Start searching/listing users.userSearchByEmailBegin(IdUserSearchByEmailParameters parameters) Start searching/listing users.Continue searching/listing users.Continue searching/listing users.Continue searching/listing users.Continue searching/listing users.userUpdate(UUID user, Optional<IdName> idName, Optional<IdRealName> realName, Optional<IdPassword> password) Update the given user.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.idstore.admin_client.api.IdAClientUsersType
userCreate
-
Constructor Details
-
IdAClient
public IdAClient(Locale inLocale, IdAStrings inStrings, HttpClient inHttpClient, IdAClientProtocolHandlerType inHandler) The default client implementation.- Parameters:
inLocale- The localeinStrings- The string resourcesinHttpClient- The HTTP clientinHandler- The versioned handler
-
-
Method Details
-
adminSearchBegin
public IdPage<IdAdminSummary> adminSearchBegin(IdAdminSearchParameters parameters) throws IdAClientException, InterruptedException Description copied from interface:IdAClientAdminsTypeStart searching/listing admins. Calling this method will set the search parameters and effectively reset searching back to page 1 of any results.- Specified by:
adminSearchBeginin interfaceIdAClientAdminsType- Parameters:
parameters- The search parameters- Returns:
- The first page of results
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminSearchNext
Description copied from interface:IdAClientAdminsTypeContinue searching/listing admins. This will return the next page of results.- Specified by:
adminSearchNextin interfaceIdAClientAdminsType- Returns:
- The next page of results
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminSearchPrevious
Description copied from interface:IdAClientAdminsTypeContinue searching/listing admins. This will return the previous page of results.- Specified by:
adminSearchPreviousin interfaceIdAClientAdminsType- Returns:
- The previous page of results
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminSearchByEmailBegin
public IdPage<IdAdminSummary> adminSearchByEmailBegin(IdAdminSearchByEmailParameters parameters) throws IdAClientException, InterruptedException Description copied from interface:IdAClientAdminsTypeStart searching/listing admins. Calling this method will set the search parameters and effectively reset searching back to page 1 of any results.- Specified by:
adminSearchByEmailBeginin interfaceIdAClientAdminsType- Parameters:
parameters- The search parameters- Returns:
- The first page of results
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminSearchByEmailNext
public IdPage<IdAdminSummary> adminSearchByEmailNext() throws IdAClientException, InterruptedExceptionDescription copied from interface:IdAClientAdminsTypeContinue searching/listing admins. This will return the next page of results.- Specified by:
adminSearchByEmailNextin interfaceIdAClientAdminsType- Returns:
- The next page of results
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminSearchByEmailPrevious
public IdPage<IdAdminSummary> adminSearchByEmailPrevious() throws IdAClientException, InterruptedExceptionDescription copied from interface:IdAClientAdminsTypeContinue searching/listing admins. This will return the previous page of results.- Specified by:
adminSearchByEmailPreviousin interfaceIdAClientAdminsType- Returns:
- The previous page of results
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminGet
Description copied from interface:IdAClientAdminsTypeFetch the given admin.- Specified by:
adminGetin interfaceIdAClientAdminsType- Parameters:
id- The admin ID- Returns:
- The admin, if one exists
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminGetByEmail
public Optional<IdAdmin> adminGetByEmail(IdEmail email) throws IdAClientException, InterruptedException Description copied from interface:IdAClientAdminsTypeFetch the given admin.- Specified by:
adminGetByEmailin interfaceIdAClientAdminsType- Parameters:
email- The admin email- Returns:
- The admin, if one exists
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminUpdate
public IdAdmin adminUpdate(UUID admin, Optional<IdName> idName, Optional<IdRealName> realName, Optional<IdPassword> password) throws IdAClientException, InterruptedException Description copied from interface:IdAClientAdminsTypeUpdate the given admin.- Specified by:
adminUpdatein interfaceIdAClientAdminsType- Parameters:
admin- The adminidName- The new idnamerealName- The new realnamepassword- The new password- Returns:
- The updated admin
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminCreate
public IdAdmin adminCreate(Optional<UUID> id, IdName idName, IdRealName realName, IdEmail email, IdPassword password, IdAdminPermissionSet permissions) throws IdAClientException, InterruptedException Description copied from interface:IdAClientAdminsTypeCreate a admin.- Specified by:
adminCreatein interfaceIdAClientAdminsType- Parameters:
id- The IDidName- The ID namerealName- The real nameemail- The emailpassword- The passwordpermissions- The permissions- Returns:
- The created admin
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
login
public IdAdmin login(String admin, String password, URI base) throws IdAClientException, InterruptedException Description copied from interface:IdAClientTypeLog in.- Specified by:
loginin interfaceIdAClientType- Parameters:
admin- The admin usernamepassword- The passwordbase- The base URI- Returns:
- The logged in admin profile
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminSelf
Description copied from interface:IdAClientAdminsTypeRetrieve the current admin profile.- Specified by:
adminSelfin interfaceIdAClientAdminsType- Returns:
- The current user
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
toString
-
userSearchBegin
public IdPage<IdUserSummary> userSearchBegin(IdUserSearchParameters parameters) throws IdAClientException, InterruptedException Description copied from interface:IdAClientUsersTypeStart searching/listing users. Calling this method will set the search parameters and effectively reset searching back to page 1 of any results.- Specified by:
userSearchBeginin interfaceIdAClientUsersType- Parameters:
parameters- The search parameters- Returns:
- The first page of results
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
userSearchNext
Description copied from interface:IdAClientUsersTypeContinue searching/listing users. This will return the next page of results.- Specified by:
userSearchNextin interfaceIdAClientUsersType- Returns:
- The next page of results
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
userSearchPrevious
Description copied from interface:IdAClientUsersTypeContinue searching/listing users. This will return the previous page of results.- Specified by:
userSearchPreviousin interfaceIdAClientUsersType- Returns:
- The previous page of results
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
userSearchByEmailBegin
public IdPage<IdUserSummary> userSearchByEmailBegin(IdUserSearchByEmailParameters parameters) throws IdAClientException, InterruptedException Description copied from interface:IdAClientUsersTypeStart searching/listing users. Calling this method will set the search parameters and effectively reset searching back to page 1 of any results.- Specified by:
userSearchByEmailBeginin interfaceIdAClientUsersType- Parameters:
parameters- The search parameters- Returns:
- The first page of results
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
userSearchByEmailNext
public IdPage<IdUserSummary> userSearchByEmailNext() throws IdAClientException, InterruptedExceptionDescription copied from interface:IdAClientUsersTypeContinue searching/listing users. This will return the next page of results.- Specified by:
userSearchByEmailNextin interfaceIdAClientUsersType- Returns:
- The next page of results
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
userSearchByEmailPrevious
public IdPage<IdUserSummary> userSearchByEmailPrevious() throws IdAClientException, InterruptedExceptionDescription copied from interface:IdAClientUsersTypeContinue searching/listing users. This will return the previous page of results.- Specified by:
userSearchByEmailPreviousin interfaceIdAClientUsersType- Returns:
- The previous page of results
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
userGet
Description copied from interface:IdAClientUsersTypeFetch the given user.- Specified by:
userGetin interfaceIdAClientUsersType- Parameters:
id- The user ID- Returns:
- The user, if one exists
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
userGetByEmail
public Optional<IdUser> userGetByEmail(IdEmail email) throws IdAClientException, InterruptedException Description copied from interface:IdAClientUsersTypeFetch the given user.- Specified by:
userGetByEmailin interfaceIdAClientUsersType- Parameters:
email- The user email- Returns:
- The user, if one exists
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
userCreate
public IdUser userCreate(Optional<UUID> id, IdName idName, IdRealName realName, IdEmail email, IdPassword password) throws IdAClientException, InterruptedException Description copied from interface:IdAClientUsersTypeCreate a user.- Specified by:
userCreatein interfaceIdAClientUsersType- Parameters:
id- The IDidName- The ID namerealName- The real nameemail- The emailpassword- The password- Returns:
- The created user
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
auditSearchBegin
public IdPage<IdAuditEvent> auditSearchBegin(IdTimeRange timeRange, Optional<String> owner, Optional<String> type, Optional<String> message, int pageSize) throws IdAClientException, InterruptedException Description copied from interface:IdAClientAuditTypeStart searching/listing audit events. Calling this method will set the search parameters and effectively reset searching back to page 1 of any results.- Specified by:
auditSearchBeginin interfaceIdAClientAuditType- Parameters:
timeRange- The time range within which events should have been createdowner- The owner search querytype- The type search querymessage- The message search querypageSize- The page size- Returns:
- The first page of results
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
auditSearchNext
Description copied from interface:IdAClientAuditTypeContinue searching/listing events. This will return the next page of results.- Specified by:
auditSearchNextin interfaceIdAClientAuditType- Returns:
- The next page of results
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
auditSearchPrevious
Description copied from interface:IdAClientAuditTypeContinue searching/listing events. This will return the previous page of results.- Specified by:
auditSearchPreviousin interfaceIdAClientAuditType- Returns:
- The previous page of results
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminDelete
Description copied from interface:IdAClientAdminsTypeDelete the given admin.- Specified by:
adminDeletein interfaceIdAClientAdminsType- Parameters:
id- The admin ID- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
userDelete
Description copied from interface:IdAClientUsersTypeDelete the given user.- Specified by:
userDeletein interfaceIdAClientUsersType- Parameters:
id- The user ID- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminEmailAdd
public IdAdmin adminEmailAdd(UUID id, IdEmail email) throws IdAClientException, InterruptedException Description copied from interface:IdAClientAdminsTypeAdd an email to the given admin.- Specified by:
adminEmailAddin interfaceIdAClientAdminsType- Parameters:
id- The admin IDemail- The email address- Returns:
- The updated admin
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminEmailRemove
public IdAdmin adminEmailRemove(UUID id, IdEmail email) throws IdAClientException, InterruptedException Description copied from interface:IdAClientAdminsTypeRemove an email from the given admin.- Specified by:
adminEmailRemovein interfaceIdAClientAdminsType- Parameters:
id- The admin IDemail- The email address- Returns:
- The updated admin
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminPermissionGrant
public IdAdmin adminPermissionGrant(UUID id, IdAdminPermission permission) throws IdAClientException, InterruptedException Description copied from interface:IdAClientAdminsTypeGrant a permission to the given admin.- Specified by:
adminPermissionGrantin interfaceIdAClientAdminsType- Parameters:
id- The admin IDpermission- The permission- Returns:
- The updated admin
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminPermissionRevoke
public IdAdmin adminPermissionRevoke(UUID id, IdAdminPermission permission) throws IdAClientException, InterruptedException Description copied from interface:IdAClientAdminsTypeRevoke a permission from the given admin.- Specified by:
adminPermissionRevokein interfaceIdAClientAdminsType- Parameters:
id- The admin IDpermission- The permission- Returns:
- The updated admin
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
userUpdate
public IdUser userUpdate(UUID user, Optional<IdName> idName, Optional<IdRealName> realName, Optional<IdPassword> password) throws IdAClientException, InterruptedException Description copied from interface:IdAClientUsersTypeUpdate the given user.- Specified by:
userUpdatein interfaceIdAClientUsersType- Parameters:
user- The useridName- The new idnamerealName- The new realnamepassword- The new password- Returns:
- The updated user
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
userEmailAdd
Description copied from interface:IdAClientUsersTypeAdd an email to the given user.- Specified by:
userEmailAddin interfaceIdAClientUsersType- Parameters:
id- The user IDemail- The email address- Returns:
- The updated user
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
userEmailRemove
public IdUser userEmailRemove(UUID id, IdEmail email) throws IdAClientException, InterruptedException Description copied from interface:IdAClientUsersTypeRemove an email from the given user.- Specified by:
userEmailRemovein interfaceIdAClientUsersType- Parameters:
id- The user IDemail- The email address- Returns:
- The updated user
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminBanCreate
Description copied from interface:IdAClientAdminsTypeCreate a ban on the given admin account.- Specified by:
adminBanCreatein interfaceIdAClientAdminsType- Parameters:
ban- The ban- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminBanGet
Description copied from interface:IdAClientAdminsTypeGet the ban for the given admin, if one exists.- Specified by:
adminBanGetin interfaceIdAClientAdminsType- Parameters:
id- The admin ID- Returns:
- The ban, if any
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
adminBanDelete
Description copied from interface:IdAClientAdminsTypeDelete the given ban.- Specified by:
adminBanDeletein interfaceIdAClientAdminsType- Parameters:
ban- The ban- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
userBanCreate
Description copied from interface:IdAClientUsersTypeCreate a ban on the given user account.- Specified by:
userBanCreatein interfaceIdAClientUsersType- Parameters:
ban- The ban- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
userBanGet
Description copied from interface:IdAClientUsersTypeGet the ban for the given user, if one exists.- Specified by:
userBanGetin interfaceIdAClientUsersType- Parameters:
id- The user ID- Returns:
- The ban, if any
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
userBanDelete
Description copied from interface:IdAClientUsersTypeDelete the given ban.- Specified by:
userBanDeletein interfaceIdAClientUsersType- Parameters:
ban- The ban- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-
userLoginHistory
Description copied from interface:IdAClientUsersTypeList the login history for the given user.- Specified by:
userLoginHistoryin interfaceIdAClientUsersType- Parameters:
id- The user ID- Returns:
- The login history
- Throws:
IdAClientException- On errorsInterruptedException- On interruption
-