@Authors(value="Nikolche Mihajlovski") @Since(value="2.0.0") public abstract class DefaultExchange<T> extends org.rapidoid.RapidoidThing implements ProtocolContext<T>, org.rapidoid.buffer.BufProvider, org.rapidoid.util.Resetable, org.rapidoid.util.Constants
| Modifier and Type | Field and Description |
|---|---|
protected Channel |
conn |
protected long |
requestId |
protected AtomicLong |
totalWritten |
AMP, ANY, ASTERISK, BYTE_0, COL, CR, CR_, CR_LF, CR_LF_CR_LF, DELETE, EMPTY_ARRAY, EMPTY_STRING_ARRAY, EQ, F, GET, GET_OR_POST, HEAD, HTTP_VERBS, LAST_6, LF, LF_, LF_LF, MALFORMED_CHAR, NOT_FOUND, OPTIONS, PATCH, POST, PUT, SEMI_COL, SEPARATOR_LINE, SPACE, SPACE_, T, TRACE, UTF8_2_BYTES_LEAD, UTF8_3_BYTES_LEAD, UTF8_4_BYTES_LEAD, UTF8_CONTINUATION| Constructor and Description |
|---|
DefaultExchange() |
| Modifier and Type | Method and Description |
|---|---|
String |
address() |
long |
async() |
protected org.rapidoid.data.BinaryMultiData |
binaryMultiData(org.rapidoid.data.KeyValueRanges ranges) |
org.rapidoid.buffer.Buf |
buffer() |
T |
close() |
T |
closeIf(boolean condition) |
long |
connId() |
protected org.rapidoid.data.Data |
data(org.rapidoid.data.BufRange range) |
protected org.rapidoid.data.Data |
decodedData(org.rapidoid.data.BufRange range) |
InetSocketAddress |
getAddress() |
long |
getTotalWritten() |
RapidoidHelper |
helper() |
org.rapidoid.buffer.Buf |
input() |
boolean |
isAsync() |
protected T |
me() |
protected org.rapidoid.data.MultiData |
multiData(org.rapidoid.data.KeyValueRanges ranges) |
org.rapidoid.buffer.Buf |
output() |
String |
readln() |
String |
readN(int count) |
long |
requestId() |
void |
reset() |
void |
setConnection(Channel conn) |
T |
write(byte[] bytes) |
T |
write(byte[] bytes,
int offset,
int length) |
T |
write(ByteBuffer buf) |
T |
write(File file) |
T |
write(String s) |
T |
writeJSON(Object value) |
T |
writeln(String s) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandle, isClosed, isClosing, isInitial, log, onSameThread, outputStream, resume, send, setRequest, state, waitUntilClosingprotected Channel conn
protected AtomicLong totalWritten
protected long requestId
public void reset()
reset in interface org.rapidoid.util.Resetablepublic void setConnection(Channel conn)
public String address()
address in interface ProtocolContext<T>public T write(String s)
write in interface ProtocolContext<T>public T writeln(String s)
writeln in interface ProtocolContext<T>public T write(byte[] bytes)
write in interface ProtocolContext<T>public T write(byte[] bytes, int offset, int length)
write in interface ProtocolContext<T>public T write(ByteBuffer buf)
write in interface ProtocolContext<T>public T write(File file)
write in interface ProtocolContext<T>public T writeJSON(Object value)
writeJSON in interface ProtocolContext<T>public T close()
close in interface ProtocolContext<T>public T closeIf(boolean condition)
closeIf in interface ProtocolContext<T>public org.rapidoid.buffer.Buf input()
input in interface ProtocolContext<T>public org.rapidoid.buffer.Buf output()
output in interface ProtocolContext<T>public String readln()
readln in interface ProtocolContext<T>public String readN(int count)
readN in interface ProtocolContext<T>public InetSocketAddress getAddress()
getAddress in interface ProtocolContext<T>public RapidoidHelper helper()
helper in interface ProtocolContext<T>public long connId()
connId in interface ProtocolContext<T>protected org.rapidoid.data.Data data(org.rapidoid.data.BufRange range)
protected org.rapidoid.data.Data decodedData(org.rapidoid.data.BufRange range)
protected org.rapidoid.data.MultiData multiData(org.rapidoid.data.KeyValueRanges ranges)
protected org.rapidoid.data.BinaryMultiData binaryMultiData(org.rapidoid.data.KeyValueRanges ranges)
public org.rapidoid.buffer.Buf buffer()
buffer in interface org.rapidoid.buffer.BufProviderpublic long getTotalWritten()
public long async()
async in interface ProtocolContext<T>public boolean isAsync()
isAsync in interface ProtocolContext<T>protected T me()
public long requestId()
requestId in interface ProtocolContext<T>Copyright © 2014–2017 Nikolche Mihajlovski and contributors. All rights reserved.