Package com.io7m.idstore.server.api

# Interface IdServerType

All Superinterfaces:
  `AutoCloseable`

All Known Implementing Classes:
  `IdServer`

public interface IdServerType extends AutoCloseable
A server instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default URI`
  `adminAPI()`
  `void`
  `close()`
  `IdServerConfiguration`
  `configuration()`
  `void`
  `createOrUpdateInitialAdmin(UUID adminId, IdName adminName, IdEmail adminEmail, IdRealName adminRealName, String adminPassword)`
  Create the initial admin, or update the existing one if the admin already exists with the given ID.
  `IdDatabaseType`
  `database()`
  `boolean`
  `isClosed()`
  `void`
  `start()`
  Start the server instance.
  `default URI`
  `userAPI()`
  `default URI`
  `userView()`

- ## Method Details

  - ### start

    void start() throws IdServerException
    Start the server instance. Can be called multiple times redundantly, and can be called before or after #close() has been called.
    Throws:
      `IdServerException` - On errors

  - ### database

    IdDatabaseType database()
    Returns:
      The server's database instance

  - ### isClosed

    boolean isClosed()
    Returns:
      `true` if the server is closed
    See Also:
      - `start()`
      - `close()`

  - ### close

    void close() throws IdServerException
    Specified by:
      `close` in interface `AutoCloseable`
    Throws:
      `IdServerException`

  - ### configuration

    IdServerConfiguration configuration()
    Returns:
      The configuration used for the server

  - ### userAPI

    default URI userAPI()
    Returns:
      The address of the user API

  - ### userView

    default URI userView()
    Returns:
      The address of the user view

  - ### adminAPI

    default URI adminAPI()
    Returns:
      The address of the admin API

  - ### createOrUpdateInitialAdmin

    void createOrUpdateInitialAdmin(UUID adminId, IdName adminName, IdEmail adminEmail, IdRealName adminRealName, String adminPassword) throws IdServerException
    Create the initial admin, or update the existing one if the admin already exists with the given ID.
    Parameters:
      `adminId` - The admin ID
      `adminName` - The initial administrator to create
      `adminEmail` - The admin email
      `adminRealName` - The admin's real name
      `adminPassword` - The password for the initial administrator
    Throws:
      `IdServerException` - On errors