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: JAIN-SIP-1.1
applicationData Object representing the connection being held by the JSR180
Implementation It can be either a SipClientConnection in case
of a ClientTransaction or a SipConnectionNotifier in case of a
ServerTransaction.
doesCancelMatchTransaction(Request requestToHeaderTest) A method that can be used to test if an incoming request
belongs to this transction.
final protected void
enableRetransmissionTimer() Enables retransmission timer events for this transaction to begin in
one tick.
final protected void
enableRetransmissionTimer(int tickCount) Enables retransmission timer events for this
transaction to begin after the number of ticks passed to
this routine.
final protected void
enableTimeoutTimer(int tickCount) Enables a timeout event to occur for this transaction after the number
of ticks passed to this method.
abstractprotected void
fireRetransmissionTimer() This method is called when this transaction's
retransmission timer has fired.
abstractprotected void
fireTimeoutTimer() This method is called when this transaction's
timeout timer has fired.
sendMessage(Message messageToHeaderSend) Processes the message through the transaction and sends it to the SIP
peer.
protected void
sendMessage(byte[] messageBytes, String receiverAddress, int receiverPort) Parses the byte array as a message, process it through the
transaction, and send it to the SIP peer.
setApplicationData(Object newApplicationData) Sets the application data.
Parameters: newApplicationData - Object representing the connection being heldby the JSR180Implementation.
final public void
setBranch(String newBranch) Sets the Via header branch parameter used to identify
this transaction.
Object representing the connection being held by the JSR180
Implementation It can be either a SipClientConnection in case
of a ClientTransaction or a SipConnectionNotifier in case of a
ServerTransaction.
Transaction constructor.
Parameters: newParentStack - Parent stack for this transaction. Parameters: newEncapsulatedChannel - Underlying channel for this transaction.
public boolean doesCancelMatchTransaction(Request requestToHeaderTest)(Code)
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: requestToHeaderTest - is the request to test. true if the the request belongs to the transaction.
enableRetransmissionTimer
final protected void enableRetransmissionTimer()(Code)
Enables retransmission timer events for this transaction to begin in
one tick.
enableRetransmissionTimer
final protected void enableRetransmissionTimer(int tickCount)(Code)
Enables retransmission timer events for this
transaction to begin after the number of ticks passed to
this routine.
Parameters: tickCount - Number of ticks before thenext retransmission timerevent occurs.
enableTimeoutTimer
final protected void enableTimeoutTimer(int tickCount)(Code)
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.
Retrieves the application data.
Object representing the connection being held by the JSR180Implementation. It can be either a SipClientConnection in case of aClientTransaction or a SipConnectionNotifier in case of aServerTransaction
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.
the Dialog Object of this Transaction object. See Also:Dialog
Returns the message channel used for
transmitting/receiving messages
for this transaction. Made public in support of JAIN dual
transaction model.
Encapsulated MessageChannel.
Returns the current value of the retransmit timer in
milliseconds used to retransmit messages over unreliable transports.
the integer value of the retransmit timer in milliseconds.
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.
the via header
Tests a message to see if it is part of this transaction.
Parameters: messageToHeaderTest - message to be processed True if the message is part of thistransaction, false if not.
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.
Processes the message through the transaction and sends it to the SIP
peer.
Parameters: messageToHeaderSend - Message to send to the SIP peer.
sendMessage
protected void sendMessage(byte[] messageBytes, String receiverAddress, int receiverPort) throws IOException(Code)
Parses the byte array as a message, process it through the
transaction, and send it to the SIP peer.
Parameters: messageBytes - Bytes of the message to send. Parameters: receiverAddress - Address of the target peer. Parameters: receiverPort - Network port of the target peer. throws: IOException - If there is an error parsingthe byte array into an object.
public void setApplicationData(Object newApplicationData)(Code)
Sets the application data.
Parameters: newApplicationData - Object representing the connection being heldby the JSR180Implementation. It can be either a SipClientConnection in case of aClientTransaction or a SipConnectionNotifier in case of aServerTransaction
setBranch
final public void setBranch(String newBranch)(Code)
Sets the Via header branch parameter used to identify
this transaction.
Parameters: newBranch - New string used as the branchfor this transaction.