Package com.io7m.cardant.server.api
Interface CAServerType
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
CAServer
The type of servers.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()database()default URIbooleanisClosed()voidsetUserAsAdmin(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.voidstart()Start the server instance.
-
Method Details
-
start
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
- Returns:
- The address of the inventory API
-
configuration
CAServerConfiguration configuration()- Returns:
- The server's associated configuration
-
isClosed
boolean isClosed()- Returns:
trueif the server is closed- See Also:
-
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 IDadminName- The name- Throws:
CAServerException- On errors
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
CAServerException
-