Package org.beryx.textio.web
Class AbstractDataServer<CTX>
- java.lang.Object
-
- org.beryx.textio.web.AbstractDataServer<CTX>
-
- All Implemented Interfaces:
DataServer
- Direct Known Subclasses:
RatpackDataServer
,SparkDataServer
public abstract class AbstractDataServer<CTX> extends java.lang.Object implements DataServer
Typically used as base class forDataServer
implementations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractDataServer.ResponseData
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_PATH_FOR_GET_DATA
static java.lang.String
DEFAULT_PATH_FOR_INIT_DATA
static java.lang.String
DEFAULT_PATH_FOR_POST_INPUT
-
Constructor Summary
Constructors Constructor Description AbstractDataServer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract DataApiProvider<CTX>
getDataApiProvider()
java.lang.String
getPathForGetData()
java.lang.String
getPathForPostInit()
java.lang.String
getPathForPostInput()
protected AbstractDataServer.ResponseData
handle(java.util.function.Supplier<java.lang.String> textSupplier)
protected AbstractDataServer.ResponseData
handleGetData(CTX ctx)
protected AbstractDataServer.ResponseData
handleInit(CTX ctx, java.lang.String initData)
protected AbstractDataServer.ResponseData
handlePostInput(CTX ctx, java.lang.String input, boolean userInterrupt, java.lang.String handlerId)
AbstractDataServer<CTX>
withPathForGetData(java.lang.String pathForGetData)
AbstractDataServer<CTX>
withPathForInitData(java.lang.String pathForInitData)
AbstractDataServer<CTX>
withPathForPostInput(java.lang.String pathForPostInput)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.beryx.textio.web.DataServer
getPort, init, withPort
-
-
-
-
Field Detail
-
DEFAULT_PATH_FOR_INIT_DATA
public static final java.lang.String DEFAULT_PATH_FOR_INIT_DATA
- See Also:
- Constant Field Values
-
DEFAULT_PATH_FOR_GET_DATA
public static final java.lang.String DEFAULT_PATH_FOR_GET_DATA
- See Also:
- Constant Field Values
-
DEFAULT_PATH_FOR_POST_INPUT
public static final java.lang.String DEFAULT_PATH_FOR_POST_INPUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDataApiProvider
public abstract DataApiProvider<CTX> getDataApiProvider()
-
withPathForInitData
public AbstractDataServer<CTX> withPathForInitData(java.lang.String pathForInitData)
- Specified by:
withPathForInitData
in interfaceDataServer
-
getPathForPostInit
public java.lang.String getPathForPostInit()
-
withPathForGetData
public AbstractDataServer<CTX> withPathForGetData(java.lang.String pathForGetData)
- Specified by:
withPathForGetData
in interfaceDataServer
-
getPathForGetData
public java.lang.String getPathForGetData()
-
withPathForPostInput
public AbstractDataServer<CTX> withPathForPostInput(java.lang.String pathForPostInput)
- Specified by:
withPathForPostInput
in interfaceDataServer
-
getPathForPostInput
public java.lang.String getPathForPostInput()
-
handle
protected AbstractDataServer.ResponseData handle(java.util.function.Supplier<java.lang.String> textSupplier)
-
handleInit
protected AbstractDataServer.ResponseData handleInit(CTX ctx, java.lang.String initData)
-
handleGetData
protected AbstractDataServer.ResponseData handleGetData(CTX ctx)
-
handlePostInput
protected AbstractDataServer.ResponseData handlePostInput(CTX ctx, java.lang.String input, boolean userInterrupt, java.lang.String handlerId)
-
-