org.mobicents.slee.resource.sip.wrappers
Class DialogWrapper

java.lang.Object
  extended by org.mobicents.slee.resource.sip.wrappers.DialogWrapper
All Implemented Interfaces:
java.io.Serializable, javax.sip.Dialog

public class DialogWrapper
extends java.lang.Object
implements javax.sip.Dialog

Wraps SIP Dialog.

Author:
M. Ranganathan, B. Baranowski, eduardomartins
See Also:
Serialized Form

Field Summary
protected  javax.sip.Dialog realDialog
           
 
Constructor Summary
DialogWrapper(javax.sip.Dialog realDialog, SipResourceAdaptor sipResourceAdaptor)
           
 
Method Summary
 boolean cancel()
          Cancels session timer.
 javax.sip.message.Request createAck(long arg0)
           
 javax.sip.message.Request createPrack(javax.sip.message.Response arg0)
           
 javax.sip.message.Response createReliableProvisionalResponse(int arg0)
           
 javax.sip.message.Request createRequest(java.lang.String arg0)
           
 void delete()
           
 void endStateEventFireSequence()
           
protected  void finalize()
           
 boolean fireDialogStateEvent(javax.sip.message.Response response)
          Checks if state event for dialog should be fired.
 SipActivityHandle getActivityHandle()
           
 java.lang.Object getApplicationData()
           
 javax.sip.header.CallIdHeader getCallId()
           
 java.lang.String getDialogId()
           
 javax.sip.Transaction getFirstTransaction()
           
 boolean getHasTimedOut()
           
 org.mobicents.slee.container.component.ComponentKey getKeyFor1_2DialogState(java.lang.String method, javax.sip.message.Response response)
           
 javax.sip.DialogState getLastState()
           
 javax.sip.address.Address getLocalParty()
           
 long getLocalSeqNumber()
           
 int getLocalSequenceNumber()
           
 java.lang.String getLocalTag()
           
 javax.sip.Dialog getRealDialog()
           
 javax.sip.address.Address getRemoteParty()
           
 long getRemoteSeqNumber()
           
 int getRemoteSequenceNumber()
           
 java.lang.String getRemoteTag()
           
 javax.sip.address.Address getRemoteTarget()
           
 java.util.Iterator getRouteSet()
           
 javax.sip.DialogState getState()
           
 boolean getTerminateOnBye()
           
 boolean hasBeenCanceled()
           
 void incrementLocalSequenceNumber()
           
 boolean isInStateEventFireSequence()
           
 boolean isSecure()
           
 boolean isServer()
           
 void renew()
          Renews Session timer - resets ETA of dialog timeout event.
 void sendAck(javax.sip.message.Request arg0)
           
 void sendReliableProvisionalResponse(javax.sip.message.Response arg0)
           
 void sendRequest(javax.sip.ClientTransaction clientTransaction)
           
 void setApplicationData(java.lang.Object applicaionData)
           
static void setDialogTimeout(long timeout)
           
 void setHasTimedOut()
           
 void setLastState(javax.sip.DialogState lastState)
           
 void startStateEventFireSequence()
           
 void terminateOnBye(boolean terminate)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

realDialog

protected javax.sip.Dialog realDialog
Constructor Detail

DialogWrapper

public DialogWrapper(javax.sip.Dialog realDialog,
                     SipResourceAdaptor sipResourceAdaptor)
Method Detail

getRealDialog

public javax.sip.Dialog getRealDialog()

getLocalParty

public javax.sip.address.Address getLocalParty()
Specified by:
getLocalParty in interface javax.sip.Dialog

getRemoteParty

public javax.sip.address.Address getRemoteParty()
Specified by:
getRemoteParty in interface javax.sip.Dialog

getRemoteTarget

public javax.sip.address.Address getRemoteTarget()
Specified by:
getRemoteTarget in interface javax.sip.Dialog

getDialogId

public java.lang.String getDialogId()
Specified by:
getDialogId in interface javax.sip.Dialog

getCallId

public javax.sip.header.CallIdHeader getCallId()
Specified by:
getCallId in interface javax.sip.Dialog

getLocalSequenceNumber

public int getLocalSequenceNumber()
Specified by:
getLocalSequenceNumber in interface javax.sip.Dialog

getRemoteSequenceNumber

public int getRemoteSequenceNumber()
Specified by:
getRemoteSequenceNumber in interface javax.sip.Dialog

getLocalSeqNumber

public long getLocalSeqNumber()
Specified by:
getLocalSeqNumber in interface javax.sip.Dialog

getRemoteSeqNumber

public long getRemoteSeqNumber()
Specified by:
getRemoteSeqNumber in interface javax.sip.Dialog

getRouteSet

public java.util.Iterator getRouteSet()
Specified by:
getRouteSet in interface javax.sip.Dialog

isSecure

public boolean isSecure()
Specified by:
isSecure in interface javax.sip.Dialog

isServer

public boolean isServer()
Specified by:
isServer in interface javax.sip.Dialog

incrementLocalSequenceNumber

public void incrementLocalSequenceNumber()
Specified by:
incrementLocalSequenceNumber in interface javax.sip.Dialog

createRequest

public javax.sip.message.Request createRequest(java.lang.String arg0)
                                        throws javax.sip.SipException
Specified by:
createRequest in interface javax.sip.Dialog
Throws:
javax.sip.SipException

createReliableProvisionalResponse

public javax.sip.message.Response createReliableProvisionalResponse(int arg0)
                                                             throws javax.sip.InvalidArgumentException,
                                                                    javax.sip.SipException
Specified by:
createReliableProvisionalResponse in interface javax.sip.Dialog
Throws:
javax.sip.InvalidArgumentException
javax.sip.SipException

sendRequest

public void sendRequest(javax.sip.ClientTransaction clientTransaction)
                 throws javax.sip.TransactionDoesNotExistException,
                        javax.sip.SipException
Specified by:
sendRequest in interface javax.sip.Dialog
Throws:
javax.sip.TransactionDoesNotExistException
javax.sip.SipException

sendReliableProvisionalResponse

public void sendReliableProvisionalResponse(javax.sip.message.Response arg0)
                                     throws javax.sip.SipException
Specified by:
sendReliableProvisionalResponse in interface javax.sip.Dialog
Throws:
javax.sip.SipException

createPrack

public javax.sip.message.Request createPrack(javax.sip.message.Response arg0)
                                      throws javax.sip.DialogDoesNotExistException,
                                             javax.sip.SipException
Specified by:
createPrack in interface javax.sip.Dialog
Throws:
javax.sip.DialogDoesNotExistException
javax.sip.SipException

createAck

public javax.sip.message.Request createAck(long arg0)
                                    throws javax.sip.InvalidArgumentException,
                                           javax.sip.SipException
Specified by:
createAck in interface javax.sip.Dialog
Throws:
javax.sip.InvalidArgumentException
javax.sip.SipException

sendAck

public void sendAck(javax.sip.message.Request arg0)
             throws javax.sip.SipException
Specified by:
sendAck in interface javax.sip.Dialog
Throws:
javax.sip.SipException

getState

public javax.sip.DialogState getState()
Specified by:
getState in interface javax.sip.Dialog

delete

public void delete()
Specified by:
delete in interface javax.sip.Dialog

getFirstTransaction

public javax.sip.Transaction getFirstTransaction()
Specified by:
getFirstTransaction in interface javax.sip.Dialog

getLocalTag

public java.lang.String getLocalTag()
Specified by:
getLocalTag in interface javax.sip.Dialog

getRemoteTag

public java.lang.String getRemoteTag()
Specified by:
getRemoteTag in interface javax.sip.Dialog

setApplicationData

public void setApplicationData(java.lang.Object applicaionData)
Specified by:
setApplicationData in interface javax.sip.Dialog

getApplicationData

public java.lang.Object getApplicationData()
Specified by:
getApplicationData in interface javax.sip.Dialog

terminateOnBye

public void terminateOnBye(boolean terminate)
                    throws javax.sip.SipException
Specified by:
terminateOnBye in interface javax.sip.Dialog
Throws:
javax.sip.SipException

getTerminateOnBye

public boolean getTerminateOnBye()

getLastState

public javax.sip.DialogState getLastState()

setLastState

public void setLastState(javax.sip.DialogState lastState)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

renew

public void renew()
Renews Session timer - resets ETA of dialog timeout event.


cancel

public boolean cancel()
Cancels session timer. Timeout evet wont be fired.


hasBeenCanceled

public boolean hasBeenCanceled()

setHasTimedOut

public void setHasTimedOut()

getHasTimedOut

public boolean getHasTimedOut()

fireDialogStateEvent

public boolean fireDialogStateEvent(javax.sip.message.Response response)
Checks if state event for dialog should be fired.

Parameters:
response -
Returns:
  • true if state event has been fired
  • falseif state event has not been fired
See Also:
org.mobicents.slee.resource.sip.wrappers.DialogWrapper#getKeyFor1_2DialogState(String method, int statusCode)

setDialogTimeout

public static void setDialogTimeout(long timeout)

getKeyFor1_2DialogState

public org.mobicents.slee.container.component.ComponentKey getKeyFor1_2DialogState(java.lang.String method,
                                                                                   javax.sip.message.Response response)
Parameters:
DW - Dialog wrapper of dialgo for which this method will check if state event should be fired, SetupTimedOut and DialogTerminated are events that wont be returned here as they are bound to specific conditions - TxTimeout and DialogTermination.
method - - method for which we will compute state event; As for now it can be null
statusCode - - status code of event; As for now it is ignored.
Returns:
  • null - if no status message has to be fired
  • key- ComponentKey of status message that has to be fired:
    • SetupEarly
    • SetupConfirmed
    • SetupFailed

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

getActivityHandle

public SipActivityHandle getActivityHandle()

startStateEventFireSequence

public void startStateEventFireSequence()

endStateEventFireSequence

public void endStateEventFireSequence()

isInStateEventFireSequence

public boolean isInStateEventFireSequence()


Copyright © 2008. All Rights Reserved.