Package be.cylab.mark.server
Class Server
- java.lang.Object
-
- be.cylab.mark.server.Server
-
public class Server extends Object
Represents a MARK server. It is composed of:- a webserver
- an activation controller
- a datastore (json-rpc server)
- a monitor threat to save status
- optionally: some data agents
- Author:
- Thibault Debatty
-
-
Constructor Summary
Constructors Constructor Description Server(ActivationController activation_controller, DataSourcesController sources, Datastore datastore, Config config)
Initialize a server with default configuration, dummy subject adapter, no data agents and no detection agents.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDataAgentProfile(DataAgentProfile profile)
Allows to programmatically add a data agent to the server.void
batch()
Run the server in batch mode.void
start()
Non-blocking start the datastore and data agents (sources) in separate threads.void
stop()
Stop the data agents, wait for all detection agents to complete and eventually stop the datastore.
-
-
-
Constructor Detail
-
Server
@Inject public Server(ActivationController activation_controller, DataSourcesController sources, Datastore datastore, Config config) throws Throwable
Initialize a server with default configuration, dummy subject adapter, no data agents and no detection agents.- Parameters:
activation_controller
-sources
-datastore
-config
-- Throws:
Throwable
- on any error
-
-
Method Detail
-
start
public final void start() throws MalformedURLException, Exception
Non-blocking start the datastore and data agents (sources) in separate threads. This method returns when the server and agents are started. You can use server.stop()- Throws:
MalformedURLException
- if the URL specified by config is invalidException
- if Jetty caused an exception
-
batch
public final void batch() throws Exception
Run the server in batch mode.- start the server
- wait for data sources to complete
- save resulting ranking lists
- stop the server
- Throws:
Exception
- if Jetty caused an exception
-
stop
public final void stop() throws Exception
Stop the data agents, wait for all detection agents to complete and eventually stop the datastore.- Throws:
Exception
- on any error
-
addDataAgentProfile
public final void addDataAgentProfile(DataAgentProfile profile)
Allows to programmatically add a data agent to the server. Used for integration tests for example.- Parameters:
profile
-
-
-