Package org.beryx.textio.web
Class SparkDataServer
- java.lang.Object
-
- org.beryx.textio.web.AbstractDataServer<spark.Request>
-
- org.beryx.textio.web.SparkDataServer
-
- All Implemented Interfaces:
DataServer
public class SparkDataServer extends AbstractDataServer<spark.Request>
A SparkJava-based web server that allows clients to access theDataApi
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SparkDataServer.SessionHolder
-
Nested classes/interfaces inherited from class org.beryx.textio.web.AbstractDataServer
AbstractDataServer.ResponseData
-
-
Field Summary
-
Fields inherited from class org.beryx.textio.web.AbstractDataServer
DEFAULT_PATH_FOR_GET_DATA, DEFAULT_PATH_FOR_INIT_DATA, DEFAULT_PATH_FOR_POST_INPUT
-
-
Constructor Summary
Constructors Constructor Description SparkDataServer(java.util.function.BiFunction<SparkDataServer.SessionHolder,java.lang.String,DataApi> dataApiCreator, java.util.function.Function<SparkDataServer.SessionHolder,DataApi> dataApiGetter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
configureResponseData(spark.Response response, AbstractDataServer.ResponseData r)
DataApiProvider<spark.Request>
getDataApiProvider()
protected static java.lang.String
getId(spark.Request request)
int
getPort()
void
init()
SparkDataServer
withPort(int portNumber)
-
Methods inherited from class org.beryx.textio.web.AbstractDataServer
getPathForGetData, getPathForPostInit, getPathForPostInput, handle, handleGetData, handleInit, handlePostInput, withPathForGetData, withPathForInitData, withPathForPostInput
-
-
-
-
Constructor Detail
-
SparkDataServer
public SparkDataServer(java.util.function.BiFunction<SparkDataServer.SessionHolder,java.lang.String,DataApi> dataApiCreator, java.util.function.Function<SparkDataServer.SessionHolder,DataApi> dataApiGetter)
-
-
Method Detail
-
getDataApiProvider
public DataApiProvider<spark.Request> getDataApiProvider()
- Specified by:
getDataApiProvider
in classAbstractDataServer<spark.Request>
-
withPort
public SparkDataServer withPort(int portNumber)
-
getPort
public int getPort()
-
getId
protected static java.lang.String getId(spark.Request request)
-
configureResponseData
protected java.lang.String configureResponseData(spark.Response response, AbstractDataServer.ResponseData r)
-
init
public void init()
-
-