org.lastbamboo.common.sip.stack.transaction.client
Class SipClientTransactionImpl

java.lang.Object
  extended by org.lastbamboo.common.sip.stack.transaction.client.SipClientTransactionImpl
All Implemented Interfaces:
SipMessageVisitor, SipClientTransaction

public class SipClientTransactionImpl
extends Object
implements SipClientTransaction

Implementation of a SIP client transaction.


Constructor Summary
SipClientTransactionImpl(SipMessage request, List<org.lastbamboo.common.offer.answer.OfferAnswerTransactionListener> transactionListeners, SipMessageFactory messageFactory, Timer timer, int t1)
          Creates a new SIP client transaction.
 
Method Summary
 void addListener(org.lastbamboo.common.offer.answer.OfferAnswerTransactionListener listener)
          Adds a listener to the transaction.
 SipMessage getRequest()
          Accessor for the request that started the transaction.
 long getTransactionTime()
          Accessor for the total transaction time for the transaction.
 void visitDoubleCrlfKeepAlive(DoubleCrlfKeepAlive keepAlive)
          Visits a double CRLF keep alive message, as specified at:
 void visitInvite(Invite invite)
          Visits an INVITE request.
 void visitRegister(Register register)
          Visits a REGISTER request.
 void visitRequestTimedOut(RequestTimeoutResponse response)
          Visits a 408 Request Timeout response.
 void visitResponse(SipResponse response)
          Visits a response message.
 void visitUnknownRequest(UnknownSipRequest request)
          Visits a request we do not recognize.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SipClientTransactionImpl

public SipClientTransactionImpl(SipMessage request,
                                List<org.lastbamboo.common.offer.answer.OfferAnswerTransactionListener> transactionListeners,
                                SipMessageFactory messageFactory,
                                Timer timer,
                                int t1)
Creates a new SIP client transaction.

Parameters:
request - The request starting the transaction.
transactionListeners - The listeners for transaction events.
messageFactory - The factory for creating SIP messages.
timer - The timer to add timer B tasks to.
t1 - The value to use for T1, as specified in RFC 3261 section 17.1.1.2 on page 126. T1 is multiplied by 64 to give the timeout for transactions. The default value is 500, but this can be modified for testing, for example.
Method Detail

addListener

public void addListener(org.lastbamboo.common.offer.answer.OfferAnswerTransactionListener listener)
Description copied from interface: SipClientTransaction
Adds a listener to the transaction. This should typically be called before any message has been sent -- before the transaction has started -- to ensure events aren't missed.

Specified by:
addListener in interface SipClientTransaction
Parameters:
listener - The listener to add.

getRequest

public SipMessage getRequest()
Description copied from interface: SipClientTransaction
Accessor for the request that started the transaction.

Specified by:
getRequest in interface SipClientTransaction
Returns:
The request that started the transaction.

getTransactionTime

public long getTransactionTime()
Description copied from interface: SipClientTransaction
Accessor for the total transaction time for the transaction.

Specified by:
getTransactionTime in interface SipClientTransaction
Returns:
The total time the transaction took.

visitResponse

public void visitResponse(SipResponse response)
Description copied from interface: SipMessageVisitor
Visits a response message.

Specified by:
visitResponse in interface SipMessageVisitor
Parameters:
response - The response.

visitRequestTimedOut

public void visitRequestTimedOut(RequestTimeoutResponse response)
Description copied from interface: SipMessageVisitor
Visits a 408 Request Timeout response.

Specified by:
visitRequestTimedOut in interface SipMessageVisitor
Parameters:
response - The 408 Request Timeout response.

visitInvite

public void visitInvite(Invite invite)
Description copied from interface: SipMessageVisitor
Visits an INVITE request.

Specified by:
visitInvite in interface SipMessageVisitor
Parameters:
invite - The INVITE message.

visitRegister

public void visitRegister(Register register)
Description copied from interface: SipMessageVisitor
Visits a REGISTER request.

Specified by:
visitRegister in interface SipMessageVisitor
Parameters:
register - The REGISTER request.

visitUnknownRequest

public void visitUnknownRequest(UnknownSipRequest request)
Description copied from interface: SipMessageVisitor
Visits a request we do not recognize.

Specified by:
visitUnknownRequest in interface SipMessageVisitor
Parameters:
request - A request we do not recognize.

visitDoubleCrlfKeepAlive

public void visitDoubleCrlfKeepAlive(DoubleCrlfKeepAlive keepAlive)
Description copied from interface: SipMessageVisitor
Visits a double CRLF keep alive message, as specified at:

http://www.ietf.org/internet-drafts/draft-ietf-sip-outbound-08.txt

Specified by:
visitDoubleCrlfKeepAlive in interface SipMessageVisitor
Parameters:
keepAlive - The keep alive message.


Copyright © 2013 LittleShoot. All Rights Reserved.