gov.nist.javax.sip.stack
Class SIPTransaction

java.lang.Object
  extended by gov.nist.javax.sip.stack.MessageChannel
      extended by gov.nist.javax.sip.stack.SIPTransaction
All Implemented Interfaces:
TransactionExt, Serializable, Transaction
Direct Known Subclasses:
SIPClientTransaction, SIPServerTransaction

public abstract class SIPTransaction
extends MessageChannel
implements Transaction, TransactionExt

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.

Version:
1.2 $Revision: 1.100 $ $Date: 2010-12-02 22:04:13 $
Author:
Jeff Keyser, M. Ranganathan
See Also:
Serialized Form

Field Summary
protected  Object applicationData
           
 long auditTag
           
protected  int BASE_TIMER_INTERVAL
           
static TransactionState CALLING_STATE
          CALLING State.
protected  int collectionTime
           
static TransactionState COMPLETED_STATE
          Completed state.
static TransactionState CONFIRMED_STATE
          Confirmed state.
 gov.nist.javax.sip.stack.SIPClientTransaction.ExpiresTimerTask expiresTimerTask
           
static TransactionState INITIAL_STATE
          Initialized but no state assigned.
protected  boolean isMapped
           
protected  SIPResponse lastResponse
           
protected static int MAXIMUM_RETRANSMISSION_TICK_COUNT
          Maximum number of ticks between retransmissions.
protected  String mergeId
           
protected  SIPRequest originalRequest
           
protected  String originalRequestBranch
           
protected  byte[] originalRequestBytes
           
protected  long originalRequestCSeqNumber
           
protected  boolean originalRequestHasPort
           
static TransactionState PROCEEDING_STATE
          Proceeding state.
protected  SIPTransactionStack sipStack
           
protected static int T1
          One timer tick.
protected  int T2
          The maximum retransmit interval for non-INVITE requests and INVITE responses
protected  int T4
          5 sec Maximum duration a message will remain in the network
static TransactionState TERMINATED_STATE
          Terminated state.
protected  int timeoutTimerTicksLeft
           
protected static int TIMER_A
          INVITE request retransmit interval, for UDP only
protected static int TIMER_B
          INVITE transaction timeout timer
protected  int TIMER_D
           
protected static int TIMER_F
           
protected static int TIMER_H
           
protected  int TIMER_I
           
protected static int TIMER_J
           
protected  int TIMER_K
           
protected  boolean toListener
           
protected  String transactionId
           
protected  AtomicBoolean transactionTimerStarted
           
static TransactionState TRYING_STATE
          Trying state.
 
Fields inherited from class gov.nist.javax.sip.stack.MessageChannel
messageProcessor, useCount
 
Constructor Summary
protected SIPTransaction(SIPTransactionStack newParentStack, MessageChannel newEncapsulatedChannel)
          Transaction constructor.
 
Method Summary
 boolean acquireSem()
          A given tx can process only a single outstanding event at a time.
 void addEventListener(SIPTransactionEventListener newListener)
          Adds a new event listener to this transaction.
 void cancelMaxTxLifeTimeTimer()
           
abstract  void cleanUp()
           
 void close()
          Close the encapsulated channel.
protected  void disableRetransmissionTimer()
          Turns off retransmission events for this transaction.
protected  void disableTimeoutTimer()
          Disabled the timeout timer.
 boolean doesCancelMatchTransaction(SIPRequest requestToTest)
          A method that can be used to test if an incoming request belongs to this transction.
protected  void enableRetransmissionTimer()
          Enables retransmission timer events for this transaction to begin in one tick.
protected  void enableRetransmissionTimer(int tickCount)
          Enables retransmission timer events for this transaction to begin after the number of ticks passed to this routine.
protected  void enableTimeoutTimer(int tickCount)
          Enables a timeout event to occur for this transaction after the number of ticks passed to this method.
 List<String> extractCertIdentities()
          Extract identities from certificates exchanged over TLS, based on guidelines from rfc5922.
protected abstract  void fireRetransmissionTimer()
          This method is called when this transaction's retransmission timer has fired.
protected abstract  void fireTimeoutTimer()
          This method is called when this transaction's timeout timer has fired.
 Object getApplicationData()
          Get the application data associated with this transaction.
 String getBranch()
          Gets the current setting for the branch parameter of this transaction.
 String getBranchId()
          Returns a unique branch identifer that identifies this transaction.
 String getCipherSuite()
          Return the Cipher Suite that was used for the SSL handshake.
 long getCSeq()
          Get the Sequence number of the request used to create the transaction.
abstract  Dialog getDialog()
          Gets the dialog object of this Transaction object.
 String getForkId()
          Retrieves the fork id for the transaction.
 String getHost()
          Get the host of this message channel.
 int getInternalState()
          Gets the current state of this transaction.
 String getKey()
          Generate a key which identifies the message channel.
 SIPResponse getLastResponse()
          Get the last response.
 Certificate[] getLocalCertificates()
          Get the certificate(s) that were sent to the peer during handshaking.
 String getMergeId()
           
 MessageChannel getMessageChannel()
          Returns the message channel used for transmitting/receiving messages for this transaction.
 MessageProcessor getMessageProcessor()
          Get the message processor.
 String getMethod()
          Get the method of the request used to create this transaction.
 SIPRequest getOriginalRequest()
          Gets the request being handled by this transaction.
 String getPeerAddress()
          Get the peer address of the machine that sent us this message.
 Certificate[] getPeerCertificates()
           
protected  InetAddress getPeerInetAddress()
           
 InetAddress getPeerPacketSourceAddress()
           
 int getPeerPacketSourcePort()
           
 int getPeerPort()
          Get the sender port ( the port of the other end that sent me the message).
protected  String getPeerProtocol()
           
 int getPort()
          Get port of this message channel.
 Request getRequest()
          Get the original request but cast to a Request structure.
 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.
 SipProviderImpl getSipProvider()
          Return the SipProvider for which the transaction is assigned.
 SIPTransactionStack getSIPStack()
          Get the SIPStack object from this message channel.
 TransactionState getState()
          Gets the current state of this transaction.
 int getTimerD()
          Sets the value of Timer D (in ms)
 int getTimerT2()
          Retrieve the value of Timer T2 (in ms)
 int getTimerT4()
          Retrieve the value of Timer T4 (in ms)
 String getTransactionId()
          Get the transaction Id.
 String getTransport()
          Get transport string of this message channel.
 Via getViaHeader()
          Returns the Via header for this channel.
 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 isDialogCreatingTransaction()
          Returns a flag stating whether this transaction is for a request that creates a dialog.
 boolean isInviteTransaction()
          Returns a flag stating whether this transaction is for an INVITE request or not.
abstract  boolean isMessagePartOfTransaction(SIPMessage messageToTest)
          Tests a message to see if it is part of this transaction.
 boolean isReleaseReferences()
          retrieve the value of release references to know if the stack performs optimizations on cleanup to save on memory
 boolean isReliable()
          Get whether this channel is reliable or not.
 boolean isSecure()
          Return true if this is a secure channel.
protected  boolean isServerTransaction()
          A shortcut way of telling if we are a server transaction.
 boolean isTerminated()
          Tests if this transaction has terminated.
 boolean passToListener()
          Set true to pass the request up to the listener.
protected  void raiseErrorEvent(int errorEventID)
          Creates a SIPTransactionErrorEvent and sends it to all of the listeners of this transaction.
 void raiseIOExceptionEvent()
          Raise an IO Exception event - this is used for reporting asynchronous IO Exceptions that are attributable to this transaction.
 void releaseSem()
          Release the transaction semaphore.
 void removeEventListener(SIPTransactionEventListener oldListener)
          Removed an event listener from this transaction.
protected  void scheduleMaxTxLifeTimeTimer()
           
protected  void semRelease()
           
protected  void sendMessage(byte[] messageBytes, InetAddress receiverAddress, int receiverPort, boolean retry)
          Parse the byte array as a message, process it through the transaction, and send it to the SIP peer.
 void sendMessage(SIPMessage messageToSend)
          Process the message through the transaction and sends it to the SIP peer.
 void setApplicationData(Object applicationData)
          Set the application data pointer.
 void setBranch(String newBranch)
          Sets the Via header branch parameter used to identify this transaction.
abstract  void setDialog(SIPDialog sipDialog, String dialogId)
          set the dialog object.
 void setEncapsulatedChannel(MessageChannel messageChannel)
          Set the encapsuated channel.
 void setForkId(String forkId)
          Sets the fork id for the transaction.
 void setOriginalRequest(SIPRequest newOriginalRequest)
          Sets the request message that this transaction handles.
 void setPassToListener()
          Set the passToListener flag to true.
 void setReleaseReferences(boolean releaseReferences)
          If set to true it will release all references that it no longer needs.
 void setRetransmitTimer(int retransmitTimer)
          Sets the value of the retransmit timer to the newly supplied timer value.
 void setState(int newState)
          Changes the state of this transaction.
 void setTimerD(int interval)
          Sets the value of Timer D (in ms)
 void setTimerT2(int interval)
          Sets the value of Timer T2 (in ms)
 void setTimerT4(int interval)
          Sets the value of Timer T4 (in ms)
protected abstract  void startTransactionTimer()
          Start the timer that runs the transaction state machine.
protected  boolean testAndSetTransactionTerminatedEvent()
          Flag to test if the terminated event is delivered.
 
Methods inherited from class gov.nist.javax.sip.stack.MessageChannel
createBadReqRes, getEncapsulatedClientTransaction, getHostPort, getKey, getKey, getPeerHostPort, getRawIpSourceAddress, getViaHostPort, logMessage, logResponse, sendMessage, sendMessage, setEncapsulatedClientTransaction, uncache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.sip.Transaction
terminate
 

Field Detail

toListener

protected boolean toListener

BASE_TIMER_INTERVAL

protected int BASE_TIMER_INTERVAL

T4

protected int T4
5 sec Maximum duration a message will remain in the network


T2

protected int T2
The maximum retransmit interval for non-INVITE requests and INVITE responses


TIMER_I

protected int TIMER_I

TIMER_K

protected int TIMER_K

TIMER_D

protected int TIMER_D

T1

protected static final int T1
One timer tick.

See Also:
Constant Field Values

TIMER_A

protected static final int TIMER_A
INVITE request retransmit interval, for UDP only

See Also:
Constant Field Values

TIMER_B

protected static final int TIMER_B
INVITE transaction timeout timer

See Also:
Constant Field Values

TIMER_J

protected static final int TIMER_J
See Also:
Constant Field Values

TIMER_F

protected static final int TIMER_F
See Also:
Constant Field Values

TIMER_H

protected static final int TIMER_H
See Also:
Constant Field Values

applicationData

protected transient Object applicationData

lastResponse

protected SIPResponse lastResponse

isMapped

protected boolean isMapped

transactionId

protected String transactionId

auditTag

public long auditTag

INITIAL_STATE

public static final TransactionState INITIAL_STATE
Initialized but no state assigned.


TRYING_STATE

public static final TransactionState TRYING_STATE
Trying state.


CALLING_STATE

public static final TransactionState CALLING_STATE
CALLING State.


PROCEEDING_STATE

public static final TransactionState PROCEEDING_STATE
Proceeding state.


COMPLETED_STATE

public static final TransactionState COMPLETED_STATE
Completed state.


CONFIRMED_STATE

public static final TransactionState CONFIRMED_STATE
Confirmed state.


TERMINATED_STATE

public static final TransactionState TERMINATED_STATE
Terminated state.


MAXIMUM_RETRANSMISSION_TICK_COUNT

protected static final int MAXIMUM_RETRANSMISSION_TICK_COUNT
Maximum number of ticks between retransmissions.

See Also:
Constant Field Values

sipStack

protected transient SIPTransactionStack sipStack

originalRequest

protected SIPRequest originalRequest

originalRequestBytes

protected byte[] originalRequestBytes

originalRequestCSeqNumber

protected long originalRequestCSeqNumber

originalRequestBranch

protected String originalRequestBranch

originalRequestHasPort

protected boolean originalRequestHasPort

transactionTimerStarted

protected AtomicBoolean transactionTimerStarted

timeoutTimerTicksLeft

protected int timeoutTimerTicksLeft

collectionTime

protected int collectionTime

mergeId

protected String mergeId

expiresTimerTask

public gov.nist.javax.sip.stack.SIPClientTransaction.ExpiresTimerTask expiresTimerTask
Constructor Detail

SIPTransaction

protected SIPTransaction(SIPTransactionStack newParentStack,
                         MessageChannel newEncapsulatedChannel)
Transaction constructor.

Parameters:
newParentStack - Parent stack for this transaction.
newEncapsulatedChannel - Underlying channel for this transaction.
Method Detail

getBranchId

public String getBranchId()
Description copied from interface: Transaction
Returns a unique branch identifer that identifies this transaction. The branch identifier is used in the ViaHeader. The uniqueness property of the branch ID parameter to facilitate its use as a transaction ID, was not part of RFC 2543. The branch ID inserted by an element compliant with the RFC3261 specification MUST always begin with the characters "z9hG4bK". These 7 characters are used as a magic cookie, so that servers receiving the request can determine that the branch ID was constructed to be globally unique. The precise format of the branch token is implementation-defined. This method should always return the same branch identifier for the same transaction.

Specified by:
getBranchId in interface Transaction
Returns:
the new branch that uniquely identifies this transaction.

cleanUp

public abstract void cleanUp()

setOriginalRequest

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

Parameters:
newOriginalRequest - Request being handled.

getOriginalRequest

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

Returns:
-- the original Request associated with this transaction.

getRequest

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

Specified by:
getRequest in interface Transaction
Returns:
the request that generated this transaction.

isDialogCreatingTransaction

public final boolean isDialogCreatingTransaction()
Returns a flag stating whether this transaction is for a request that creates a dialog.

Returns:
-- true if this is a request that creates a dialog, false if not.

isInviteTransaction

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

Returns:
-- 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.

Returns:
-- true if the transaciton is a CANCEL transaction.

isByeTransaction

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

Returns:
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.

Returns:
Encapsulated MessageChannel.

setBranch

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

Parameters:
newBranch - New string used as the branch for this transaction.

getBranch

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

Returns:
Branch parameter for this transaction.

getMethod

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

Returns:
the method of the request for the transaction.

getCSeq

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

Returns:
the cseq of the request used to create the transaction.

setState

public void setState(int newState)
Changes the state of this transaction.

Parameters:
newState - New state of this transaction.

getInternalState

public int getInternalState()
Gets the current state of this transaction.

Returns:
Current state of this transaction.

getState

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

Specified by:
getState in interface Transaction
Returns:
Current state of this transaction.

enableRetransmissionTimer

protected final void enableRetransmissionTimer()
Enables retransmission timer events for this transaction to begin in one tick.


enableRetransmissionTimer

protected final void enableRetransmissionTimer(int tickCount)
Enables retransmission timer events for this transaction to begin after the number of ticks passed to this routine.

Parameters:
tickCount - Number of ticks before the next retransmission timer event occurs.

disableRetransmissionTimer

protected final void disableRetransmissionTimer()
Turns off retransmission events for this transaction.


enableTimeoutTimer

protected final void enableTimeoutTimer(int tickCount)
Enables a timeout event to occur for this transaction after the number of ticks passed to this method.

Parameters:
tickCount - Number of ticks before this transaction times out.

disableTimeoutTimer

protected final void disableTimeoutTimer()
Disabled the timeout timer.


isTerminated

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

Returns:
Trus if this transaction is terminated, false if not.

getHost

public String getHost()
Description copied from class: MessageChannel
Get the host of this message channel.

Specified by:
getHost in interface TransactionExt
Overrides:
getHost in class MessageChannel
Returns:
host of this messsage channel.

getKey

public String getKey()
Description copied from class: MessageChannel
Generate a key which identifies the message channel. This allows us to cache the message channel.

Specified by:
getKey in class MessageChannel

getPort

public int getPort()
Description copied from class: MessageChannel
Get port of this message channel.

Specified by:
getPort in interface TransactionExt
Overrides:
getPort in class MessageChannel
Returns:
Port of this message channel.

getSIPStack

public SIPTransactionStack getSIPStack()
Description copied from class: MessageChannel
Get the SIPStack object from this message channel.

Specified by:
getSIPStack in class MessageChannel
Returns:
SIPStack object of this message channel

getPeerAddress

public String getPeerAddress()
Description copied from class: MessageChannel
Get the peer address of the machine that sent us this message.

Specified by:
getPeerAddress in interface TransactionExt
Specified by:
getPeerAddress in class MessageChannel
Returns:
a string contianing the ip address or host name of the sender of the message.

getPeerPort

public int getPeerPort()
Description copied from class: MessageChannel
Get the sender port ( the port of the other end that sent me the message).

Specified by:
getPeerPort in interface TransactionExt
Specified by:
getPeerPort in class MessageChannel
Returns:
the port of the upstream/downstream hop from which this message was initially received

getPeerPacketSourcePort

public int getPeerPacketSourcePort()
Specified by:
getPeerPacketSourcePort in class MessageChannel

getPeerPacketSourceAddress

public InetAddress getPeerPacketSourceAddress()
Specified by:
getPeerPacketSourceAddress in class MessageChannel

getPeerInetAddress

protected InetAddress getPeerInetAddress()
Specified by:
getPeerInetAddress in class MessageChannel

getPeerProtocol

protected String getPeerProtocol()
Specified by:
getPeerProtocol in class MessageChannel

getTransport

public String getTransport()
Description copied from class: MessageChannel
Get transport string of this message channel.

Specified by:
getTransport in interface TransactionExt
Specified by:
getTransport in class MessageChannel
Returns:
Transport string of this message channel.

isReliable

public boolean isReliable()
Description copied from class: MessageChannel
Get whether this channel is reliable or not.

Specified by:
isReliable in class MessageChannel
Returns:
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.

Overrides:
getViaHeader in class MessageChannel
Returns:
a via header for outgoing messages sent from this channel.

sendMessage

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

Specified by:
sendMessage in class MessageChannel
Parameters:
messageToSend - Message to send to the SIP peer.
Throws:
IOException

sendMessage

protected void sendMessage(byte[] messageBytes,
                           InetAddress receiverAddress,
                           int receiverPort,
                           boolean retry)
                    throws IOException
Parse the byte array as a message, process it through the transaction, and send it to the SIP peer. This is just a placeholder method -- calling it will result in an IO exception.

Specified by:
sendMessage in class MessageChannel
Parameters:
messageBytes - Bytes of the message to send.
receiverAddress - Address of the target peer.
receiverPort - Network port of the target peer.
Throws:
IOException - If called.

addEventListener

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

Parameters:
newListener - Listener to add.

removeEventListener

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

Parameters:
oldListener - Listener to remove.

raiseErrorEvent

protected void raiseErrorEvent(int errorEventID)
Creates a SIPTransactionErrorEvent and sends it to all of the listeners of this transaction. This method also flags the transaction as terminated.

Parameters:
errorEventID - ID of the error to raise.

isServerTransaction

protected boolean isServerTransaction()
A shortcut way of telling if we are a server transaction.


getDialog

public abstract 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.

Specified by:
getDialog in interface Transaction
Returns:
the Dialog Object of this Transaction object.
See Also:
Dialog

setDialog

public abstract void setDialog(SIPDialog sipDialog,
                               String dialogId)
set the dialog object.

Parameters:
sipDialog - -- the dialog to set.
dialogId - -- the dialog id ot associate with the dialog.s

getRetransmitTimer

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

Specified by:
getRetransmitTimer in interface Transaction
Returns:
the integer value of the retransmit timer in milliseconds.

getViaHost

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

Specified by:
getViaHost in class MessageChannel

getLastResponse

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

Returns:
the last response received (for client transactions) or sent (for server transactions).

getResponse

public Response getResponse()
Get the JAIN interface response


getTransactionId

public String getTransactionId()
Get the transaction Id.


hashCode

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

Overrides:
hashCode in class Object

getViaPort

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

Specified by:
getViaPort in class MessageChannel

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.

Parameters:
requestToTest - is the request to test.
Returns:
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.

Specified by:
setRetransmitTimer in interface Transaction
Parameters:
retransmitTimer - - the new integer value of the retransmit timer in milliseconds.

close

public void close()
Close the encapsulated channel.

Specified by:
close in class MessageChannel

isSecure

public boolean isSecure()
Description copied from class: MessageChannel
Return true if this is a secure channel.

Specified by:
isSecure in class MessageChannel

getMessageProcessor

public MessageProcessor getMessageProcessor()
Description copied from class: MessageChannel
Get the message processor.

Overrides:
getMessageProcessor in class MessageChannel

setApplicationData

public void setApplicationData(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).

Specified by:
setApplicationData in interface Transaction
Parameters:
applicationData - -- application data pointer to set. null clears the applicationd data pointer.

getApplicationData

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

Specified by:
getApplicationData in interface Transaction
Returns:
stored application data.

setEncapsulatedChannel

public void setEncapsulatedChannel(MessageChannel messageChannel)
Set the encapsuated channel. The peer inet address and port are set equal to the message channel.


getSipProvider

public SipProviderImpl getSipProvider()
Return the SipProvider for which the transaction is assigned.

Specified by:
getSipProvider in interface TransactionExt
Returns:
the SipProvider for the transaction.

raiseIOExceptionEvent

public void raiseIOExceptionEvent()
Raise an IO Exception event - this is used for reporting asynchronous IO Exceptions that are attributable to this transaction.


acquireSem

public boolean acquireSem()
A given tx can process only a single outstanding event at a time. This semaphore gaurds re-entrancy to the transaction.


releaseSem

public void releaseSem()
Release the transaction semaphore.


semRelease

protected void semRelease()

passToListener

public boolean passToListener()
Set true to pass the request up to the listener. False otherwise.


setPassToListener

public void setPassToListener()
Set the passToListener flag to true.


testAndSetTransactionTerminatedEvent

protected boolean testAndSetTransactionTerminatedEvent()
Flag to test if the terminated event is delivered.

Returns:

getCipherSuite

public String getCipherSuite()
                      throws UnsupportedOperationException
Description copied from interface: TransactionExt
Return the Cipher Suite that was used for the SSL handshake.

Specified by:
getCipherSuite in interface TransactionExt
Returns:
Returns the cipher suite in use by the session which was produced by the handshake.
Throws:
UnsupportedOperationException

getLocalCertificates

public Certificate[] getLocalCertificates()
                                   throws UnsupportedOperationException
Description copied from interface: TransactionExt
Get the certificate(s) that were sent to the peer during handshaking.

Specified by:
getLocalCertificates in interface TransactionExt
Returns:
the certificate(s) that were sent to the peer during handshaking.
Throws:
UnsupportedOperationException

getPeerCertificates

public Certificate[] getPeerCertificates()
                                  throws SSLPeerUnverifiedException
Specified by:
getPeerCertificates in interface TransactionExt
Returns:
the identity of the peer which was identified as part of defining the session.
Throws:
SSLPeerUnverifiedException

extractCertIdentities

public List<String> extractCertIdentities()
                                   throws SSLPeerUnverifiedException
Extract identities from certificates exchanged over TLS, based on guidelines from rfc5922.

Specified by:
extractCertIdentities in interface TransactionExt
Returns:
list of authenticated identities
Throws:
SSLPeerUnverifiedException

startTransactionTimer

protected abstract void startTransactionTimer()
Start the timer that runs the transaction state machine.


isMessagePartOfTransaction

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

Returns:
True if the message is part of this transaction, false if not.

fireRetransmissionTimer

protected abstract void fireRetransmissionTimer()
This method is called when this transaction's retransmission timer has fired.


fireTimeoutTimer

protected abstract void fireTimeoutTimer()
This method is called when this transaction's timeout timer has fired.


isReleaseReferences

public boolean isReleaseReferences()
Description copied from interface: TransactionExt
retrieve the value of release references to know if the stack performs optimizations on cleanup to save on memory

Specified by:
isReleaseReferences in interface TransactionExt
Returns:
release references value

setReleaseReferences

public void setReleaseReferences(boolean releaseReferences)
Description copied from interface: TransactionExt
If set to true it will release all references that it no longer needs. This will include the reference to the Request, Response, Dialogs, Any unused timers etc. This will significantly reduce memory consumption under high load

Specified by:
setReleaseReferences in interface TransactionExt

getTimerD

public int getTimerD()
Description copied from interface: TransactionExt
Sets the value of Timer D (in ms)

Specified by:
getTimerD in interface TransactionExt

getTimerT2

public int getTimerT2()
Description copied from interface: TransactionExt
Retrieve the value of Timer T2 (in ms)

Specified by:
getTimerT2 in interface TransactionExt
Returns:
T2 value (in ms)

getTimerT4

public int getTimerT4()
Description copied from interface: TransactionExt
Retrieve the value of Timer T4 (in ms)

Specified by:
getTimerT4 in interface TransactionExt
Returns:
T4 value (in ms)

setTimerD

public void setTimerD(int interval)
Description copied from interface: TransactionExt
Sets the value of Timer D (in ms)

Specified by:
setTimerD in interface TransactionExt
Parameters:
interval - value of Timer D (in ms)

setTimerT2

public void setTimerT2(int interval)
Description copied from interface: TransactionExt
Sets the value of Timer T2 (in ms)

Specified by:
setTimerT2 in interface TransactionExt
Parameters:
interval - value of Timer T2 (in ms)

setTimerT4

public void setTimerT4(int interval)
Description copied from interface: TransactionExt
Sets the value of Timer T4 (in ms)

Specified by:
setTimerT4 in interface TransactionExt
Parameters:
interval - value of Timer T4 (in ms)

setForkId

public void setForkId(String forkId)
Sets the fork id for the transaction.

Parameters:
forkId -

getForkId

public String getForkId()
Retrieves the fork id for the transaction.

Returns:

scheduleMaxTxLifeTimeTimer

protected void scheduleMaxTxLifeTimeTimer()

cancelMaxTxLifeTimeTimer

public void cancelMaxTxLifeTimeTimer()

getMergeId

public String getMergeId()
Returns:
the mergeId


Copyright © 2012. All Rights Reserved.