|
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.UDPMessageChannel
public class UDPMessageChannel
This is the UDP Message handler that gets created when a UDP message needs to be processed. The message is processed by creating a String Message parser and invoking it on the message read from the UDP socket. The parsed structure is handed off via a SIP stack request for further processing. This stack structure isolates the message handling logic from the mechanics of sending and recieving messages (which could be either udp or tcp.
Method Summary | |
---|---|
void |
close()
Close the message channel. |
boolean |
equals(Object other)
Compare two UDP Message channels for equality. |
String |
getHost()
get the stack address for the stack that received this message. |
String |
getKey()
Generate a key which identifies the message channel. |
String |
getPeerAddress()
get the address of the host that sent me the message |
String |
getPeerName()
get the name (address) of the host that sent me the message |
InetAddress |
getPeerPacketSourceAddress()
|
int |
getPeerPacketSourcePort()
|
int |
getPeerPort()
Get the sender port ( the port of the other end that sent me the message). |
String |
getPeerProtocol()
|
int |
getPort()
get the port. |
SIPTransactionStack |
getSIPStack()
get the stack pointer. |
String |
getTransport()
Return a transport string. |
String |
getViaHost()
Get the logical originator of the message (from the top via header). |
int |
getViaPort()
Get the logical port of the message orginator (from the top via hdr). |
void |
handleException(ParseException ex,
SIPMessage sipMessage,
Class hdrClass,
String header,
String message)
Implementation of the ParseExceptionListener interface. |
boolean |
isReliable()
Returns "false" as this is an unreliable transport. |
boolean |
isSecure()
UDP is not a secure protocol. |
void |
processMessage(SIPMessage sipMessage)
Actually proces the parsed message. |
void |
run()
Run method specified by runnnable. |
void |
sendMessage(SIPMessage sipMessage)
Return a reply from a pre-constructed reply. |
Methods inherited from class gov.nist.javax.sip.stack.MessageChannel |
---|
getHostPort, getKey, getKey, getMessageProcessor, getPeerHostPort, getRawIpSourceAddress, getViaHeader, getViaHostPort, logResponse, sendMessage, sendMessage |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void run()
run
in interface Runnable
public void processMessage(SIPMessage sipMessage)
processMessage
in interface RawMessageChannel
sipMessage
- public void handleException(ParseException ex, SIPMessage sipMessage, Class hdrClass, String header, String message) throws ParseException
handleException
in interface ParseExceptionListener
ex
- Exception that is given to us by the parser.sipMessage
- -- sip message being processed.header
- -- header/RL/SL text being parsed.message
- -- message where this header was detected.
ParseException
- If we choose to reject the header or message.public void sendMessage(SIPMessage sipMessage) throws IOException
sendMessage
in class MessageChannel
sipMessage
- Message string to send.
IOException
- If there is a problem with sending the message.public SIPTransactionStack getSIPStack()
getSIPStack
in class MessageChannel
public String getTransport()
getTransport
in class MessageChannel
public String getHost()
getHost
in class MessageChannel
public int getPort()
getPort
in class MessageChannel
public String getPeerName()
public String getPeerAddress()
getPeerAddress
in class MessageChannel
public boolean equals(Object other)
equals
in class Object
other
- The other message channel with which to compare oursleves.public String getKey()
MessageChannel
getKey
in class MessageChannel
public int getPeerPacketSourcePort()
getPeerPacketSourcePort
in class MessageChannel
public InetAddress getPeerPacketSourceAddress()
getPeerPacketSourceAddress
in class MessageChannel
public String getViaHost()
getViaHost
in class MessageChannel
public int getViaPort()
getViaPort
in class MessageChannel
public boolean isReliable()
isReliable
in class MessageChannel
public boolean isSecure()
isSecure
in class MessageChannel
public int getPeerPort()
MessageChannel
getPeerPort
in class MessageChannel
public String getPeerProtocol()
public void close()
close
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 |