gov.nist.javax.sip.stack
クラス MessageChannel

java.lang.Object
  上位を拡張 gov.nist.javax.sip.stack.MessageChannel
直系の既知のサブクラス:
SipropMessageChannel, SIPTransaction, TCPMessageChannel, UDPMessageChannel

public abstract class MessageChannel
extends java.lang.Object

Message channel abstraction for the SIP stack.

バージョン:
JAIN-SIP-1.1 $Revision: 1.12 $ $Date: 2004/09/04 14:59:54 $ This code is in the public domain.
作成者:
M. Ranganathan

コンストラクタの概要
MessageChannel()
           
 
メソッドの概要
abstract  void close()
          Close the message channel.
 java.lang.String getHost()
          Get the host of this message channel.
 HostPort getHostPort()
          Get the hostport structure of this message channel.
abstract  java.lang.String getKey()
          Generate a key which identifies the message channel.
static java.lang.String getKey(HostPort hostPort, java.lang.String transport)
          Generate a key given host and port.
static java.lang.String getKey(java.net.InetAddress inetAddr, int port, java.lang.String transport)
          generate a key given the inet address port and transport.
 MessageProcessor getMessageProcessor()
          Get the message processor.
abstract  java.lang.String getPeerAddress()
          Get the peer address of the machine that sent us this message.
 HostPort getPeerHostPort()
          Get the peer host and port.
abstract  int getPeerPort()
          Get the sender port ( the port of the other end that sent me the message).
 int getPort()
          Get port of this message channel.
 java.lang.String getRawIpSourceAddress()
          Convenience function to get the raw IP source address of a SIP message as a String.
abstract  SIPMessageStack getSIPStack()
          Get the SIPStack object from this message channel.
abstract  java.lang.String getTransport()
          Get transport string of this message channel.
 Via getViaHeader()
          Get the Via header for this transport.
abstract  java.lang.String getViaHost()
          Get the host to assign for an outgoing Request via header.
 HostPort getViaHostPort()
          Get the via header host:port structure.
abstract  int getViaPort()
          Get the port to assign for the via header of an outgoing message.
abstract  boolean isReliable()
          Get whether this channel is reliable or not.
abstract  boolean isSecure()
          Return true if this is a secure channel.
 void logResponse(SIPResponse sipResponse, long receptionTime, java.lang.String status)
          Log a response received at this message channel.
abstract  void sendMessage(SIPMessage sipMessage)
          Send the message (after it has been formatted)
 void sendMessage(SIPMessage sipMessage, java.net.InetAddress receiverAddress, int receiverPort)
          Send a message given SIP message.
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

MessageChannel

public MessageChannel()
メソッドの詳細

close

public abstract void close()
Close the message channel.


getSIPStack

public abstract SIPMessageStack getSIPStack()
Get the SIPStack object from this message channel.

戻り値:
SIPStack object of this message channel

getTransport

public abstract java.lang.String getTransport()
Get transport string of this message channel.

戻り値:
Transport string of this message channel.

isReliable

public abstract boolean isReliable()
Get whether this channel is reliable or not.

戻り値:
True if reliable, false if not.

isSecure

public abstract boolean isSecure()
Return true if this is a secure channel.


sendMessage

public abstract void sendMessage(SIPMessage sipMessage)
                          throws java.io.IOException
Send the message (after it has been formatted)

パラメータ:
sipMessage - Message to send.
例外:
java.io.IOException

getPeerAddress

public abstract java.lang.String getPeerAddress()
Get the peer address of the machine that sent us this message.

戻り値:
a string contianing the ip address or host name of the sender of the message.

getPeerPort

public abstract int getPeerPort()
Get the sender port ( the port of the other end that sent me the message).


getKey

public abstract java.lang.String getKey()
Generate a key which identifies the message channel. This allows us to cache the message channel.


getViaHost

public abstract java.lang.String getViaHost()
Get the host to assign for an outgoing Request via header.


getViaPort

public abstract int getViaPort()
Get the port to assign for the via header of an outgoing message.


getHost

public java.lang.String getHost()
Get the host of this message channel.

戻り値:
host of this messsage channel.

getPort

public int getPort()
Get port of this message channel.

戻り値:
Port of this message channel.

sendMessage

public void sendMessage(SIPMessage sipMessage,
                        java.net.InetAddress receiverAddress,
                        int receiverPort)
                 throws java.io.IOException
Send a message given SIP message.

パラメータ:
sipMessage - is the messge to send.
receiverAddress - is the address to which we want to send
receiverPort - is the port to which we want to send
例外:
java.io.IOException

getRawIpSourceAddress

public java.lang.String getRawIpSourceAddress()
Convenience function to get the raw IP source address of a SIP message as a String.


getKey

public static java.lang.String getKey(java.net.InetAddress inetAddr,
                                      int port,
                                      java.lang.String transport)
generate a key given the inet address port and transport.


getKey

public static java.lang.String getKey(HostPort hostPort,
                                      java.lang.String transport)
Generate a key given host and port.


getHostPort

public HostPort getHostPort()
Get the hostport structure of this message channel.


getPeerHostPort

public HostPort getPeerHostPort()
Get the peer host and port.

戻り値:
a HostPort structure for the peer.

getViaHeader

public Via getViaHeader()
Get the Via header for this transport. Note that this does not set a branch identifier.

戻り値:
a via header for outgoing messages sent from this channel.

getViaHostPort

public HostPort getViaHostPort()
Get the via header host:port structure. This is extracted from the topmost via header of the request.

戻り値:
a host:port structure

logResponse

public void logResponse(SIPResponse sipResponse,
                        long receptionTime,
                        java.lang.String status)
Log a response received at this message channel. This is used for processing incoming responses to a client transaction.

パラメータ:
receptionTime - is the time at which the response was received.
status - is the processing status of the message.

getMessageProcessor

public MessageProcessor getMessageProcessor()
Get the message processor.