|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectseda.sandStorm.core.SimpleSink
seda.sandStorm.lib.http.httpConnection
public class httpConnection
This class represents a single HTTP connection. When an httpServer receives a connection, an httpConnection is pushed to the user. To send HTTP responses to a client, you can enqueue an httpResponse object on the corresponding httpConnection.
httpRequest,
httpResponse| Field Summary | |
|---|---|
private SinkIF |
compQ
|
private static boolean |
DEBUG
|
private httpPacketReader |
hpr
|
private httpServer |
hs
|
private ATcpConnection |
tcpconn
|
java.lang.Object |
userTag
Can be used by applications to associate an arbitrary data object with this connection. |
| Fields inherited from interface seda.sandStorm.lib.http.httpConst |
|---|
CRLF, DEFAULT_HTTP_PORT, HTTP_VERSION, WRITE_CLOG_THRESHOLD |
| Constructor Summary | |
|---|---|
httpConnection(ATcpConnection tcpconn,
httpServer hs,
SinkIF compQ)
Package-internal: Create an httpConnection with the given TCP connection and completion queue. |
|
| Method Summary | |
|---|---|
void |
close(SinkIF compQ)
Close the connection. |
void |
enqueue_abort(java.lang.Object key)
Not supported; throws an IllegalArgumentException. |
void |
enqueue_commit(java.lang.Object key)
Not supported; throws an IllegalArgumentException. |
boolean |
enqueue_lossy(QueueElementIF element)
Enqueue outgoing data on this connection. |
void |
enqueue_many(QueueElementIF[] elements)
Enqueue outgoing data on this connection. |
java.lang.Object |
enqueue_prepare(QueueElementIF[] enqueueMe)
Not supported; throws an IllegalArgumentException. |
void |
enqueue(QueueElementIF element)
Enqueue outgoing data on this connection. |
void |
flush(SinkIF compQ)
Flush the connection; a SinkFlushedEvent will be pushed to the user when all packets have drained. |
ATcpConnection |
getConnection()
Return the ATcpConnection associated with this connection. |
(package private) void |
parsePacket(ATcpInPacket pkt)
Package-internal: Parse the data contained in the given TCP packet. |
int |
size()
Return the number of outgoing packets waiting to be sent. |
java.lang.String |
toString()
|
| Methods inherited from class seda.sandStorm.core.SimpleSink |
|---|
getEnqueuePredicate, profileSize, setEnqueuePredicate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final boolean DEBUG
private ATcpConnection tcpconn
private httpServer hs
private SinkIF compQ
private httpPacketReader hpr
public java.lang.Object userTag
| Constructor Detail |
|---|
httpConnection(ATcpConnection tcpconn,
httpServer hs,
SinkIF compQ)
| Method Detail |
|---|
void parsePacket(ATcpInPacket pkt)
throws java.io.IOException
java.io.IOExceptionpublic ATcpConnection getConnection()
public java.lang.String toString()
toString in class java.lang.Objectpublic void enqueue(QueueElementIF element)
throws SinkException
enqueue in interface SinkIFenqueue in class SimpleSinkelement - The QueueElementIF to enqueue
SinkFullException - Indicates that the sink is temporarily full.
SinkClosedException - Indicates that the sink is
no longer being serviced.
SinkExceptionpublic boolean enqueue_lossy(QueueElementIF element)
enqueue_lossy in interface SinkIFenqueue_lossy in class SimpleSinkelement - The QueueElementIF to enqueue
public void enqueue_many(QueueElementIF[] elements)
throws SinkException
enqueue_many in interface SinkIFenqueue_many in class SimpleSinkelements - The element array to enqueue
SinkFullException - Indicates that the sink is temporarily full.
SinkClosedException - Indicates that the sink is
no longer being serviced.
SinkExceptionpublic int size()
size in interface SinkIFsize in class SimpleSinkpublic void close(SinkIF compQ)
throws SinkClosedException
SinkClosedExceptionpublic void flush(SinkIF compQ)
throws SinkClosedException
SinkClosedExceptionpublic java.lang.Object enqueue_prepare(QueueElementIF[] enqueueMe)
throws SinkException
SimpleSink
enqueue_prepare in interface SinkIFenqueue_prepare in class SimpleSinkenqueueMe - The element array to provisionally enqueue
SinkFullException - Indicates that the sink is temporarily full
and that the requested elements could not be provisionally enqueued.
SinkClosedException - Indicates that the sink is
no longer being serviced.
SinkExceptionenqueue_commit,
enqueue_abortpublic void enqueue_commit(java.lang.Object key)
SimpleSink
enqueue_commit in interface SinkIFenqueue_commit in class SimpleSinkpublic void enqueue_abort(java.lang.Object key)
SimpleSink
enqueue_abort in interface SinkIFenqueue_abort in class SimpleSink
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||