public interface IServer
IFrontController as
a dependency and call handle(...) on it when
a new request is made.| Modifier and Type | Method and Description |
|---|---|
void |
addCookies(Object exchange,
Map<String,ICookie> cookies)
Adds cookies.
|
void |
addStaticResourceToServe(IStaticResource<?> staticResource)
Adds a static resource to serve directly by the server.
|
void |
end(Object exchange)
Ends the exchange.
|
void |
flushBytes(Object exchange,
byte[] bytes,
boolean end)
Flushes some bytes to the response.
|
boolean |
forceRequestSizeValidation(Object exchange)
Is the request size valid?
|
ContentTypeDefaults |
getContentTypeBestMatch(Object exchange)
Gets the best
Content-Type to use for the current request. |
Map<String,ICookie> |
getCookies(Object exchange)
Gets the current cookies.
|
Map<String,List<String>> |
getFormDatas(Object exchange)
The form datas, if any.
|
String |
getFullUrl(Object exchange)
The full encoded URL of the original request, including the queryString.
|
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 exchange)
The raw InputStream of the current request.
|
Map<String,List<String>> |
getRequestHeaders(Object exchange)
The headers from the request.
|
String |
getRequestScheme(Object exchange)
Gets the request scheme, "http" for example.
|
Map<String,List<String>> |
getResponseHeaders(Object exchange)
Gets the response headers.
|
IStaticResource<?> |
getStaticResourceServed(String urlPath)
Gets a static resource served directly by the server, using its path.
|
Set<IStaticResource<?>> |
getStaticResourcesServed()
Gets all static resource served directly by the server.
|
Map<String,List<File>> |
getUploadedFiles(Object exchange)
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.
|
void |
removeStaticResourcesServed(StaticResourceType staticResourceType,
String urlPath)
Removes a static resource served directly by the server.
|
void |
setResponseHeader(Object exchange,
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
|
void start()
void stop()
void addStaticResourceToServe(IStaticResource<?> staticResource)
void removeStaticResourcesServed(StaticResourceType staticResourceType, String urlPath)
void removeAllStaticResourcesServed()
IStaticResource<?> getStaticResourceServed(String urlPath)
Set<IStaticResource<?>> getStaticResourcesServed()
HttpMethod getHttpMethod(Object exchange)
String getFullUrl(Object exchange)
ContentTypeDefaults getContentTypeBestMatch(Object exchange)
Content-Type to use for the current request.void setResponseHeaders(Object exchange, Map<String,List<String>> headers)
void setResponseHeader(Object exchange, String name, List<String> values)
Map<String,List<String>> getResponseHeaders(Object exchange)
void removeResponseHeader(Object exchange, String name)
Map<String,List<String>> getQueryStringParams(Object exchange)
void setResponseStatusCode(Object exchange, int statusCode)
void flushBytes(Object exchange, byte[] bytes, boolean end)
end - if true, the exchange will be closed
and nothing more will be able to be send.void end(Object exchange)
boolean isResponseClosed(Object exchange)
boolean isResponseHeadersSent(Object exchange)
String getRequestScheme(Object exchange)
InputStream getRawInputStream(Object exchange)
Map<String,List<File>> getUploadedFiles(Object exchange)
boolean forceRequestSizeValidation(Object exchange)
Copyright © 2016. All rights reserved.