Emitter.Listener| Modifier and Type | Field and Description |
|---|---|
protected Parser |
mParser |
protected ReadyState |
mReadyState |
| Modifier | Constructor and Description |
|---|---|
protected |
Transport(Parser parser) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the transport if not already closed.
|
protected abstract void |
doClose()
Transport specific logic for closing transport.
|
abstract Map<String,List<String>> |
getInitialHeaders()
Get the headers of the initial HTTP request.
|
abstract Map<String,String> |
getInitialQuery()
Get the query parameters of the initial HTTP request.
|
abstract String |
getName()
Get the name of this transport.
|
abstract boolean |
isWritable()
Checks whether the transport is currently writable.
|
protected void |
onClose()
Called by child to indicate closure of transport.
|
protected void |
onData(Object data)
Called by child to indicate data received from remote client.
|
protected void |
onError(String reason,
String description)
Called by child class to indicate error with transport.
|
protected void |
onPacket(Packet<?> packet)
Called by child to indicate a packet receive from remote client.
|
abstract void |
onRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handle a client HTTP request.
|
abstract void |
send(List<Packet<?>> packets)
Send a list of packets over the transport.
|
protected final Parser mParser
protected ReadyState mReadyState
protected Transport(Parser parser)
public abstract Map<String,String> getInitialQuery()
public abstract Map<String,List<String>> getInitialHeaders()
public abstract void onRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException
request - The HTTP request object.response - The HTTP response object.IOException - On IO error.public abstract void send(List<Packet<?>> packets)
packets - List of packets to send.public abstract boolean isWritable()
public abstract String getName()
protected abstract void doClose()
public void close()
protected void onError(String reason, String description)
reason - Reason of error.description - Description of error.protected void onPacket(Packet<?> packet)
packet - Packet received by transport.protected void onData(Object data)
data - Encoded data received by transport.protected void onClose()
Copyright © 2022. All rights reserved.