|
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.stack.MessageChannel
gov.nist.javax.sip.stack.TLSMessageChannel
public final class TLSMessageChannel
This is sipStack for TLS connections. This abstracts a stream of parsed messages. The SIP sipStack starts this from the main SIPStack class for each connection that it accepts. It starts a message parser in its own thread and talks to the message parser via a pipe. The message parser calls back via the parseError or processMessage functions that are defined as part of the SIPMessageListener interface.
PipelinedMsgParser
Method Summary | |
---|---|
void |
close()
Close the message channel. |
boolean |
equals(Object other)
Equals predicate. |
String |
getKey()
Get an identifying key. |
String |
getPeerAddress()
get the address of the client that sent the data to us. |
InetAddress |
getPeerPacketSourceAddress()
|
int |
getPeerPacketSourcePort()
|
int |
getPeerPort()
Get the port of the peer to whom we are sending messages. |
String |
getPeerProtocol()
|
SIPTransactionStack |
getSIPStack()
Get my SIP Stack. |
String |
getTransport()
get the transport string. |
String |
getViaHost()
Get the host to assign to outgoing messages. |
int |
getViaPort()
Get the port for outgoing messages sent from the channel. |
void |
handleException(ParseException ex,
SIPMessage sipMessage,
Class hdrClass,
String header,
String message)
Exception processor for exceptions detected from the parser. |
boolean |
isReliable()
Returns "true" as this is a reliable transport. |
boolean |
isSecure()
TLS Is a secure protocol. |
void |
processMessage(SIPMessage sipMessage)
Gets invoked by the parser as a callback on successful message parsing (i.e. no parser errors). |
void |
run()
This gets invoked when thread.start is called from the constructor. |
void |
sendMessage(byte[] message,
InetAddress receiverAddress,
int receiverPort,
boolean retry)
Send a message to a specified address. |
void |
sendMessage(SIPMessage sipMessage)
Return a formatted message to the client. |
Methods inherited from class gov.nist.javax.sip.stack.MessageChannel |
---|
getHost, getHostPort, getKey, getKey, getMessageProcessor, getPeerHostPort, getPort, getRawIpSourceAddress, getViaHeader, getViaHostPort, logResponse, sendMessage, sendMessage |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean isReliable()
isReliable
in class MessageChannel
public void close()
close
in class MessageChannel
public SIPTransactionStack getSIPStack()
getSIPStack
in class MessageChannel
public String getTransport()
getTransport
in class MessageChannel
public String getPeerAddress()
getPeerAddress
in class MessageChannel
public String getPeerProtocol()
public void sendMessage(SIPMessage sipMessage) throws IOException
sendMessage
in class MessageChannel
sipMessage
- Message to send.
IOException
- If there is an error sending the messagepublic void sendMessage(byte[] message, InetAddress receiverAddress, int receiverPort, boolean retry) throws IOException
message
- Pre-formatted message to send.receiverAddress
- Address to send it to.receiverPort
- Receiver port.
IOException
- If there is a problem connecting or sending.public void handleException(ParseException ex, SIPMessage sipMessage, Class hdrClass, String header, String message) throws ParseException
handleException
in interface ParseExceptionListener
sipMessage
- -- the message that incurred the error.ex
- -- parse exception detected by the parser.header
- -- header that caused the error.message
- -- message where this header was detected.
ParseException
- Thrown if we want to reject the message.public void processMessage(SIPMessage sipMessage) throws Exception
processMessage
in interface SIPMessageListener
processMessage
in interface RawMessageChannel
sipMessage
- Mesage to process (this calls the application for processing the
message).
Jvb: note that this code is identical to TCPMessageChannel, refactor some day
Exception
for the method that gets called
on parse exception.
public void run()
run
in interface Runnable
public boolean equals(Object other)
equals
in class Object
other
- is the other object to compare ourselves to for equalspublic String getKey()
getKey
in class MessageChannel
public String getViaHost()
getViaHost
in class MessageChannel
public int getViaPort()
getViaPort
in class MessageChannel
public int getPeerPort()
getPeerPort
in class MessageChannel
public int getPeerPacketSourcePort()
getPeerPacketSourcePort
in class MessageChannel
public InetAddress getPeerPacketSourceAddress()
getPeerPacketSourceAddress
in class MessageChannel
public boolean isSecure()
isSecure
in class MessageChannel
|
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 |