Package com.io7m.idstore.server.controller.admin

# Class IdAdminLoginService

java.lang.Object
com.io7m.idstore.server.controller.admin.IdAdminLoginService

All Implemented Interfaces:
  `IdServiceType`

public final class IdAdminLoginService extends Object implements IdServiceType
A service that handles the logic for admin logins.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final record`
  `IdAdminLoginService.IdAdminLoggedIn`
  A record of an admin logging in.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IdAdminLoginService(IdServerClock inClock, IdServerStrings inStrings, IdSessionAdminService inSessions)`
  A service that handles the logic for admin logins.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `IdAdminLoginService.IdAdminLoggedIn`
  `adminLogin(IdDatabaseTransactionType transaction, UUID requestId, String username, String password, Map<String,String> metadata)`
  Try logging in.
  `String`
  `description()`

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

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

- ## Constructor Details

  - ### IdAdminLoginService

    public IdAdminLoginService(IdServerClock inClock, IdServerStrings inStrings, IdSessionAdminService inSessions)
    A service that handles the logic for admin logins.
    Parameters:
      `inClock` - The clock
      `inStrings` - The string resources
      `inSessions` - A session service

- ## Method Details

  - ### adminLogin

    public IdAdminLoginService.IdAdminLoggedIn adminLogin(IdDatabaseTransactionType transaction, UUID requestId, String username, String password, Map<String,String> metadata) throws IdCommandExecutionFailure
    Try logging in. Create a new session if logging in succeeds, or raise an exception if the login cannot proceed for any reason (invalid credentials, banned user, etc).
    Parameters:
      `transaction` - A database transaction
      `requestId` - The ID of the request
      `username` - The username
      `password` - The password
      `metadata` - The request metadata
    Returns:
      A login record
    Throws:
      `IdCommandExecutionFailure` - On errors

  - ### description

    public String description()
    Specified by:
      `description` in interface `IdServiceType`
    Returns:
      The service description