Class DataStoreHttpServer
java.lang.Object
org.moeaframework.analysis.store.http.DataStoreHttpServer
Provides read-only HTTP access to data stores.
This server uses unsecured HTTP connections. Use caution when running on a publicly-accessible network. This is primarily intended for testing and debugging purposes.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new HTTP server to provide read-only access data stores.DataStoreHttpServer
(InetSocketAddress address) Creates a new HTTP server to provide read-only access data stores. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Associates the given URI path with the data store.void
Registers a shutdown hook to stop this server when the JVM shuts down.void
shutdown()
Shuts down this HTTP server.
-
Constructor Details
-
DataStoreHttpServer
Creates a new HTTP server to provide read-only access data stores.- Throws:
IOException
- if an error occurred starting the server, such asBindException
-
DataStoreHttpServer
Creates a new HTTP server to provide read-only access data stores.- Parameters:
address
- the socket address the server binds to- Throws:
IOException
- if an error occurred starting the server, such asBindException
-
-
Method Details
-
configure
Associates the given URI path with the data store.- Parameters:
path
- the URI path that directs requests to this data storedataStore
- the data store
-
registerShutdownHook
public void registerShutdownHook()Registers a shutdown hook to stop this server when the JVM shuts down. -
shutdown
public void shutdown()Shuts down this HTTP server. This should either be called explicitly when the server is not longer in use, or byregisterShutdownHook()
.
-