public class HttpExchangeImpl extends org.rapidoid.net.impl.DefaultExchange<HttpExchange,HttpExchangeBody> implements HttpExchange, HttpInterception, org.rapidoid.util.Constants
| Modifier and Type | Field and Description |
|---|---|
static String |
SESSION_COOKIE |
static String |
SESSION_PAGE_STACK |
| Constructor and Description |
|---|
HttpExchangeImpl() |
address, async, binaryMultiData, buffer, close, closeIf, connId, data, decodedData, getAddress, getTotalWritten, helper, input, isAsync, meT, meW, multiData, output, readln, readN, restart, setConnectionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final String SESSION_COOKIE
public static final String SESSION_PAGE_STACK
public void reset()
reset in interface org.rapidoid.util.Resetablereset in class org.rapidoid.net.impl.DefaultExchange<HttpExchange,HttpExchangeBody>public org.rapidoid.data.MultiData params_()
params_ in interface HttpExchangepublic org.rapidoid.data.MultiData headers_()
headers_ in interface HttpExchangepublic org.rapidoid.data.MultiData cookies_()
cookies_ in interface HttpExchangepublic org.rapidoid.data.MultiData data_()
data_ in interface HttpExchangepublic org.rapidoid.data.BinaryMultiData files_()
files_ in interface HttpExchangepublic org.rapidoid.data.Data subpath_()
subpath_ in interface HttpExchangepublic org.rapidoid.data.Data body_()
body_ in interface HttpExchangepublic org.rapidoid.data.Data uri_()
uri_ in interface HttpExchangepublic org.rapidoid.data.Data verb_()
verb_ in interface HttpExchangepublic org.rapidoid.data.Data path_()
path_ in interface HttpExchangepublic org.rapidoid.data.Data protocol_()
protocol_ in interface HttpExchangepublic org.rapidoid.data.Data query_()
query_ in interface HttpExchangepublic void setSubpath(int start,
int end)
public HttpExchangeImpl done()
done in interface org.rapidoid.net.abstracts.CtxWrite<HttpExchangeBody>done in class org.rapidoid.net.impl.DefaultExchange<HttpExchange,HttpExchangeBody>public HttpExchangeBody send()
send in interface org.rapidoid.net.abstracts.CtxWrite<HttpExchangeBody>public String verb()
verb in interface HttpExchangepublic String uri()
uri in interface HttpExchangepublic String path()
path in interface HttpExchangepublic String subpath()
subpath in interface HttpExchangepublic String query()
query in interface HttpExchangepublic String protocol()
protocol in interface HttpExchangepublic String body()
body in interface HttpExchangepublic Map<String,String> params()
params in interface HttpExchangepublic String param(String name)
param in interface HttpExchangepublic String param(String name, String defaultValue)
param in interface HttpExchangepublic Map<String,String> headers()
headers in interface HttpExchangepublic String header(String name)
header in interface HttpExchangepublic String header(String name, String defaultValue)
header in interface HttpExchangepublic Map<String,String> cookies()
cookies in interface HttpExchangepublic String cookie(String name)
cookie in interface HttpExchangepublic String cookie(String name, String defaultValue)
cookie in interface HttpExchangepublic Map<String,String> data()
data in interface HttpExchangepublic String data(String name)
data in interface HttpExchangepublic String data(String name, String defaultValue)
data in interface HttpExchangepublic Map<String,byte[]> files()
files in interface HttpExchangepublic byte[] file(String name)
file in interface HttpExchangepublic byte[] file(String name, byte[] defaultValue)
file in interface HttpExchangepublic org.rapidoid.data.Data host_()
host_ in interface HttpExchangepublic String host()
host in interface HttpExchangepublic HttpExchange addHeader(byte[] name, byte[] value)
addHeader in interface HttpExchangeHeaderspublic void completeResponse()
public HttpExchange addHeader(HttpHeader name, String value)
addHeader in interface HttpExchangeHeaderspublic HttpExchange setCookie(String name, String value, String... extras)
setCookie in interface HttpExchangeHeaderspublic HttpExchange setContentType(org.rapidoid.net.mime.MediaType MediaType)
setContentType in interface HttpExchangeHeaderspublic HttpExchange plain()
plain in interface HttpExchangeHeaderspublic HttpExchange html()
html in interface HttpExchangeHeaderspublic HttpExchange json()
json in interface HttpExchangeHeaderspublic HttpExchange binary()
binary in interface HttpExchangeHeaderspublic HttpExchange download(String filename)
download in interface HttpExchangeHeaderspublic void ensureHeadersComplete()
public HttpExchangeBody write(String s)
write in interface org.rapidoid.net.abstracts.CtxWrite<HttpExchangeBody>write in class org.rapidoid.net.impl.DefaultExchange<HttpExchange,HttpExchangeBody>public HttpExchangeBody writeln(String s)
writeln in interface org.rapidoid.net.abstracts.CtxWrite<HttpExchangeBody>writeln in class org.rapidoid.net.impl.DefaultExchange<HttpExchange,HttpExchangeBody>public HttpExchangeBody write(byte[] bytes)
write in interface org.rapidoid.net.abstracts.CtxWrite<HttpExchangeBody>write in class org.rapidoid.net.impl.DefaultExchange<HttpExchange,HttpExchangeBody>public HttpExchangeBody write(byte[] bytes, int offset, int length)
write in interface org.rapidoid.net.abstracts.CtxWrite<HttpExchangeBody>write in class org.rapidoid.net.impl.DefaultExchange<HttpExchange,HttpExchangeBody>public HttpExchangeBody write(ByteBuffer buf)
write in interface org.rapidoid.net.abstracts.CtxWrite<HttpExchangeBody>write in class org.rapidoid.net.impl.DefaultExchange<HttpExchange,HttpExchangeBody>public HttpExchangeBody write(File file)
write in interface org.rapidoid.net.abstracts.CtxWrite<HttpExchangeBody>write in class org.rapidoid.net.impl.DefaultExchange<HttpExchange,HttpExchangeBody>public HttpExchangeBody writeJSON(Object value)
writeJSON in interface org.rapidoid.net.abstracts.CtxWrite<HttpExchangeBody>writeJSON in class org.rapidoid.net.impl.DefaultExchange<HttpExchange,HttpExchangeBody>public boolean isInitial()
isInitial in interface org.rapidoid.net.abstracts.CtxProtocol<HttpExchange>public org.rapidoid.net.impl.ConnState state()
state in interface org.rapidoid.net.abstracts.CtxState<HttpExchange>public boolean hasContentType()
public HttpExchangeBody sendFile(File file)
sendFile in interface HttpExchangeBodypublic HttpExchangeBody sendFile(org.rapidoid.net.mime.MediaType mediaType, byte[] bytes)
sendFile in interface HttpExchangeBodypublic HttpSuccessException redirect(String url)
redirect in interface HttpExchangeBodypublic String redirectUrl()
redirectUrl in interface HttpExchangeHeaderspublic HttpExchangeHeaders response(int httpResponseCode)
response in interface HttpExchangeHeaderspublic HttpExchangeHeaders response(int httpResponseCode, String response)
response in interface HttpExchangeHeaderspublic HttpExchangeHeaders response(int httpResponseCode, String response, Throwable err)
response in interface HttpExchangeHeaderspublic HttpExchangeHeaders startResponse(int httpResponseCode)
startResponse in interface HttpExchangeHeaderspublic String constructUrl(String path)
constructUrl in interface HttpExchangepublic String sessionId()
sessionId in interface HttpExchangeHeaderspublic Map<String,Object> session()
session in interface HttpExchangepublic Map<String,Object> getSessionById(String sessionId)
getSessionById in interface HttpExchangepublic HttpExchangeHeaders sessionSet(String name, Object value)
sessionSet in interface HttpExchangeHeaderspublic <T> T session(String name, T defaultValue)
session in interface HttpExchangepublic <T> T session(String name)
session in interface HttpExchangepublic <T> T sessionGetOrCreate(String name, Class<T> valueClass, Object... constructorArgs)
sessionGetOrCreate in interface HttpExchangepublic HttpExchangeHeaders closeSession()
closeSession in interface HttpExchangeHeaderspublic HttpExchangeHeaders clearSession(String sessionId)
clearSession in interface HttpExchangeHeaderspublic boolean hasSession()
hasSession in interface HttpExchangeHeaderspublic boolean hasSession(String sessionId)
hasSession in interface HttpExchangeHeaderspublic HttpNotFoundException notFound()
notFound in interface HttpExchangeHeaderspublic org.rapidoid.util.UserInfo user()
public boolean isGetReq()
isGetReq in interface HttpExchangepublic boolean isPostReq()
isPostReq in interface HttpExchangepublic byte[] sessionSerialize()
sessionSerialize in interface HttpExchangepublic void sessionDeserialize(byte[] bytes)
sessionDeserialize in interface HttpExchangepublic OutputStream outputStream()
outputStream in interface HttpExchangeBodypublic int responseCode()
responseCode in interface HttpExchangeHeaderspublic HttpExchange exchange()
exchange in interface HttpInterceptionpublic boolean hasError()
hasError in interface HttpInterceptionpublic Throwable getError()
getError in interface HttpInterceptionpublic String pathSegment(int segmentIndex)
pathSegment in interface HttpExchangepublic HttpExchangeHeaders accessDeniedIf(boolean accessDeniedCondition)
accessDeniedIf in interface HttpExchangeHeaderspublic HttpExchangeHeaders errorResponse(Throwable err)
errorResponse in interface HttpExchangeHeaderspublic HttpExchangeHeaders authorize(Class<?> clazz)
authorize in interface HttpExchangeHeaderspublic boolean serveStatic()
serveStatic in interface HttpExchangeHeaderspublic HttpSuccessException goBack(int steps)
goBack in interface HttpExchangeBodypublic HttpExchangeBody addToPageStack()
addToPageStack in interface HttpExchangeBodypublic void init(HttpResponses responses, HttpSession session, Router router)
public HttpSuccessException error()
error in interface HttpExchangeHeadersCopyright © 2014–2015 Nikolche Mihajlovski. All rights reserved.