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

java.lang.Object
  上位を拡張 gov.nist.javax.sip.stack.MessageChannel
      上位を拡張 gov.nist.javax.sip.stack.SIPTransaction
すべての実装されたインタフェース:
java.io.Serializable, javax.sip.Transaction
直系の既知のサブクラス:
SIPClientTransaction, SIPServerTransaction

public abstract class SIPTransaction
extends MessageChannel
implements javax.sip.Transaction

Abstract class to support both client and server transactions. Provides an encapsulation of a message channel, handles timer events, and creation of the Via header for a message.

バージョン:
JAIN-SIP-1.1 $Revision: 1.32 $ $Date: 2004/10/04 16:03:53 $
作成者:
Jeff Keyser, M. Ranganathan (modified Jeff's original source and aligned with JAIN-SIP 1.1)
関連項目:
直列化された形式

フィールドの概要
static javax.sip.TransactionState CALLING_STATE
          CALLING State.
static javax.sip.TransactionState COMPLETED_STATE
          Completed state.
static javax.sip.TransactionState CONFIRMED_STATE
          Confirmed state.
static javax.sip.TransactionState INITIAL_STATE
          Initialized but no state assigned.
static javax.sip.TransactionState PROCEEDING_STATE
          Proceeding state.
static javax.sip.TransactionState TERMINATED_STATE
          Terminated state.
static javax.sip.TransactionState TRYING_STATE
          Trying state.
 
メソッドの概要
 boolean ackSeen()
          This is book-keeping for retransmission filter management.
 void addEventListener(SIPTransactionEventListener newListener)
          Adds a new event listener to this transaction.
 void close()
          Close the encapsulated channel.
 boolean doesCancelMatchTransaction(SIPRequest requestToTest)
          A method that can be used to test if an incoming request belongs to this transction.
 java.lang.Object getApplicationData()
          Get the application data associated with this transaction.
 java.lang.String getBranch()
          Gets the current setting for the branch parameter of this transaction.
 java.lang.String getBranchId()
           
 int getCSeq()
          Get the Sequence number of the request used to create the transaction.
 javax.sip.Dialog getDialog()
          Gets the dialog object of this Transaction object.
 java.lang.String getHost()
          Get the host of this message channel.
 java.lang.String getKey()
          Generate a key which identifies the message channel.
 SIPResponse getLastResponse()
          Get the last response.
 MessageChannel getMessageChannel()
          Returns the message channel used for transmitting/receiving messages for this transaction.
 MessageProcessor getMessageProcessor()
          Get the message processor.
 java.lang.String getMethod()
          Get the method of the request used to create this transaction.
 SIPRequest getOriginalRequest()
          Gets the request being handled by this transaction.
 java.lang.String getPeerAddress()
          Get the peer address of the machine that sent us this message.
 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.
 javax.sip.message.Request getRequest()
          Get the original request but cast to a Request structure.
 javax.sip.message.Response getResponse()
          Get the JAIN interface response
 int getRetransmitTimer()
          Returns the current value of the retransmit timer in milliseconds used to retransmit messages over unreliable transports.
 SIPMessageStack getSIPStack()
          Get the SIPStack object from this message channel.
 javax.sip.TransactionState getState()
          Gets the current state of this transaction.
 java.lang.String getTransactionId()
          Get the transaction Id.
 java.lang.String getTransport()
          Get transport string of this message channel.
 Via getViaHeader()
          Returns the Via header for this channel.
 java.lang.String getViaHost()
          Get the host to assign for an outgoing Request via header.
 int getViaPort()
          Get the port to assign for the via header of an outgoing message.
 int hashCode()
          Hashcode method for fast hashtable lookup.
 boolean isByeTransaction()
          Return a flag that states if this is a BYE transaction.
 boolean isCancelTransaction()
          Return true if the transaction corresponds to a CANCEL message.
 boolean isInviteTransaction()
          Returns a flag stating whether this transaction is for an INVITE request or not.
 boolean isMatch(SIPTransaction txn)
           
abstract  boolean isMessagePartOfTransaction(SIPMessage messageToTest)
          Tests a message to see if it is part of this transaction.
 boolean isReliable()
          Get whether this channel is reliable or not.
 boolean isSecure()
          Return true if this is a secure channel.
 boolean isTerminated()
          Tests if this transaction has terminated.
abstract  void processPending()
           
 void removeEventListener(SIPTransactionEventListener oldListener)
          Removed an event listener from this transaction.
 void sendMessage(SIPMessage messageToSend)
          Process the message through the transaction and sends it to the SIP peer.
 void setAckSeen()
          This is book-keeping for retransmission filter management.
 void setApplicationData(java.lang.Object applicationData)
          Set the application data pointer.
 void setBranch(java.lang.String newBranch)
          Sets the Via header branch parameter used to identify this transaction.
 void setDialog(SIPDialog dialog)
          set the dialog object.
 void setEventPending()
          Mark that there is a pending event for this transaction.
 void setOriginalRequest(SIPRequest newOriginalRequest)
          Sets the request message that this transaction handles.
 void setRetransmitTimer(int retransmitTimer)
          Sets the value of the retransmit timer to the newly supplied timer value.
 void setState(javax.sip.TransactionState newState)
          Changes the state of this transaction.
 
クラス gov.nist.javax.sip.stack.MessageChannel から継承されたメソッド
getHostPort, getKey, getKey, getPeerHostPort, getRawIpSourceAddress, getViaHostPort, logResponse, sendMessage
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

INITIAL_STATE

public static final javax.sip.TransactionState INITIAL_STATE
Initialized but no state assigned.


TRYING_STATE

public static final javax.sip.TransactionState TRYING_STATE
Trying state.


CALLING_STATE

public static final javax.sip.TransactionState CALLING_STATE
CALLING State.


PROCEEDING_STATE

public static final javax.sip.TransactionState PROCEEDING_STATE
Proceeding state.


COMPLETED_STATE

public static final javax.sip.TransactionState COMPLETED_STATE
Completed state.


CONFIRMED_STATE

public static final javax.sip.TransactionState CONFIRMED_STATE
Confirmed state.


TERMINATED_STATE

public static final javax.sip.TransactionState TERMINATED_STATE
Terminated state.

メソッドの詳細

getBranchId

public java.lang.String getBranchId()
定義:
インタフェース javax.sip.Transaction 内の getBranchId

setOriginalRequest

public void setOriginalRequest(SIPRequest newOriginalRequest)
Sets the request message that this transaction handles.

パラメータ:
newOriginalRequest - Request being handled.

getOriginalRequest

public SIPRequest getOriginalRequest()
Gets the request being handled by this transaction.

戻り値:
Request being handled.

getRequest

public javax.sip.message.Request getRequest()
Get the original request but cast to a Request structure.

定義:
インタフェース javax.sip.Transaction 内の getRequest
戻り値:
the request that generated this transaction.

isInviteTransaction

public final boolean isInviteTransaction()
Returns a flag stating whether this transaction is for an INVITE request or not.

戻り値:
True if this is an INVITE request, false if not.

isCancelTransaction

public final boolean isCancelTransaction()
Return true if the transaction corresponds to a CANCEL message.

戻り値:
true if the transaciton is a CANCEL transaction.

isByeTransaction

public final boolean isByeTransaction()
Return a flag that states if this is a BYE transaction.

戻り値:
true if the transaciton is a BYE transaction.

getMessageChannel

public MessageChannel getMessageChannel()
Returns the message channel used for transmitting/receiving messages for this transaction. Made public in support of JAIN dual transaction model.

戻り値:
Encapsulated MessageChannel.

setBranch

public final void setBranch(java.lang.String newBranch)
Sets the Via header branch parameter used to identify this transaction.

パラメータ:
newBranch - New string used as the branch for this transaction.

getBranch

public final java.lang.String getBranch()
Gets the current setting for the branch parameter of this transaction.

戻り値:
Branch parameter for this transaction.

getMethod

public final java.lang.String getMethod()
Get the method of the request used to create this transaction.

戻り値:
the method of the request for the transaction.

getCSeq

public final int getCSeq()
Get the Sequence number of the request used to create the transaction.

戻り値:
the cseq of the request used to create the transaction.

setState

public void setState(javax.sip.TransactionState newState)
Changes the state of this transaction.

パラメータ:
newState - New state of this transaction.

getState

public javax.sip.TransactionState getState()
Gets the current state of this transaction.

定義:
インタフェース javax.sip.Transaction 内の getState
戻り値:
Current state of this transaction.

isMessagePartOfTransaction

public abstract boolean isMessagePartOfTransaction(SIPMessage messageToTest)
Tests a message to see if it is part of this transaction.

戻り値:
True if the message is part of this transaction, false if not.

isTerminated

public final boolean isTerminated()
Tests if this transaction has terminated.

戻り値:
Trus if this transaction is terminated, false if not.

getHost

public java.lang.String getHost()
クラス MessageChannel の記述:
Get the host of this message channel.

オーバーライド:
クラス MessageChannel 内の getHost
戻り値:
host of this messsage channel.

getKey

public java.lang.String getKey()
クラス MessageChannel の記述:
Generate a key which identifies the message channel. This allows us to cache the message channel.

定義:
クラス MessageChannel 内の getKey

getPort

public int getPort()
クラス MessageChannel の記述:
Get port of this message channel.

オーバーライド:
クラス MessageChannel 内の getPort
戻り値:
Port of this message channel.

getSIPStack

public SIPMessageStack getSIPStack()
クラス MessageChannel の記述:
Get the SIPStack object from this message channel.

定義:
クラス MessageChannel 内の getSIPStack
戻り値:
SIPStack object of this message channel

getPeerAddress

public java.lang.String getPeerAddress()
クラス MessageChannel の記述:
Get the peer address of the machine that sent us this message.

定義:
クラス MessageChannel 内の getPeerAddress
戻り値:
a string contianing the ip address or host name of the sender of the message.

getPeerPort

public int getPeerPort()
クラス MessageChannel の記述:
Get the sender port ( the port of the other end that sent me the message).

定義:
クラス MessageChannel 内の getPeerPort

getTransport

public java.lang.String getTransport()
クラス MessageChannel の記述:
Get transport string of this message channel.

定義:
クラス MessageChannel 内の getTransport
戻り値:
Transport string of this message channel.

isReliable

public boolean isReliable()
クラス MessageChannel の記述:
Get whether this channel is reliable or not.

定義:
クラス MessageChannel 内の isReliable
戻り値:
True if reliable, false if not.

getViaHeader

public Via getViaHeader()
Returns the Via header for this channel. Gets the Via header of the underlying message channel, and adds a branch parameter to it for this transaction.

オーバーライド:
クラス MessageChannel 内の getViaHeader
戻り値:
a via header for outgoing messages sent from this channel.

sendMessage

public void sendMessage(SIPMessage messageToSend)
                 throws java.io.IOException
Process the message through the transaction and sends it to the SIP peer.

定義:
クラス MessageChannel 内の sendMessage
パラメータ:
messageToSend - Message to send to the SIP peer.
例外:
java.io.IOException

addEventListener

public void addEventListener(SIPTransactionEventListener newListener)
Adds a new event listener to this transaction.

パラメータ:
newListener - Listener to add.

removeEventListener

public void removeEventListener(SIPTransactionEventListener oldListener)
Removed an event listener from this transaction.

パラメータ:
oldListener - Listener to remove.

getDialog

public javax.sip.Dialog getDialog()
Gets the dialog object of this Transaction object. This object returns null if no dialog exists. A dialog only exists for a transaction when a session is setup between a User Agent Client and a User Agent Server, either by a 1xx Provisional Response for an early dialog or a 200OK Response for a committed dialog.

定義:
インタフェース javax.sip.Transaction 内の getDialog
戻り値:
the Dialog Object of this Transaction object.
関連項目:
Dialog

setDialog

public void setDialog(SIPDialog dialog)
set the dialog object.

パラメータ:
dialog - -- the dialog to set.

getRetransmitTimer

public int getRetransmitTimer()
Returns the current value of the retransmit timer in milliseconds used to retransmit messages over unreliable transports.

定義:
インタフェース javax.sip.Transaction 内の getRetransmitTimer
戻り値:
the integer value of the retransmit timer in milliseconds.

getViaHost

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

定義:
クラス MessageChannel 内の getViaHost

getLastResponse

public SIPResponse getLastResponse()
Get the last response. This is used internally by the implementation. Dont rely on it.

戻り値:
the last response received (for client transactions) or sent (for server transactions).

getResponse

public javax.sip.message.Response getResponse()
Get the JAIN interface response


getTransactionId

public java.lang.String getTransactionId()
Get the transaction Id.


hashCode

public int hashCode()
Hashcode method for fast hashtable lookup.

オーバーライド:
クラス java.lang.Object 内の hashCode

getViaPort

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

定義:
クラス MessageChannel 内の getViaPort

doesCancelMatchTransaction

public boolean doesCancelMatchTransaction(SIPRequest requestToTest)
A method that can be used to test if an incoming request belongs to this transction. This does not take the transaction state into account when doing the check otherwise it is identical to isMessagePartOfTransaction. This is useful for checking if a CANCEL belongs to this transaction.

パラメータ:
requestToTest - is the request to test.
戻り値:
true if the the request belongs to the transaction.

setRetransmitTimer

public void setRetransmitTimer(int retransmitTimer)
Sets the value of the retransmit timer to the newly supplied timer value. The retransmit timer is expressed in milliseconds and its default value is 500ms. This method allows the application to change the transaction retransmit behavior for different networks. Take the gateway proxy as an example. The internal intranet is likely to be reatively uncongested and the endpoints will be relatively close. The external network is the general Internet. This functionality allows different retransmit times for either side.

定義:
インタフェース javax.sip.Transaction 内の setRetransmitTimer
パラメータ:
retransmitTimer - - the new integer value of the retransmit timer in milliseconds.

close

public void close()
Close the encapsulated channel.

定義:
クラス MessageChannel 内の close

isSecure

public boolean isSecure()
クラス MessageChannel の記述:
Return true if this is a secure channel.

定義:
クラス MessageChannel 内の isSecure

getMessageProcessor

public MessageProcessor getMessageProcessor()
クラス MessageChannel の記述:
Get the message processor.

オーバーライド:
クラス MessageChannel 内の getMessageProcessor

setAckSeen

public void setAckSeen()
This is book-keeping for retransmission filter management.


ackSeen

public boolean ackSeen()
This is book-keeping for retransmission filter management.


setEventPending

public void setEventPending()
Mark that there is a pending event for this transaction.


setApplicationData

public void setApplicationData(java.lang.Object applicationData)
Set the application data pointer. This is un-interpreted by the stack. This is provided as a conveniant way of keeping book-keeping data for applications. Note that null clears the application data pointer (releases it).

パラメータ:
applicationData - -- application data pointer to set. null clears the applicationd data pointer.

getApplicationData

public java.lang.Object getApplicationData()
Get the application data associated with this transaction.

戻り値:
stored application data.

isMatch

public boolean isMatch(SIPTransaction txn)

processPending

public abstract void processPending()