Package com.io7m.idstore.database.api

# Interface IdDatabaseEmailsQueriesType

All Superinterfaces:
  `IdDatabaseQueriesType`

public non-sealed interface IdDatabaseEmailsQueriesType extends IdDatabaseQueriesType
The database queries involving emails.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Optional<IdEmailOwner>`
  `emailExists(IdEmail email)`
  Determine if an email address already exists.
  `long`
  `emailVerificationCount()`
  Count the number of active email verifications for the current user.
  `void`
  `emailVerificationCreate(IdEmailVerification verification)`
  Create a verification.
  `void`
  `emailVerificationDelete(IdToken token, IdEmailVerificationResolution resolution)`
  Delete a verification.
  `Optional<IdEmailVerification>`
  `emailVerificationGetDeny(IdToken token)`
  Retrieve a verification by the "deny" token.
  `Optional<IdEmailVerification>`
  `emailVerificationGetPermit(IdToken token)`
  Retrieve a verification by the "permit" token.

- ## Method Details

  - ### emailExists

    Optional<IdEmailOwner> emailExists(IdEmail email) throws IdDatabaseException
    Determine if an email address already exists.
    Parameters:
      `email` - The email address
    Returns:
      The user ID that owns the email address, if any
    Throws:
      `IdDatabaseException` - On errors

  - ### emailVerificationCreate

    @IdDatabaseRequiresUser void emailVerificationCreate(IdEmailVerification verification) throws IdDatabaseException
    Create a verification.
    Parameters:
      `verification` - The verification
    Throws:
      `IdDatabaseException` - On errors

  - ### emailVerificationGetPermit

    Optional<IdEmailVerification> emailVerificationGetPermit(IdToken token) throws IdDatabaseException
    Retrieve a verification by the "permit" token.
    Parameters:
      `token` - The verification token
    Returns:
      The verification, if one exists
    Throws:
      `IdDatabaseException` - On errors

  - ### emailVerificationGetDeny

    Optional<IdEmailVerification> emailVerificationGetDeny(IdToken token) throws IdDatabaseException
    Retrieve a verification by the "deny" token.
    Parameters:
      `token` - The verification token
    Returns:
      The verification, if one exists
    Throws:
      `IdDatabaseException` - On errors

  - ### emailVerificationDelete

    @IdDatabaseRequiresUser void emailVerificationDelete(IdToken token, IdEmailVerificationResolution resolution) throws IdDatabaseException
    Delete a verification.
    Parameters:
      `token` - The verification token
      `resolution` - The resolution
    Throws:
      `IdDatabaseException` - On errors

  - ### emailVerificationCount

    @IdDatabaseRequiresUser long emailVerificationCount() throws IdDatabaseException
    Count the number of active email verifications for the current user.
    Returns:
      The number of active email verifications
    Throws:
      `IdDatabaseException` - On errors