Package com.io7m.cardant.server.api

# Interface CAServerType

All Superinterfaces:
  `AutoCloseable`

All Known Implementing Classes:
  `CAServer`

public interface CAServerType extends AutoCloseable
The type of servers.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `CAServerConfiguration`
  `configuration()`
  `CADatabaseType`
  `database()`
  `default URI`
  `inventoryAPI()`
  `boolean`
  `isClosed()`
  `void`
  `setUserAsAdmin(CAUserID adminId, com.io7m.idstore.model.IdName adminName)`
  Do the work necessary to set up a server instance (such as initializing and/or upgrading the database) but do not actually start the instance.
  `void`
  `start()`
  Start the server instance.

- ## Method Details

  - ### start

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

  - ### database

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

  - ### inventoryAPI

    default URI inventoryAPI()
    Returns:
      The address of the inventory API

  - ### configuration

    CAServerConfiguration configuration()
    Returns:
      The server's associated configuration

  - ### isClosed

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

  - ### setUserAsAdmin

    void setUserAsAdmin(CAUserID adminId, com.io7m.idstore.model.IdName adminName) throws CAServerException

    Do the work necessary to set up a server instance (such as initializing and/or upgrading the database) but do not actually start the instance. A user with the given ID will be marked as the administrator and assigned all available security roles.

    The given name is simply informative; it will be replaced by the name in the identity server the first time the user logs in.

    Parameters:
      `adminId` - The admin ID
      `adminName` - The name
    Throws:
      `CAServerException` - On errors

  - ### close

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