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

java.lang.Object
  上位を拡張 gov.nist.javax.sip.stack.SIPMessageStack
      上位を拡張 gov.nist.javax.sip.stack.SIPTransactionStack
すべての実装されたインタフェース:
SIPTransactionEventListener, java.util.EventListener
直系の既知のサブクラス:
SipStackImpl

public abstract class SIPTransactionStack
extends SIPMessageStack
implements SIPTransactionEventListener

Adds a transaction layer to the SIPMessageStackclass. This is done by replacing the normal MessageChannels returned by the base class with transaction-aware MessageChannels that encapsulate the original channels and handle the transaction state machine, retransmissions, etc.

バージョン:
JAIN-SIP-1.1 $Revision: 1.45 $ $Date: 2004/10/06 16:57:50 $ This code is in the public domain.
作成者:
Jeff Keyser (original), M. Ranganathan
(Added Dialog table)., performance enhacements added by Pierre De Rop and Thomas Froment.

フィールドの概要
static int BASE_TIMER_INTERVAL
          Number of milliseconds between timer ticks (500).
static int CONNECTION_LINGER_TIME
          Connection linger time (seconds)
 
クラス gov.nist.javax.sip.stack.SIPMessageStack から継承されたフィールド
DEFAULT_PORT
 
メソッドの概要
 void addExtensionMethod(java.lang.String extensionMethod)
          Add an extension method.
 void addTransaction(SIPClientTransaction clientTransaction)
          Add a new client transaction to the set of existing transactions.
 void addTransaction(SIPServerTransaction serverTransaction)
          Add a new server transaction to the set of existing transactions.
 SIPClientTransaction createClientTransaction(MessageChannel encapsulatedMessageChannel)
          Creates a client transaction that encapsulates a MessageChannel.
 SIPDialog createDialog(SIPTransaction transaction)
           
 MessageChannel createMessageChannel(javax.sip.address.Hop nextHop)
          Creates a client transaction to handle a new request.
 MessageChannel createMessageChannel(MessageChannel rawChannel)
          Create a client transaction from a raw channel.
 MessageChannel createMessageChannel(SIPTransaction transaction)
          Create a client transaction from a raw channel.
 MessageChannel createRawMessageChannel(javax.sip.address.Hop hop)
          Creates a raw message channel.
 SIPServerTransaction createServerTransaction(MessageChannel encapsulatedMessageChannel)
          Creates a server transaction that encapsulates a MessageChannel.
 SIPTransaction findCancelTransaction(SIPRequest cancelRequest, boolean isServer)
          Get the transaction to cancel.
 SIPServerTransaction findPendingTransaction(SIPRequest requestReceived)
           
 SIPClientTransaction findSubscribeTransaction(SIPRequest notifyMessage)
          Find a matching client SUBSCRIBE to the incoming notify.
 SIPTransaction findTransaction(SIPMessage sipMessage, boolean isServer)
          Find the transaction corresponding to a given request.
 SIPDialog getDialog(java.lang.String dialogId)
          Return the dialog for a given dialog ID.
 java.util.Iterator getDialogs()
          This is for debugging.
 boolean hasResources()
           
 boolean isDialogCreated(java.lang.String method)
          Return true if extension is supported.
 ServerRequestInterface newSIPServerRequest(SIPRequest requestReceived, MessageChannel requestMessageChannel)
          Handles a new SIP request.
 ServerResponseInterface newSIPServerResponse(SIPResponse responseReceived, MessageChannel responseMessageChannel)
          Handles a new SIP response.
 void notifyPendingRecordScanner()
           
 void putDialog(SIPDialog dialog)
          Put a dialog into the dialog table.
 void putPending(PendingRecord pendingRecord)
           
 void putPendingTransaction(SIPServerTransaction tr)
          Put a transaction in the pending transaction list.
 void removeDialog(SIPDialog dialog)
          Remove the dialog from the dialog table.
 void removePending(PendingRecord pendingRecord)
           
 void removePendingTransaction(SIPServerTransaction tr)
           
 void stopStack()
          Stop stack.
 void transactionErrorEvent(SIPTransactionErrorEvent transactionErrorEvent)
          Invoked when an error has ocurred with a transaction.
 
クラス gov.nist.javax.sip.stack.SIPMessageStack から継承されたメソッド
addMessageProcessor, createMessageProcessor, getBadMessageLog, getDefaultRoute, getDefaultRouteHeader, getHostAddress, getLogWriter, getMaxMessageSize, getMessageProcessor, getMessageProcessors, getNextHop, getNextHop, getPort, getRouteHeader, getRouter, getServerLog, getStackName, isAlive, isTransportEnabled, isTransportEnabled, logBadMessage, logMessage, logStackTrace, removeMessageProcessor, setMaxConnections, setRouter, setSingleThreaded, setStackMessageFactory, setStackName, setThreadPoolSize
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

BASE_TIMER_INTERVAL

public static final int BASE_TIMER_INTERVAL
Number of milliseconds between timer ticks (500).

関連項目:
定数フィールド値

CONNECTION_LINGER_TIME

public static final int CONNECTION_LINGER_TIME
Connection linger time (seconds)

関連項目:
定数フィールド値
メソッドの詳細

isDialogCreated

public boolean isDialogCreated(java.lang.String method)
Return true if extension is supported.

戻り値:
true if extension is supported and false otherwise.

addExtensionMethod

public void addExtensionMethod(java.lang.String extensionMethod)
Add an extension method.

パラメータ:
extensionMethod - -- extension method to support for dialog creation

putDialog

public void putDialog(SIPDialog dialog)
Put a dialog into the dialog table.

パラメータ:
dialog - -- dialog to put into the dialog table.

createDialog

public SIPDialog createDialog(SIPTransaction transaction)

getDialogs

public java.util.Iterator getDialogs()
This is for debugging.


removeDialog

public void removeDialog(SIPDialog dialog)
Remove the dialog from the dialog table.

パラメータ:
dialog - -- dialog to remove.

getDialog

public SIPDialog getDialog(java.lang.String dialogId)
Return the dialog for a given dialog ID. If compatibility is enabled then we do not assume the presence of tags and hence need to add a flag to indicate whether this is a server or client transaction.

パラメータ:
dialogId - is the dialog id to check.

findSubscribeTransaction

public SIPClientTransaction findSubscribeTransaction(SIPRequest notifyMessage)
Find a matching client SUBSCRIBE to the incoming notify. NOTIFY requests are matched to such SUBSCRIBE requests if they contain the same "Call-ID", a "To" header "tag" parameter which matches the "From" header "tag" parameter of the SUBSCRIBE, and the same "Event" header field. Rules for comparisons of the "Event" headers are described in section 7.2.1. If a matching NOTIFY request contains a "Subscription-State" of "active" or "pending", it creates a new subscription and a new dialog (unless they have already been created by a matching response, as described above).

パラメータ:
notifyMessage -

findTransaction

public SIPTransaction findTransaction(SIPMessage sipMessage,
                                      boolean isServer)
Find the transaction corresponding to a given request.

パラメータ:
sipMessage - request for which to retrieve the transaction.
isServer - search the server transaction table if true.
戻り値:
the transaction object corresponding to the request or null if no such mapping exists.

findCancelTransaction

public SIPTransaction findCancelTransaction(SIPRequest cancelRequest,
                                            boolean isServer)
Get the transaction to cancel. Search the server transaction table for a transaction that matches the given transaction.


findPendingTransaction

public SIPServerTransaction findPendingTransaction(SIPRequest requestReceived)

removePendingTransaction

public void removePendingTransaction(SIPServerTransaction tr)

newSIPServerRequest

public ServerRequestInterface newSIPServerRequest(SIPRequest requestReceived,
                                                  MessageChannel requestMessageChannel)
Handles a new SIP request. It finds a server transaction to handle this message. If none exists, it creates a new transaction.

オーバーライド:
クラス SIPMessageStack 内の newSIPServerRequest
パラメータ:
requestReceived - Request to handle.
requestMessageChannel - Channel that received message.
戻り値:
A server transaction.

newSIPServerResponse

public ServerResponseInterface newSIPServerResponse(SIPResponse responseReceived,
                                                    MessageChannel responseMessageChannel)
Handles a new SIP response. It finds a client transaction to handle this message. If none exists, it sends the message directly to the superclass.

オーバーライド:
クラス SIPMessageStack 内の newSIPServerResponse
パラメータ:
responseReceived - Response to handle.
responseMessageChannel - Channel that received message.
戻り値:
A client transaction.

createMessageChannel

public MessageChannel createMessageChannel(javax.sip.address.Hop nextHop)
                                    throws java.net.UnknownHostException
Creates a client transaction to handle a new request. Gets the real message channel from the superclass, and then creates a new client transaction wrapped around this channel.

オーバーライド:
クラス SIPMessageStack 内の createMessageChannel
パラメータ:
nextHop - Hop to create a channel to contact.
戻り値:
A MessageChannel to the specified Hop, or null if no MessageProcessors support contacting that Hop.
例外:
java.net.UnknownHostException

createMessageChannel

public MessageChannel createMessageChannel(MessageChannel rawChannel)
Create a client transaction from a raw channel.

パラメータ:
rawChannel - is the transport channel to encapsulate.

createMessageChannel

public MessageChannel createMessageChannel(SIPTransaction transaction)
Create a client transaction from a raw channel.

パラメータ:
transaction - is the transport channel to encapsulate.

createClientTransaction

public SIPClientTransaction createClientTransaction(MessageChannel encapsulatedMessageChannel)
Creates a client transaction that encapsulates a MessageChannel. Useful for implementations that want to subclass the standard

パラメータ:
encapsulatedMessageChannel - Message channel of the transport layer.

createServerTransaction

public SIPServerTransaction createServerTransaction(MessageChannel encapsulatedMessageChannel)
Creates a server transaction that encapsulates a MessageChannel. Useful for implementations that want to subclass the standard

パラメータ:
encapsulatedMessageChannel - Message channel of the transport layer.

createRawMessageChannel

public MessageChannel createRawMessageChannel(javax.sip.address.Hop hop)
                                       throws java.net.UnknownHostException
Creates a raw message channel. A raw message channel has no transaction wrapper.

パラメータ:
hop - -- hop for which to create the raw message channel.
例外:
java.net.UnknownHostException

addTransaction

public void addTransaction(SIPClientTransaction clientTransaction)
Add a new client transaction to the set of existing transactions. Add it to the top of the list so an incoming response has less work to do in order to find the transaction.

パラメータ:
clientTransaction - -- client transaction to add to the set.

addTransaction

public void addTransaction(SIPServerTransaction serverTransaction)
                    throws java.io.IOException
Add a new server transaction to the set of existing transactions. Add it to the top of the list so an incoming ack has less work to do in order to find the transaction.

パラメータ:
serverTransaction - -- server transaction to add to the set.
例外:
java.io.IOException

hasResources

public boolean hasResources()

transactionErrorEvent

public void transactionErrorEvent(SIPTransactionErrorEvent transactionErrorEvent)
Invoked when an error has ocurred with a transaction.

定義:
インタフェース SIPTransactionEventListener 内の transactionErrorEvent
パラメータ:
transactionErrorEvent - Error event.

putPending

public void putPending(PendingRecord pendingRecord)

removePending

public void removePending(PendingRecord pendingRecord)

notifyPendingRecordScanner

public void notifyPendingRecordScanner()

stopStack

public void stopStack()
Stop stack. Clear all the timer stuff.

オーバーライド:
クラス SIPMessageStack 内の stopStack

putPendingTransaction

public void putPendingTransaction(SIPServerTransaction tr)
Put a transaction in the pending transaction list. This is to avoid a race condition when a duplicate may arrive when the application is deciding whether to create a transaction or not.