| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
static String |
UNDERTOW_EXCEPTION_CODE_REQUEST_TOO_LARGE |
| Constructor and Description |
|---|
SpincastUndertowServer(ISpincastConfig config,
IFrontController frontController,
ISpincastUtils spincastUtils,
ICookieFactory cookieFactory,
ISSLContextManager sslContextManager,
ICorsHandlerFactory corsHandlerFactory,
IGzipCheckerHandlerFactory gzipCheckerHandlerFactory,
IFileClassPathResourceManagerFactory fileClassPathResourceManagerFactory)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected io.undertow.Undertow.Builder |
addBuilderOptions(io.undertow.Undertow.Builder builder) |
void |
addCookies(Object exchange,
Map<String,ICookie> cookies)
Adds cookies.
|
protected void |
addHttpListener(io.undertow.Undertow.Builder builder,
String serverHost,
int httpServerPort) |
protected void |
addHttpsListener(io.undertow.Undertow.Builder builder,
String serverHost,
int httpsServerPort) |
void |
addStaticResourceToServe(IStaticResource<?> staticResource)
Adds a static resource to serve directly by the server.
|
protected io.undertow.server.HttpServerExchange |
castExchange(Object exchange) |
void |
end(Object exchange)
Ends the exchange.
|
void |
flushBytes(Object exchange,
byte[] bytes,
boolean end)
Flushes some bytes to the response.
|
boolean |
forceRequestSizeValidation(Object exchangeObj)
Is the request size valid?
|
protected io.undertow.io.IoCallback |
getCloseExchangeCallback() |
protected ISpincastConfig |
getConfig() |
ContentTypeDefaults |
getContentTypeBestMatch(Object exchangeObj)
Gets the best
Content-Type to use for the current request. |
protected String |
getCookieEncoding() |
protected ICookieFactory |
getCookieFactory() |
Map<String,ICookie> |
getCookies(Object exchange)
Gets the current cookies.
|
protected ICorsHandlerFactory |
getCorsHandlerFactory() |
protected io.undertow.io.IoCallback |
getDoNothingCallback() |
protected IFileClassPathResourceManagerFactory |
getFileClassPathResourceManagerFactory() |
protected io.undertow.server.HttpHandler |
getFinalHandler() |
protected io.undertow.server.handlers.form.FormData |
getFormData(io.undertow.server.HttpServerExchange exchange)
May return NULL.
|
Map<String,List<String>> |
getFormDatas(Object exchangeObj)
The form datas, if any.
|
protected io.undertow.server.handlers.form.FormParserFactory |
getFormParserFactory() |
protected IFrontController |
getFrontController() |
String |
getFullUrl(Object exchangeObj)
The full encoded URL of the original request, including the queryString.
|
protected IGzipCheckerHandlerFactory |
getGzipCheckerHandlerFactory() |
HttpMethod |
getHttpMethod(Object exchange)
Gets the HTTP method associated with the request.
|
Map<String,List<String>> |
getQueryStringParams(Object exchange)
Gets the queryString parameters.
|
InputStream |
getRawInputStream(Object exchangeObj)
The raw InputStream of the current request.
|
Map<String,List<String>> |
getRequestHeaders(Object exchangeObj)
The headers from the request.
|
String |
getRequestScheme(Object exchange)
Gets the request scheme, "http" for example.
|
Map<String,List<String>> |
getResponseHeaders(Object exchangeObj)
Gets the response headers.
|
protected io.undertow.Undertow.Builder |
getServerBuilder() |
protected int |
getServerStartTryNbr() |
protected io.undertow.server.HttpHandler |
getSpincastFrontControllerHandler() |
protected ISpincastUtils |
getSpincastUtils() |
protected ISSLContextManager |
getSslContextManager() |
protected long |
getStartServerSleepMilliseconds() |
IStaticResource<?> |
getStaticResourceServed(String urlPath)
Gets a static resource served directly by the server, using its path.
|
protected io.undertow.server.handlers.PathHandler |
getStaticResourcesPathHandler() |
Set<IStaticResource<?>> |
getStaticResourcesServed()
Gets all static resource served directly by the server.
|
protected Map<String,IStaticResource<?>> |
getStaticResourcesServedByUrlPath() |
Map<String,List<File>> |
getUploadedFiles(Object exchangeObj)
The uploaded files, if any.
|
boolean |
isResponseClosed(Object exchange)
Is the response closed?
|
boolean |
isResponseHeadersSent(Object exchange)
Are the response headers sent?
|
void |
removeAllStaticResourcesServed()
Removes all static resources served directly by the server.
|
void |
removeResponseHeader(Object exchange,
String name)
Removes a response header.
|
protected void |
removeStaticResource(StaticResourceType staticResourceType,
String urlPath) |
void |
removeStaticResourcesServed(StaticResourceType staticResourceType,
String urlPath)
Removes a static resource served directly by the server.
|
void |
setResponseHeader(Object exchangeObj,
String name,
List<String> values)
Sets a response header.
|
void |
setResponseHeaders(Object exchange,
Map<String,List<String>> headers)
Sets the response headers.
|
void |
setResponseStatusCode(Object exchange,
int statusCode)
Sets the response status code.
|
void |
start()
Starts the server.
|
void |
stop()
Stops the server
|
protected final org.slf4j.Logger logger
public static final String UNDERTOW_EXCEPTION_CODE_REQUEST_TOO_LARGE
@Inject public SpincastUndertowServer(ISpincastConfig config, IFrontController frontController, ISpincastUtils spincastUtils, ICookieFactory cookieFactory, ISSLContextManager sslContextManager, ICorsHandlerFactory corsHandlerFactory, IGzipCheckerHandlerFactory gzipCheckerHandlerFactory, IFileClassPathResourceManagerFactory fileClassPathResourceManagerFactory)
protected ISpincastConfig getConfig()
protected IFrontController getFrontController()
protected ISpincastUtils getSpincastUtils()
protected ICookieFactory getCookieFactory()
protected ISSLContextManager getSslContextManager()
protected ICorsHandlerFactory getCorsHandlerFactory()
protected IGzipCheckerHandlerFactory getGzipCheckerHandlerFactory()
protected IFileClassPathResourceManagerFactory getFileClassPathResourceManagerFactory()
protected Map<String,IStaticResource<?>> getStaticResourcesServedByUrlPath()
protected io.undertow.server.handlers.form.FormParserFactory getFormParserFactory()
public void start()
IServerprotected int getServerStartTryNbr()
protected long getStartServerSleepMilliseconds()
protected io.undertow.Undertow.Builder getServerBuilder()
protected void addHttpListener(io.undertow.Undertow.Builder builder,
String serverHost,
int httpServerPort)
protected void addHttpsListener(io.undertow.Undertow.Builder builder,
String serverHost,
int httpsServerPort)
protected io.undertow.Undertow.Builder addBuilderOptions(io.undertow.Undertow.Builder builder)
protected io.undertow.server.HttpHandler getFinalHandler()
protected io.undertow.server.HttpHandler getSpincastFrontControllerHandler()
public void stop()
IServerprotected io.undertow.server.handlers.PathHandler getStaticResourcesPathHandler()
public void addStaticResourceToServe(IStaticResource<?> staticResource)
IServeraddStaticResourceToServe in interface IServerpublic void removeStaticResourcesServed(StaticResourceType staticResourceType, String urlPath)
IServerremoveStaticResourcesServed in interface IServerpublic void removeAllStaticResourcesServed()
IServerremoveAllStaticResourcesServed in interface IServerprotected void removeStaticResource(StaticResourceType staticResourceType, String urlPath)
public IStaticResource<?> getStaticResourceServed(String urlPath)
IServergetStaticResourceServed in interface IServerpublic Set<IStaticResource<?>> getStaticResourcesServed()
IServergetStaticResourcesServed in interface IServerpublic HttpMethod getHttpMethod(Object exchange)
IServergetHttpMethod in interface IServerprotected io.undertow.server.HttpServerExchange castExchange(Object exchange)
public ContentTypeDefaults getContentTypeBestMatch(Object exchangeObj)
IServerContent-Type to use for the current request.getContentTypeBestMatch in interface IServerpublic String getFullUrl(Object exchangeObj)
IServergetFullUrl in interface IServerpublic void setResponseHeader(Object exchangeObj, String name, List<String> values)
IServersetResponseHeader in interface IServerpublic void setResponseHeaders(Object exchange, Map<String,List<String>> headers)
IServersetResponseHeaders in interface IServerpublic Map<String,List<String>> getResponseHeaders(Object exchangeObj)
IServergetResponseHeaders in interface IServerpublic void removeResponseHeader(Object exchange, String name)
IServerremoveResponseHeader in interface IServerpublic void setResponseStatusCode(Object exchange, int statusCode)
IServersetResponseStatusCode in interface IServerprotected io.undertow.io.IoCallback getDoNothingCallback()
protected io.undertow.io.IoCallback getCloseExchangeCallback()
public void flushBytes(Object exchange, byte[] bytes, boolean end)
IServerflushBytes in interface IServerend - if true, the exchange will be closed
and nothing more will be able to be send.public void end(Object exchange)
IServerpublic boolean isResponseClosed(Object exchange)
IServerisResponseClosed in interface IServerpublic boolean isResponseHeadersSent(Object exchange)
IServerisResponseHeadersSent in interface IServerpublic String getRequestScheme(Object exchange)
IServergetRequestScheme in interface IServerpublic void addCookies(Object exchange, Map<String,ICookie> cookies)
IServeraddCookies in interface IServerpublic Map<String,ICookie> getCookies(Object exchange)
IServergetCookies in interface IServerprotected String getCookieEncoding()
public Map<String,List<String>> getQueryStringParams(Object exchange)
IServergetQueryStringParams in interface IServerpublic InputStream getRawInputStream(Object exchangeObj)
IServergetRawInputStream in interface IServerprotected io.undertow.server.handlers.form.FormData getFormData(io.undertow.server.HttpServerExchange exchange)
public Map<String,List<String>> getFormDatas(Object exchangeObj)
IServergetFormDatas in interface IServerpublic Map<String,List<File>> getUploadedFiles(Object exchangeObj)
IServergetUploadedFiles in interface IServerpublic boolean forceRequestSizeValidation(Object exchangeObj)
IServerforceRequestSizeValidation in interface IServerCopyright © 2016. All rights reserved.