Package com.io7m.idstore.admin_client.internal

# Class IdAClientProtocolHandler1

java.lang.Object
com.io7m.idstore.admin_client.internal.IdAClientProtocolHandlerAbstract
com.io7m.idstore.admin_client.internal.IdAClientProtocolHandler1

All Implemented Interfaces:
  `IdAClientAdminsType`, `IdAClientAuditType`, `IdAClientUsersType`, `IdAClientProtocolHandlerType`

public final class IdAClientProtocolHandler1 extends IdAClientProtocolHandlerAbstract
The version 1 protocol handler.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IdAClientProtocolHandler1(HttpClient inHttpClient, IdAStrings inStrings, URI inBase)`
  The version 1 protocol handler.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `adminBanCreate(IdBan ban)`
  Create a ban on the given admin account.
  `void`
  `adminBanDelete(IdBan ban)`
  Delete the given ban.
  `Optional<IdBan>`
  `adminBanGet(UUID id)`
  Get the ban for the given admin, if one exists.
  `IdAdmin`
  `adminCreate(Optional<UUID> id, IdName idName, IdRealName realName, IdEmail email, IdPassword password, IdAdminPermissionSet permissions)`
  Create a admin.
  `void`
  `adminDelete(UUID id)`
  Delete the given admin.
  `IdAdmin`
  `adminEmailAdd(UUID id, IdEmail email)`
  Add an email to the given admin.
  `IdAdmin`
  `adminEmailRemove(UUID id, IdEmail email)`
  Remove an email from the given admin.
  `Optional<IdAdmin>`
  `adminGet(UUID id)`
  Fetch the given admin.
  `Optional<IdAdmin>`
  `adminGetByEmail(IdEmail email)`
  Fetch the given admin.
  `IdAdmin`
  `adminPermissionGrant(UUID id, IdAdminPermission permission)`
  Grant a permission to the given admin.
  `IdAdmin`
  `adminPermissionRevoke(UUID id, IdAdminPermission permission)`
  Revoke a permission from the given admin.
  `IdPage<IdAdminSummary>`
  `adminSearchBegin(IdAdminSearchParameters parameters)`
  Start searching/listing admins.
  `IdPage<IdAdminSummary>`
  `adminSearchByEmailBegin(IdAdminSearchByEmailParameters parameters)`
  Start searching/listing admins.
  `IdPage<IdAdminSummary>`
  `adminSearchByEmailNext()`
  Continue searching/listing admins.
  `IdPage<IdAdminSummary>`
  `adminSearchByEmailPrevious()`
  Continue searching/listing admins.
  `IdPage<IdAdminSummary>`
  `adminSearchNext()`
  Continue searching/listing admins.
  `IdPage<IdAdminSummary>`
  `adminSearchPrevious()`
  Continue searching/listing admins.
  `IdAdmin`
  `adminSelf()`
  Retrieve the current admin profile.
  `IdAdmin`
  `adminUpdate(UUID admin, Optional<IdName> idName, Optional<IdRealName> realName, Optional<IdPassword> password)`
  Update the given admin.
  `IdPage<IdAuditEvent>`
  `auditSearchBegin(IdTimeRange timeRange, Optional<String> owner, Optional<String> type, Optional<String> message, int pageSize)`
  Start searching/listing audit events.
  `IdPage<IdAuditEvent>`
  `auditSearchNext()`
  Continue searching/listing events.
  `IdPage<IdAuditEvent>`
  `auditSearchPrevious()`
  Continue searching/listing events.
  `IdANewHandler`
  `login(String admin, String password, URI base)`
  Attempt to log in.
  `void`
  `userBanCreate(IdBan ban)`
  Create a ban on the given user account.
  `void`
  `userBanDelete(IdBan ban)`
  Delete the given ban.
  `Optional<IdBan>`
  `userBanGet(UUID id)`
  Get the ban for the given user, if one exists.
  `IdUser`
  `userCreate(Optional<UUID> id, IdName idName, IdRealName realName, IdEmail email, IdPassword password)`
  Create a user.
  `void`
  `userDelete(UUID id)`
  Delete the given user.
  `IdUser`
  `userEmailAdd(UUID id, IdEmail email)`
  Add an email to the given user.
  `IdUser`
  `userEmailRemove(UUID id, IdEmail email)`
  Remove an email from the given user.
  `Optional<IdUser>`
  `userGet(UUID id)`
  Fetch the given user.
  `Optional<IdUser>`
  `userGetByEmail(IdEmail email)`
  Fetch the given user.
  `List<IdLogin>`
  `userLoginHistory(UUID id)`
  List the login history for the given user.
  `IdPage<IdUserSummary>`
  `userSearchBegin(IdUserSearchParameters parameters)`
  Start searching/listing users.
  `IdPage<IdUserSummary>`
  `userSearchByEmailBegin(IdUserSearchByEmailParameters parameters)`
  Start searching/listing users.
  `IdPage<IdUserSummary>`
  `userSearchByEmailNext()`
  Continue searching/listing users.
  `IdPage<IdUserSummary>`
  `userSearchByEmailPrevious()`
  Continue searching/listing users.
  `IdPage<IdUserSummary>`
  `userSearchNext()`
  Continue searching/listing users.
  `IdPage<IdUserSummary>`
  `userSearchPrevious()`
  Continue searching/listing users.
  `IdUser`
  `userUpdate(UUID user, Optional<IdName> idName, Optional<IdRealName> realName, Optional<IdPassword> password)`
  Update the given user.

  ### Methods inherited from class com.io7m.idstore.admin_client.internal.IdAClientProtocolHandlerAbstract

  `base, httpClient, strings`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface com.io7m.idstore.admin_client.api.IdAClientUsersType

  `userCreate`

- ## Constructor Details

  - ### IdAClientProtocolHandler1

    public IdAClientProtocolHandler1(HttpClient inHttpClient, IdAStrings inStrings, URI inBase)
    The version 1 protocol handler.
    Parameters:
      `inHttpClient` - The HTTP client
      `inStrings` - The string resources
      `inBase` - The base URI

- ## Method Details

  - ### login

    public IdANewHandler login(String admin, String password, URI base) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientProtocolHandlerType`
    Attempt to log in.
    Parameters:
      `admin` - The admin
      `password` - The password
      `base` - The base URI
    Returns:
      A new protocol handler
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminSelf

    public IdAdmin adminSelf() throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Retrieve the current admin profile.
    Returns:
      The current user
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userSearchBegin

    public IdPage<IdUserSummary> userSearchBegin(IdUserSearchParameters parameters) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    Start searching/listing users. Calling this method will set the search parameters and effectively reset searching back to page 1 of any results.
    Parameters:
      `parameters` - The search parameters
    Returns:
      The first page of results
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userSearchNext

    public IdPage<IdUserSummary> userSearchNext() throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    Continue searching/listing users. This will return the next page of results.
    Returns:
      The next page of results
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userSearchPrevious

    public IdPage<IdUserSummary> userSearchPrevious() throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    Continue searching/listing users. This will return the previous page of results.
    Returns:
      The previous page of results
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userSearchByEmailBegin

    public IdPage<IdUserSummary> userSearchByEmailBegin(IdUserSearchByEmailParameters parameters) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    Start searching/listing users. Calling this method will set the search parameters and effectively reset searching back to page 1 of any results.
    Parameters:
      `parameters` - The search parameters
    Returns:
      The first page of results
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userSearchByEmailNext

    public IdPage<IdUserSummary> userSearchByEmailNext() throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    Continue searching/listing users. This will return the next page of results.
    Returns:
      The next page of results
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userSearchByEmailPrevious

    public IdPage<IdUserSummary> userSearchByEmailPrevious() throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    Continue searching/listing users. This will return the previous page of results.
    Returns:
      The previous page of results
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userGet

    public Optional<IdUser> userGet(UUID id) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    Fetch the given user.
    Parameters:
      `id` - The user ID
    Returns:
      The user, if one exists
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userGetByEmail

    public Optional<IdUser> userGetByEmail(IdEmail email) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    Fetch the given user.
    Parameters:
      `email` - The user email
    Returns:
      The user, if one exists
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userUpdate

    public IdUser userUpdate(UUID user, Optional<IdName> idName, Optional<IdRealName> realName, Optional<IdPassword> password) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    Update the given user.
    Parameters:
      `user` - The user
      `idName` - The new idname
      `realName` - The new realname
      `password` - The new password
    Returns:
      The updated user
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userEmailAdd

    public IdUser userEmailAdd(UUID id, IdEmail email) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    Add an email to the given user.
    Parameters:
      `id` - The user ID
      `email` - The email address
    Returns:
      The updated user
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userEmailRemove

    public IdUser userEmailRemove(UUID id, IdEmail email) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    Remove an email from the given user.
    Parameters:
      `id` - The user ID
      `email` - The email address
    Returns:
      The updated user
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userCreate

    public IdUser userCreate(Optional<UUID> id, IdName idName, IdRealName realName, IdEmail email, IdPassword password) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    Create a user.
    Parameters:
      `id` - The ID
      `idName` - The ID name
      `realName` - The real name
      `email` - The email
      `password` - The password
    Returns:
      The created user
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userDelete

    public void userDelete(UUID id) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    Delete the given user.
    Parameters:
      `id` - The user ID
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - 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: `IdAClientAuditType`
    Start searching/listing audit events. Calling this method will set the search parameters and effectively reset searching back to page 1 of any results.
    Parameters:
      `timeRange` - The time range within which events should have been created
      `owner` - The owner search query
      `type` - The type search query
      `message` - The message search query
      `pageSize` - The page size
    Returns:
      The first page of results
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### auditSearchNext

    public IdPage<IdAuditEvent> auditSearchNext() throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAuditType`
    Continue searching/listing events. This will return the next page of results.
    Returns:
      The next page of results
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### auditSearchPrevious

    public IdPage<IdAuditEvent> auditSearchPrevious() throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAuditType`
    Continue searching/listing events. This will return the previous page of results.
    Returns:
      The previous page of results
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminSearchBegin

    public IdPage<IdAdminSummary> adminSearchBegin(IdAdminSearchParameters parameters) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Start searching/listing admins. Calling this method will set the search parameters and effectively reset searching back to page 1 of any results.
    Parameters:
      `parameters` - The search parameters
    Returns:
      The first page of results
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminSearchNext

    public IdPage<IdAdminSummary> adminSearchNext() throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Continue searching/listing admins. This will return the next page of results.
    Returns:
      The next page of results
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminSearchPrevious

    public IdPage<IdAdminSummary> adminSearchPrevious() throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Continue searching/listing admins. This will return the previous page of results.
    Returns:
      The previous page of results
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminSearchByEmailBegin

    public IdPage<IdAdminSummary> adminSearchByEmailBegin(IdAdminSearchByEmailParameters parameters) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Start searching/listing admins. Calling this method will set the search parameters and effectively reset searching back to page 1 of any results.
    Parameters:
      `parameters` - The search parameters
    Returns:
      The first page of results
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminSearchByEmailNext

    public IdPage<IdAdminSummary> adminSearchByEmailNext() throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Continue searching/listing admins. This will return the next page of results.
    Returns:
      The next page of results
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminSearchByEmailPrevious

    public IdPage<IdAdminSummary> adminSearchByEmailPrevious() throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Continue searching/listing admins. This will return the previous page of results.
    Returns:
      The previous page of results
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminGet

    public Optional<IdAdmin> adminGet(UUID id) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Fetch the given admin.
    Parameters:
      `id` - The admin ID
    Returns:
      The admin, if one exists
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminGetByEmail

    public Optional<IdAdmin> adminGetByEmail(IdEmail email) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Fetch the given admin.
    Parameters:
      `email` - The admin email
    Returns:
      The admin, if one exists
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminUpdate

    public IdAdmin adminUpdate(UUID admin, Optional<IdName> idName, Optional<IdRealName> realName, Optional<IdPassword> password) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Update the given admin.
    Parameters:
      `admin` - The admin
      `idName` - The new idname
      `realName` - The new realname
      `password` - The new password
    Returns:
      The updated admin
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - 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: `IdAClientAdminsType`
    Create a admin.
    Parameters:
      `id` - The ID
      `idName` - The ID name
      `realName` - The real name
      `email` - The email
      `password` - The password
      `permissions` - The permissions
    Returns:
      The created admin
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminDelete

    public void adminDelete(UUID id) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Delete the given admin.
    Parameters:
      `id` - The admin ID
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminEmailAdd

    public IdAdmin adminEmailAdd(UUID id, IdEmail email) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Add an email to the given admin.
    Parameters:
      `id` - The admin ID
      `email` - The email address
    Returns:
      The updated admin
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminEmailRemove

    public IdAdmin adminEmailRemove(UUID id, IdEmail email) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Remove an email from the given admin.
    Parameters:
      `id` - The admin ID
      `email` - The email address
    Returns:
      The updated admin
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminPermissionGrant

    public IdAdmin adminPermissionGrant(UUID id, IdAdminPermission permission) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Grant a permission to the given admin.
    Parameters:
      `id` - The admin ID
      `permission` - The permission
    Returns:
      The updated admin
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminPermissionRevoke

    public IdAdmin adminPermissionRevoke(UUID id, IdAdminPermission permission) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Revoke a permission from the given admin.
    Parameters:
      `id` - The admin ID
      `permission` - The permission
    Returns:
      The updated admin
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminBanCreate

    public void adminBanCreate(IdBan ban) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Create a ban on the given admin account.
    Parameters:
      `ban` - The ban
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminBanGet

    public Optional<IdBan> adminBanGet(UUID id) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Get the ban for the given admin, if one exists.
    Parameters:
      `id` - The admin ID
    Returns:
      The ban, if any
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### adminBanDelete

    public void adminBanDelete(IdBan ban) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientAdminsType`
    Delete the given ban.
    Parameters:
      `ban` - The ban
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userBanCreate

    public void userBanCreate(IdBan ban) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    Create a ban on the given user account.
    Parameters:
      `ban` - The ban
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userBanGet

    public Optional<IdBan> userBanGet(UUID id) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    Get the ban for the given user, if one exists.
    Parameters:
      `id` - The user ID
    Returns:
      The ban, if any
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userBanDelete

    public void userBanDelete(IdBan ban) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    Delete the given ban.
    Parameters:
      `ban` - The ban
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption

  - ### userLoginHistory

    public List<IdLogin> userLoginHistory(UUID id) throws IdAClientException, InterruptedException
    Description copied from interface: `IdAClientUsersType`
    List the login history for the given user.
    Parameters:
      `id` - The user ID
    Returns:
      The login history
    Throws:
      `IdAClientException` - On errors
      `InterruptedException` - On interruption