Package be.cylab.mark.datastore
Class Datastore
- java.lang.Object
-
- be.cylab.mark.datastore.Datastore
-
public class Datastore extends Object
- Author:
- Thibault Debatty
-
-
Constructor Summary
Constructors Constructor Description Datastore(Config config, RequestHandler request_handler, com.mongodb.client.MongoDatabase mongodb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.mongodb.client.MongoDatabase
getMongodb()
ServerInterface
getRequestHandler()
void
start()
Start the datastore.This will start the json-rpc server in a separate thread and return when the server is ready.void
stop()
Stop the datastore.
-
-
-
Constructor Detail
-
Datastore
@Inject public Datastore(Config config, RequestHandler request_handler, com.mongodb.client.MongoDatabase mongodb)
- Parameters:
config
-request_handler
-mongodb
-
-
-
Method Detail
-
start
public final void start() throws InvalidProfileException, InterruptedException, Exception
Start the datastore.This will start the json-rpc server in a separate thread and return when the server is ready.- Throws:
InvalidProfileException
- if the adapter class mentioned in the configuration is invalidInterruptedException
- if we were stoppedException
- if the server failed to start
-
stop
public final void stop() throws Exception
Stop the datastore.- Throws:
Exception
- if jetty fails to stop.
-
getRequestHandler
public final ServerInterface getRequestHandler()
- Returns:
-
getMongodb
public final com.mongodb.client.MongoDatabase getMongodb()
- Returns:
-
-