org.mobicents.slee.resource.sip
Class SipResourceAdaptor

java.lang.Object
  extended by org.mobicents.slee.resource.sip.SipResourceAdaptor
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, javax.sip.SipListener, javax.slee.resource.ResourceAdaptor

public class SipResourceAdaptor
extends java.lang.Object
implements javax.sip.SipListener, javax.slee.resource.ResourceAdaptor, java.io.Serializable

Creates and Wraps the Sip Stack.

Author:
F.Moggia, Ivelin Ivanov, M. Ranganathan, B. Baranowski
See Also:
Serialized Form

Field Summary
static java.lang.String EVENT_DIALOG_STATE_SetupConfirmed
           
static java.lang.String EVENT_DIALOG_STATE_SetupEarly
           
static java.lang.String EVENT_DIALOG_STATE_SetupFailed
           
static java.lang.String EVENT_DIALOG_STATE_SetupTimedOut
           
static java.lang.String EVENT_PREFIX_1_1
           
static java.lang.String EVENT_PREFIX_1_2
           
static java.lang.String EVENT_REQUEST_CANCEL_1_1
           
static java.lang.String EVENT_REQUEST_DIALOG_TERMINATION_EVENT_NAME_1_2
           
static java.lang.String EVENT_RESPONSE_CLIENT_ERROR_1_1
           
static java.lang.String EVENT_RESPONSE_GLOBAL_FAILURE_1_1
           
static java.lang.String EVENT_RESPONSE_INFORMATIONAL_1_1
           
static java.lang.String EVENT_RESPONSE_REDIRECTION_1_1
           
static java.lang.String EVENT_RESPONSE_SERVER_ERROR_1_1
           
static java.lang.String EVENT_RESPONSE_SUCCESS_1_1
           
static java.lang.String EVENT_RESPONSE_TRYING_1_1
           
static java.lang.String EVENT_TIMEOUT_DIALOG
           
static java.lang.String EVENT_TIMEOUT_TRANSACTION
           
static java.lang.String VENDOR_1_1
           
static java.lang.String VENDOR_1_2
           
static java.lang.String VERSION_1_1
           
static java.lang.String VERSION_1_2
           
 
Fields inherited from interface javax.slee.resource.ResourceAdaptor
SBB_PROCESSED_EVENT
 
Constructor Summary
SipResourceAdaptor()
           
 
Method Summary
 void activityEnded(javax.slee.resource.ActivityHandle ah)
           
 void activityUnreferenced(javax.slee.resource.ActivityHandle ah)
           
 void configure(java.util.Properties properties)
           
 void entityActivated()
           
 void entityCreated(javax.slee.resource.BootstrapContext ctx)
           
 void entityDeactivated()
           
 void entityDeactivating()
           
 void entityRemoved()
           
 void eventProcessingFailed(javax.slee.resource.ActivityHandle ah, java.lang.Object event, int arg2, javax.slee.Address arg3, int arg4, javax.slee.resource.FailureReason arg5)
           
 void eventProcessingSuccessful(javax.slee.resource.ActivityHandle ah, java.lang.Object event, int arg2, javax.slee.Address arg3, int arg4)
           
 java.util.Map getActivities()
           
 java.lang.Object getActivity(javax.slee.resource.ActivityHandle handle)
           
 java.lang.Object getActivityContextInterfaceFactory()
           
 javax.slee.resource.ActivityHandle getActivityHandle(java.lang.Object obj)
           
 javax.slee.resource.BootstrapContext getBootstrapContext()
           
 java.lang.Long getCancelWait()
           
 java.lang.Long getDialogIdleTimeTimeout()
           
 java.lang.Object getFactoryInterface()
           
 java.lang.Object getInterface()
           
 java.lang.String getIp()
           
 javax.slee.resource.Marshaler getMarshaler()
           
 java.lang.Integer getPort()
           
 java.util.Properties getProperties(java.util.Properties pproperties)
           
 java.lang.Object getSBBResourceAdaptorInterface(java.lang.String arg0)
           
 SipFactoryProvider getSipFactoryProvider()
           
 javax.slee.resource.SleeEndpoint getSleeEndpoint()
           
 java.lang.String getTransports()
           
protected  void initializeStack()
           
 boolean isEventGoingToBereceived(org.mobicents.slee.container.component.ComponentKey eventKey)
          Part of event filtering.
protected  void printActivities(java.lang.String where)
           
 void processDialogTerminated(javax.sip.DialogTerminatedEvent dialogTerminatedEvent)
           
 void processIOException(javax.sip.IOExceptionEvent arg0)
           
 void processRequest(javax.sip.RequestEvent req)
           
 void processResponse(javax.sip.ResponseEvent resp)
           
 void processTimeout(javax.sip.TimeoutEvent timeout)
           
 void processTransactionTerminated(javax.sip.TransactionTerminatedEvent txTerminatedEvent)
           
 void queryLiveness(javax.slee.resource.ActivityHandle ah)
           
 void sendActivityEndEvent(javax.sip.Dialog dial)
          Functions calls Dialog.delete() if state is not equal to TERMINATED or is null
 void sendActivityEndEvent(javax.sip.Transaction sipT)
          Function checks if tx is INVITE - if it is it cancels possible CANCEL timer ticking in it.
 void serviceActivated(java.lang.String serviceID)
           
 void serviceDeactivated(java.lang.String serviceID)
           
 void serviceInstalled(java.lang.String serviceID, int[] eventIDs, java.lang.String[] resourceOptions)
           
 void serviceUninstalled(java.lang.String serviceID)
           
 void setCancelWait(java.lang.Long cancelWait)
           
 void setDialogIdleTimeTimeout(java.lang.Long idleTimeOut)
           
 void setIp(java.lang.String ip)
           
 void setPort(java.lang.Integer port)
           
 void setProperties(java.util.Properties properties)
           
 void setTransports(java.lang.String transportsToSet)
           
 void start()
           
 void stop()
           
 void stopping()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_PREFIX_1_2

public static final java.lang.String EVENT_PREFIX_1_2
See Also:
Constant Field Values

EVENT_PREFIX_1_1

public static final java.lang.String EVENT_PREFIX_1_1
See Also:
Constant Field Values

VENDOR_1_2

public static final java.lang.String VENDOR_1_2
See Also:
Constant Field Values

VERSION_1_2

public static final java.lang.String VERSION_1_2
See Also:
Constant Field Values

VENDOR_1_1

public static final java.lang.String VENDOR_1_1
See Also:
Constant Field Values

VERSION_1_1

public static final java.lang.String VERSION_1_1
See Also:
Constant Field Values

EVENT_REQUEST_DIALOG_TERMINATION_EVENT_NAME_1_2

public static final java.lang.String EVENT_REQUEST_DIALOG_TERMINATION_EVENT_NAME_1_2
See Also:
Constant Field Values

EVENT_REQUEST_CANCEL_1_1

public static final java.lang.String EVENT_REQUEST_CANCEL_1_1
See Also:
Constant Field Values

EVENT_RESPONSE_TRYING_1_1

public static final java.lang.String EVENT_RESPONSE_TRYING_1_1
See Also:
Constant Field Values

EVENT_RESPONSE_INFORMATIONAL_1_1

public static final java.lang.String EVENT_RESPONSE_INFORMATIONAL_1_1
See Also:
Constant Field Values

EVENT_RESPONSE_SUCCESS_1_1

public static final java.lang.String EVENT_RESPONSE_SUCCESS_1_1
See Also:
Constant Field Values

EVENT_RESPONSE_REDIRECTION_1_1

public static final java.lang.String EVENT_RESPONSE_REDIRECTION_1_1
See Also:
Constant Field Values

EVENT_RESPONSE_CLIENT_ERROR_1_1

public static final java.lang.String EVENT_RESPONSE_CLIENT_ERROR_1_1
See Also:
Constant Field Values

EVENT_RESPONSE_SERVER_ERROR_1_1

public static final java.lang.String EVENT_RESPONSE_SERVER_ERROR_1_1
See Also:
Constant Field Values

EVENT_RESPONSE_GLOBAL_FAILURE_1_1

public static final java.lang.String EVENT_RESPONSE_GLOBAL_FAILURE_1_1
See Also:
Constant Field Values

EVENT_TIMEOUT_TRANSACTION

public static final java.lang.String EVENT_TIMEOUT_TRANSACTION
See Also:
Constant Field Values

EVENT_TIMEOUT_DIALOG

public static final java.lang.String EVENT_TIMEOUT_DIALOG
See Also:
Constant Field Values

EVENT_DIALOG_STATE_SetupEarly

public static final java.lang.String EVENT_DIALOG_STATE_SetupEarly
See Also:
Constant Field Values

EVENT_DIALOG_STATE_SetupConfirmed

public static final java.lang.String EVENT_DIALOG_STATE_SetupConfirmed
See Also:
Constant Field Values

EVENT_DIALOG_STATE_SetupFailed

public static final java.lang.String EVENT_DIALOG_STATE_SetupFailed
See Also:
Constant Field Values

EVENT_DIALOG_STATE_SetupTimedOut

public static final java.lang.String EVENT_DIALOG_STATE_SetupTimedOut
See Also:
Constant Field Values
Constructor Detail

SipResourceAdaptor

public SipResourceAdaptor()
Method Detail

getIp

public java.lang.String getIp()

setIp

public void setIp(java.lang.String ip)

getPort

public java.lang.Integer getPort()

setPort

public void setPort(java.lang.Integer port)

getCancelWait

public java.lang.Long getCancelWait()

setCancelWait

public void setCancelWait(java.lang.Long cancelWait)

getDialogIdleTimeTimeout

public java.lang.Long getDialogIdleTimeTimeout()

setDialogIdleTimeTimeout

public void setDialogIdleTimeTimeout(java.lang.Long idleTimeOut)

getTransports

public java.lang.String getTransports()

setTransports

public void setTransports(java.lang.String transportsToSet)

configure

public void configure(java.util.Properties properties)
               throws javax.slee.InvalidStateException
Throws:
javax.slee.InvalidStateException

entityCreated

public void entityCreated(javax.slee.resource.BootstrapContext ctx)
                   throws javax.slee.resource.ResourceException
Specified by:
entityCreated in interface javax.slee.resource.ResourceAdaptor
Throws:
javax.slee.resource.ResourceException

entityActivated

public void entityActivated()
                     throws javax.slee.resource.ResourceException
Specified by:
entityActivated in interface javax.slee.resource.ResourceAdaptor
Throws:
javax.slee.resource.ResourceException

entityDeactivating

public void entityDeactivating()
Specified by:
entityDeactivating in interface javax.slee.resource.ResourceAdaptor

entityDeactivated

public void entityDeactivated()
Specified by:
entityDeactivated in interface javax.slee.resource.ResourceAdaptor

entityRemoved

public void entityRemoved()
Specified by:
entityRemoved in interface javax.slee.resource.ResourceAdaptor

start

public void start()
           throws javax.slee.resource.ResourceException
Throws:
javax.slee.resource.ResourceException

initializeStack

protected void initializeStack()
                        throws javax.sip.SipException
Throws:
javax.sip.SipException

setProperties

public void setProperties(java.util.Properties properties)
                   throws javax.slee.resource.ResourceException
Throws:
javax.slee.resource.ResourceException

getProperties

public java.util.Properties getProperties(java.util.Properties pproperties)

stopping

public void stopping()

stop

public void stop()

getInterface

public java.lang.Object getInterface()

getFactoryInterface

public java.lang.Object getFactoryInterface()

getActivityContextInterfaceFactory

public java.lang.Object getActivityContextInterfaceFactory()

getSleeEndpoint

public javax.slee.resource.SleeEndpoint getSleeEndpoint()
Returns:
Returns the sleeEndpoint.

getSBBResourceAdaptorInterface

public java.lang.Object getSBBResourceAdaptorInterface(java.lang.String arg0)
Specified by:
getSBBResourceAdaptorInterface in interface javax.slee.resource.ResourceAdaptor

getMarshaler

public javax.slee.resource.Marshaler getMarshaler()
Specified by:
getMarshaler in interface javax.slee.resource.ResourceAdaptor

getActivities

public java.util.Map getActivities()

getBootstrapContext

public javax.slee.resource.BootstrapContext getBootstrapContext()

getSipFactoryProvider

public SipFactoryProvider getSipFactoryProvider()

sendActivityEndEvent

public void sendActivityEndEvent(javax.sip.Transaction sipT)
Function checks if tx is INVITE - if it is it cancels possible CANCEL timer ticking in it. If tx isnt terminated it is here(function returns in hope it will be called again). After that SleeEndpoint.activityEnding(ah) is called.

Parameters:
sipT - - transaction which is going to be discarded as activity

sendActivityEndEvent

public void sendActivityEndEvent(javax.sip.Dialog dial)
Functions calls Dialog.delete() if state is not equal to TERMINATED or is null

Parameters:
dial - - dialog which is going to be discarded as activity
See Also:
sendActivityEndEvent(javax.sip.Transaction sipT)

eventProcessingSuccessful

public void eventProcessingSuccessful(javax.slee.resource.ActivityHandle ah,
                                      java.lang.Object event,
                                      int arg2,
                                      javax.slee.Address arg3,
                                      int arg4)
Specified by:
eventProcessingSuccessful in interface javax.slee.resource.ResourceAdaptor

eventProcessingFailed

public void eventProcessingFailed(javax.slee.resource.ActivityHandle ah,
                                  java.lang.Object event,
                                  int arg2,
                                  javax.slee.Address arg3,
                                  int arg4,
                                  javax.slee.resource.FailureReason arg5)
Specified by:
eventProcessingFailed in interface javax.slee.resource.ResourceAdaptor

activityEnded

public void activityEnded(javax.slee.resource.ActivityHandle ah)
Specified by:
activityEnded in interface javax.slee.resource.ResourceAdaptor

activityUnreferenced

public void activityUnreferenced(javax.slee.resource.ActivityHandle ah)
Specified by:
activityUnreferenced in interface javax.slee.resource.ResourceAdaptor

queryLiveness

public void queryLiveness(javax.slee.resource.ActivityHandle ah)
Specified by:
queryLiveness in interface javax.slee.resource.ResourceAdaptor

getActivity

public java.lang.Object getActivity(javax.slee.resource.ActivityHandle handle)
Specified by:
getActivity in interface javax.slee.resource.ResourceAdaptor

getActivityHandle

public javax.slee.resource.ActivityHandle getActivityHandle(java.lang.Object obj)
Specified by:
getActivityHandle in interface javax.slee.resource.ResourceAdaptor

serviceInstalled

public void serviceInstalled(java.lang.String serviceID,
                             int[] eventIDs,
                             java.lang.String[] resourceOptions)
Specified by:
serviceInstalled in interface javax.slee.resource.ResourceAdaptor

serviceUninstalled

public void serviceUninstalled(java.lang.String serviceID)
Specified by:
serviceUninstalled in interface javax.slee.resource.ResourceAdaptor

serviceActivated

public void serviceActivated(java.lang.String serviceID)
Specified by:
serviceActivated in interface javax.slee.resource.ResourceAdaptor

serviceDeactivated

public void serviceDeactivated(java.lang.String serviceID)
Specified by:
serviceDeactivated in interface javax.slee.resource.ResourceAdaptor

processIOException

public void processIOException(javax.sip.IOExceptionEvent arg0)
Specified by:
processIOException in interface javax.sip.SipListener

processDialogTerminated

public void processDialogTerminated(javax.sip.DialogTerminatedEvent dialogTerminatedEvent)
Specified by:
processDialogTerminated in interface javax.sip.SipListener

processRequest

public void processRequest(javax.sip.RequestEvent req)
Specified by:
processRequest in interface javax.sip.SipListener

processResponse

public void processResponse(javax.sip.ResponseEvent resp)
Specified by:
processResponse in interface javax.sip.SipListener

processTimeout

public void processTimeout(javax.sip.TimeoutEvent timeout)
Specified by:
processTimeout in interface javax.sip.SipListener

processTransactionTerminated

public void processTransactionTerminated(javax.sip.TransactionTerminatedEvent txTerminatedEvent)
Specified by:
processTransactionTerminated in interface javax.sip.SipListener

printActivities

protected void printActivities(java.lang.String where)

isEventGoingToBereceived

public boolean isEventGoingToBereceived(org.mobicents.slee.container.component.ComponentKey eventKey)
Part of event filtering.

Parameters:
eventKey - - comp key of event
Returns:
  • true - if event is going to be received
  • false - otherwise


Copyright © 2008. All Rights Reserved.