|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.berkeley.psi.sed.generic.genericPacketReader
class genericPacketReader
This is a package-internal class which reads generic request packets. An instance of this class is fed ATcpInPackets (via the parsePacket method). When a complete packet has been read, a genericRequest is pushed to the corresponding SinkIF. This is the bulk of the generic protocol implementation.
Field Summary | |
---|---|
private aSocketInputStream |
ais
|
private SinkIF |
compQ
|
private genericConnection |
conn
|
private static boolean |
DEBUG
|
private int |
genericVer
|
private java.util.Vector |
header
|
private java.lang.String |
request
|
private int |
state
|
private static int |
STATE_DONE
|
private static int |
STATE_HEADER
|
private static int |
STATE_START
|
private java.io.StreamTokenizer |
tok
|
private java.lang.String |
url
|
Constructor Summary | |
---|---|
genericPacketReader(genericConnection conn,
SinkIF compQ)
Create an genericPacketReader with the given genericConnection and completion queue. |
Method Summary | |
---|---|
private int |
accumulateHeader()
Accumulate header lines. |
private java.lang.String |
nextLine()
Read the next line from the packet. |
private java.lang.String |
nextWord()
Read the next whitespace-delimited word from the packet. |
(package private) boolean |
parsePacket(ATcpInPacket pkt)
Parse the given packet; returns true if a complete generic request has been received and parsed. |
private int |
parseURL()
Parse the first line of the request header. |
private void |
processHeader()
Process the header, possibly pushing an genericRequest to the user. |
private void |
reset()
Reset the internal state of the packet reader. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final boolean DEBUG
private static final int STATE_START
private static final int STATE_HEADER
private static final int STATE_DONE
private int state
private aSocketInputStream ais
private java.io.StreamTokenizer tok
private java.lang.String request
private java.lang.String url
private int genericVer
private java.util.Vector header
private genericConnection conn
private SinkIF compQ
Constructor Detail |
---|
genericPacketReader(genericConnection conn, SinkIF compQ)
Method Detail |
---|
boolean parsePacket(ATcpInPacket pkt) throws java.io.IOException
java.io.IOException
private void reset()
private int parseURL() throws java.io.IOException
java.io.IOException
private int accumulateHeader() throws java.io.IOException
java.io.IOException
private void processHeader() throws java.io.IOException
java.io.IOException
private java.lang.String nextWord() throws java.io.IOException
java.io.IOException
private java.lang.String nextLine() throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |