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

java.lang.Object
  extended by org.mobicents.slee.resource.sip11.wrappers.Wrapper
      extended by org.mobicents.slee.resource.sip11.wrappers.DialogWrapper
All Implemented Interfaces:
java.io.Serializable, javax.sip.Dialog, DialogActivity
Direct Known Subclasses:
ClientDialogWrapper

public class DialogWrapper
extends Wrapper
implements DialogActivity

Abstract dialog wrapper code.

Author:
martins
See Also:
Serialized Form

Field Summary
protected  javax.slee.Address eventFiringAddress
           
protected  SipActivityHandle lastCancelableTransactionId
           
protected  java.util.concurrent.ConcurrentHashMap<SipActivityHandle,ClientTransactionWrapper> ongoingClientTransactions
           
protected  javax.sip.Dialog wrappedDialog
          the wrapped dialog
 
Fields inherited from class org.mobicents.slee.resource.sip11.wrappers.Wrapper
activityHandle, ending, ra
 
Constructor Summary
DialogWrapper(SipActivityHandle sipActivityHandle, SipResourceAdaptor ra)
           
 
Method Summary
 boolean addOngoingTransaction(ClientTransactionWrapper ctw)
           
 void associateServerTransaction(javax.sip.ClientTransaction ct, javax.sip.ServerTransaction st)
           
 void clear()
           
 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(javax.sip.message.Request origRequest)
           
 javax.sip.message.Request createRequest(java.lang.String methodName)
           
 javax.sip.message.Response createResponse(javax.sip.ServerTransaction origServerTransaction, javax.sip.message.Response receivedResponse)
           
 void delete()
           
protected  void ensureCorrectDialogLocalTag(javax.sip.message.Request request)
           
 javax.sip.ServerTransaction getAssociatedServerTransaction(javax.sip.ClientTransaction ct)
           
 javax.sip.header.CallIdHeader getCallId()
           
 javax.sip.ClientTransaction getClientTransaction(SipActivityHandle transaction)
           
 java.lang.String getDialogId()
           
 javax.slee.Address getEventFiringAddress()
          Retrieves the slee Address where events on this resource are fired.
 javax.sip.Transaction getFirstTransaction()
          Deprecated. 
 javax.sip.address.Address getLocalParty()
           
 long getLocalSeqNumber()
           
 int getLocalSequenceNumber()
          Deprecated. 
 java.lang.String getLocalTag()
           
 javax.sip.address.Address getRemoteParty()
           
 long getRemoteSeqNumber()
           
 int getRemoteSequenceNumber()
          Deprecated. 
 java.lang.String getRemoteTag()
           
 javax.sip.address.Address getRemoteTarget()
           
 java.util.Iterator<javax.sip.header.RouteHeader> getRouteSet()
           
 javax.sip.DialogState getState()
           
 javax.sip.Dialog getWrappedDialog()
           
 void incrementLocalSequenceNumber()
           
 boolean isAckTransaction()
          Indicates if the wrapper is an ack dummy transaction.
 boolean isClientDialog()
          Indicates if the dialog is UAC.
 boolean isDialog()
          Indicates if the wrapper is a Dialog
 boolean isSecure()
           
 boolean isServer()
           
 void removeOngoingTransaction(ClientTransactionWrapper ctw)
           
 void sendAck(javax.sip.message.Request arg0)
           
 javax.sip.ClientTransaction sendCancel()
           
 void sendReliableProvisionalResponse(javax.sip.message.Response arg0)
           
 void sendRequest(javax.sip.ClientTransaction ct)
           
 javax.sip.ClientTransaction sendRequest(javax.sip.message.Request request)
           
 void setLocalTag(java.lang.String localTag)
           
 void setWrappedDialog(javax.sip.Dialog wrappedDialog)
           
 void terminateOnBye(boolean arg0)
           
 java.lang.String toString()
           
 
Methods inherited from class org.mobicents.slee.resource.sip11.wrappers.Wrapper
ending, getActivityHandle, getApplicationData, isEnding, setApplicationData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sip.Dialog
getApplicationData, setApplicationData
 

Field Detail

ongoingClientTransactions

protected java.util.concurrent.ConcurrentHashMap<SipActivityHandle,ClientTransactionWrapper> ongoingClientTransactions

wrappedDialog

protected javax.sip.Dialog wrappedDialog
the wrapped dialog


eventFiringAddress

protected javax.slee.Address eventFiringAddress

lastCancelableTransactionId

protected SipActivityHandle lastCancelableTransactionId
Constructor Detail

DialogWrapper

public DialogWrapper(SipActivityHandle sipActivityHandle,
                     SipResourceAdaptor ra)
Method Detail

setLocalTag

public void setLocalTag(java.lang.String localTag)

getEventFiringAddress

public javax.slee.Address getEventFiringAddress()
Description copied from class: Wrapper
Retrieves the slee Address where events on this resource are fired.

Specified by:
getEventFiringAddress in class Wrapper
Returns:

isAckTransaction

public boolean isAckTransaction()
Description copied from class: Wrapper
Indicates if the wrapper is an ack dummy transaction.

Specified by:
isAckTransaction in class Wrapper
Returns:

isDialog

public boolean isDialog()
Description copied from class: Wrapper
Indicates if the wrapper is a Dialog

Specified by:
isDialog in class Wrapper
Returns:

associateServerTransaction

public void associateServerTransaction(javax.sip.ClientTransaction ct,
                                       javax.sip.ServerTransaction st)
Specified by:
associateServerTransaction in interface DialogActivity

getAssociatedServerTransaction

public javax.sip.ServerTransaction getAssociatedServerTransaction(javax.sip.ClientTransaction ct)
Specified by:
getAssociatedServerTransaction in interface DialogActivity

createRequest

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

createRequest

public javax.sip.message.Request createRequest(javax.sip.message.Request origRequest)
                                        throws javax.sip.SipException
Specified by:
createRequest in interface DialogActivity
Throws:
javax.sip.SipException

sendRequest

public javax.sip.ClientTransaction sendRequest(javax.sip.message.Request request)
                                        throws javax.sip.SipException,
                                               javax.sip.TransactionUnavailableException
Specified by:
sendRequest in interface DialogActivity
Throws:
javax.sip.SipException
javax.sip.TransactionUnavailableException

ensureCorrectDialogLocalTag

protected void ensureCorrectDialogLocalTag(javax.sip.message.Request request)
                                    throws javax.sip.SipException
Parameters:
request -
Throws:
javax.sip.SipException

sendRequest

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

createResponse

public javax.sip.message.Response createResponse(javax.sip.ServerTransaction origServerTransaction,
                                                 javax.sip.message.Response receivedResponse)
                                          throws javax.sip.SipException
Specified by:
createResponse in interface DialogActivity
Throws:
javax.sip.SipException

sendCancel

public javax.sip.ClientTransaction sendCancel()
                                       throws javax.sip.SipException
Specified by:
sendCancel in interface DialogActivity
Throws:
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

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

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

delete

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

getCallId

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

getDialogId

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

getFirstTransaction

@Deprecated
public javax.sip.Transaction getFirstTransaction()
Deprecated. 

Specified by:
getFirstTransaction in interface javax.sip.Dialog

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

getLocalSeqNumber

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

getLocalSequenceNumber

@Deprecated
public int getLocalSequenceNumber()
Deprecated. 

Specified by:
getLocalSequenceNumber in interface javax.sip.Dialog

getLocalTag

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

getRemoteSeqNumber

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

getRemoteSequenceNumber

@Deprecated
public int getRemoteSequenceNumber()
Deprecated. 

Specified by:
getRemoteSequenceNumber in interface javax.sip.Dialog

getRemoteTag

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

getRouteSet

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

getState

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

incrementLocalSequenceNumber

public void incrementLocalSequenceNumber()
Specified by:
incrementLocalSequenceNumber 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

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

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

terminateOnBye

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

toString

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

getClientTransaction

public javax.sip.ClientTransaction getClientTransaction(SipActivityHandle transaction)
Parameters:
transaction -
Returns:

addOngoingTransaction

public boolean addOngoingTransaction(ClientTransactionWrapper ctw)
Parameters:
ctw -

removeOngoingTransaction

public void removeOngoingTransaction(ClientTransactionWrapper ctw)
Parameters:
ctw -

clear

public void clear()
Overrides:
clear in class Wrapper

getWrappedDialog

public javax.sip.Dialog getWrappedDialog()
Returns:
the wrappedDialog

setWrappedDialog

public void setWrappedDialog(javax.sip.Dialog wrappedDialog)
Parameters:
wrappedDialog - the wrappedDialog to set

isClientDialog

public boolean isClientDialog()
Indicates if the dialog is UAC.

Returns:


Copyright © 2012. All Rights Reserved.