|
NIST SIP Parser and Stack (v1.2) API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.nist.javax.sip.parser.PipelinedMsgParser
This implements a pipelined message parser suitable for use with a stream - oriented input such as TCP. The client uses this class by instatiating with an input stream from which input is read and fed to a message parser. It keeps reading from the input stream and process messages in a never ending interpreter loop. The message listener interface gets called for processing messages or for processing errors. The payload specified by the content-length header is read directly from the input stream. This can be accessed from the SIPMessage using the getContent and getContentBytes methods provided by the SIPMessage class.
SIPMessageListener
Constructor Summary | |
PipelinedMsgParser(InputStream in)
This is the constructor for the pipelined parser. |
|
PipelinedMsgParser(SIPMessageListener mhandler,
InputStream in)
This is the constructor for the pipelined parser. |
|
PipelinedMsgParser(SIPMessageListener sipMessageListener,
InputStream in,
boolean debug)
Constructor when we are given a message listener and an input stream (could be a TCP connection or a file) |
Method Summary | |
void |
processInput()
Start reading and processing input. |
void |
run()
This is input reading thread for the pipelined parser. |
void |
setMessageListener(SIPMessageListener mlistener)
Add a class that implements a SIPMessageListener interface whose methods get called * on successful parse and error conditons. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PipelinedMsgParser(SIPMessageListener sipMessageListener, InputStream in, boolean debug)
sipMessageListener
- Message listener which has
methods that get called
back from the parser when a parse is completein
- Input stream from which to read the input.debug
- Enable/disable tracing or lexical analyser switch.public PipelinedMsgParser(SIPMessageListener mhandler, InputStream in)
mhandler
- a SIPMessageListener implementation that
provides the message handlers to
handle correctly and incorrectly parsed messages.in
- An input stream to read messages from.public PipelinedMsgParser(InputStream in)
in
- - An input stream to read messages from.Method Detail |
public void processInput()
public void setMessageListener(SIPMessageListener mlistener)
mlistener
- a SIPMessageListener
implementation that can react to correct and incorrect
pars.public void run()
run
in interface Runnable
|
NIST SIP Parser and Stack (v1.2) API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |