|
NIST-SIP: The Reference Implementation for JAIN-SIP 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nist.javax.sip.parser.PipelinedMsgParser
public final class 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(Pipeline in)
This is the constructor for the pipelined parser. |
|
PipelinedMsgParser(SIPMessageListener sipMessageListener,
Pipeline in,
boolean debug,
int maxMessageSize)
Constructor when we are given a message listener and an input stream (could be a TCP connection or a file) |
|
PipelinedMsgParser(SIPMessageListener mhandler,
Pipeline in,
int maxMsgSize)
This is the constructor for the pipelined parser. |
Method Summary | |
---|---|
void |
close()
|
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, Pipeline in, boolean debug, int maxMessageSize)
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, Pipeline in, int maxMsgSize)
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(Pipeline 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
public void close()
|
NIST-SIP: The Reference Implementation for JAIN-SIP 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |