Package com.io7m.idstore.user_client.internal

# Class IdUClient

java.lang.Object
com.io7m.idstore.user_client.internal.IdUClient

All Implemented Interfaces:
  `IdUClientType`, `IdUClientUsersType`, `Closeable`, `AutoCloseable`

public final class IdUClient extends Object implements IdUClientType
The default client implementation.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IdUClient(Locale inLocale, IdUStrings inStrings, HttpClient inHttpClient, IdUClientProtocolHandlerType inHandler)`
  The default client implementation.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `IdUser`
  `login(String user, String password, URI base)`
  Log in.
  `void`
  `userEmailAddBegin(IdEmail email)`
  Start adding the given email address to the current user.
  `void`
  `userEmailAddDeny(IdToken token)`
  Reject a challenge that adds an email address to the given user.
  `void`
  `userEmailAddPermit(IdToken token)`
  Complete a challenge that adds an email address to the given user.
  `void`
  `userEmailRemoveBegin(IdEmail email)`
  Start removing the given email address to the current user.
  `void`
  `userEmailRemoveDeny(IdToken token)`
  Reject a challenge that removes an email address to the given user.
  `void`
  `userEmailRemovePermit(IdToken token)`
  Complete a challenge that removes an email address to the given user.
  `void`
  `userPasswordUpdate(String password, String passwordConfirm)`
  Update the user's password.
  `void`
  `userRealNameUpdate(IdRealName realName)`
  Update the user's realname.
  `IdUser`
  `userSelf()`
  Retrieve the current user profile.

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

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

- ## Constructor Details

  - ### IdUClient

    public IdUClient(Locale inLocale, IdUStrings inStrings, HttpClient inHttpClient, IdUClientProtocolHandlerType inHandler)
    The default client implementation.
    Parameters:
      `inLocale` - The locale
      `inStrings` - The string resources
      `inHttpClient` - The HTTP client
      `inHandler` - The versioned handler

- ## Method Details

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Throws:
      `IOException`

  - ### login

    public IdUser login(String user, String password, URI base) throws IdUClientException, InterruptedException
    Description copied from interface: `IdUClientType`
    Log in.
    Specified by:
      `login` in interface `IdUClientType`
    Parameters:
      `user` - The admin username
      `password` - The password
      `base` - The base URI
    Returns:
      The logged-in user
    Throws:
      `IdUClientException` - On errors
      `InterruptedException` - On interruption

  - ### userSelf

    public IdUser userSelf() throws IdUClientException, InterruptedException
    Description copied from interface: `IdUClientUsersType`
    Retrieve the current user profile.
    Specified by:
      `userSelf` in interface `IdUClientUsersType`
    Returns:
      The current user
    Throws:
      `IdUClientException` - On errors
      `InterruptedException` - On interruption

  - ### userEmailAddBegin

    public void userEmailAddBegin(IdEmail email) throws IdUClientException, InterruptedException
    Description copied from interface: `IdUClientUsersType`
    Start adding the given email address to the current user.
    Specified by:
      `userEmailAddBegin` in interface `IdUClientUsersType`
    Parameters:
      `email` - The email address
    Throws:
      `IdUClientException` - On errors
      `InterruptedException` - On interruption

  - ### userEmailAddPermit

    public void userEmailAddPermit(IdToken token) throws IdUClientException, InterruptedException
    Description copied from interface: `IdUClientUsersType`
    Complete a challenge that adds an email address to the given user.
    Specified by:
      `userEmailAddPermit` in interface `IdUClientUsersType`
    Parameters:
      `token` - The challenge token
    Throws:
      `IdUClientException` - On errors
      `InterruptedException` - On interruption

  - ### userEmailAddDeny

    public void userEmailAddDeny(IdToken token) throws IdUClientException, InterruptedException
    Description copied from interface: `IdUClientUsersType`
    Reject a challenge that adds an email address to the given user.
    Specified by:
      `userEmailAddDeny` in interface `IdUClientUsersType`
    Parameters:
      `token` - The challenge token
    Throws:
      `IdUClientException` - On errors
      `InterruptedException` - On interruption

  - ### userEmailRemoveBegin

    public void userEmailRemoveBegin(IdEmail email) throws IdUClientException, InterruptedException
    Description copied from interface: `IdUClientUsersType`
    Start removing the given email address to the current user.
    Specified by:
      `userEmailRemoveBegin` in interface `IdUClientUsersType`
    Parameters:
      `email` - The email address
    Throws:
      `IdUClientException` - On errors
      `InterruptedException` - On interruption

  - ### userEmailRemovePermit

    public void userEmailRemovePermit(IdToken token) throws IdUClientException, InterruptedException
    Description copied from interface: `IdUClientUsersType`
    Complete a challenge that removes an email address to the given user.
    Specified by:
      `userEmailRemovePermit` in interface `IdUClientUsersType`
    Parameters:
      `token` - The challenge token
    Throws:
      `IdUClientException` - On errors
      `InterruptedException` - On interruption

  - ### userEmailRemoveDeny

    public void userEmailRemoveDeny(IdToken token) throws IdUClientException, InterruptedException
    Description copied from interface: `IdUClientUsersType`
    Reject a challenge that removes an email address to the given user.
    Specified by:
      `userEmailRemoveDeny` in interface `IdUClientUsersType`
    Parameters:
      `token` - The challenge token
    Throws:
      `IdUClientException` - On errors
      `InterruptedException` - On interruption

  - ### userRealNameUpdate

    public void userRealNameUpdate(IdRealName realName) throws IdUClientException, InterruptedException
    Description copied from interface: `IdUClientUsersType`
    Update the user's realname.
    Specified by:
      `userRealNameUpdate` in interface `IdUClientUsersType`
    Parameters:
      `realName` - The new realname
    Throws:
      `IdUClientException` - On errors
      `InterruptedException` - On interruption

  - ### userPasswordUpdate

    public void userPasswordUpdate(String password, String passwordConfirm) throws IdUClientException, InterruptedException
    Description copied from interface: `IdUClientUsersType`
    Update the user's password.
    Specified by:
      `userPasswordUpdate` in interface `IdUClientUsersType`
    Parameters:
      `password` - The password
      `passwordConfirm` - The password confirmation
    Throws:
      `IdUClientException` - On errors
      `InterruptedException` - On interruption