org.mobicents.slee.resource.sip11
Class SipResourceAdaptor

java.lang.Object
  extended by org.mobicents.slee.resource.sip11.SipResourceAdaptor
All Implemented Interfaces:
java.util.EventListener, javax.sip.SipListener, javax.slee.resource.ResourceAdaptor, org.mobicents.slee.resource.cluster.FaultTolerantResourceAdaptor<SipActivityHandle,java.lang.String>

public class SipResourceAdaptor
extends java.lang.Object
implements javax.sip.SipListener, org.mobicents.slee.resource.cluster.FaultTolerantResourceAdaptor<SipActivityHandle,java.lang.String>


Field Summary
static int DEFAULT_EVENT_FLAGS
          for all events we are interested in knowing when the event failed to be processed
static int MARSHABLE_ACTIVITY_FLAGS
           
static int NON_MARSHABLE_ACTIVITY_FLAGS
           
static int UNREFERENCED_EVENT_FLAGS
           
 
Constructor Summary
SipResourceAdaptor()
           
 
Method Summary
 void activityEnded(javax.slee.resource.ActivityHandle activityHandle)
           
 void activityUnreferenced(javax.slee.resource.ActivityHandle arg0)
           
 boolean addActivity(Wrapper wrapperActivity)
           
 boolean addSuspendedActivity(Wrapper wrapperActivity)
           
 void administrativeRemove(javax.slee.resource.ActivityHandle activityHandle)
           
 void dataRemoved(SipActivityHandle handle)
           
 boolean disableSequenceNumberValidation()
           
protected  boolean endActivity(Wrapper activity)
           
 void eventProcessingFailed(javax.slee.resource.ActivityHandle ah, javax.slee.resource.FireableEventType arg1, java.lang.Object event, javax.slee.Address arg3, javax.slee.resource.ReceivableService arg4, int arg5, javax.slee.resource.FailureReason arg6)
           
 void eventProcessingSuccessful(javax.slee.resource.ActivityHandle arg0, javax.slee.resource.FireableEventType arg1, java.lang.Object arg2, javax.slee.Address arg3, javax.slee.resource.ReceivableService arg4, int arg5)
           
 void eventUnreferenced(javax.slee.resource.ActivityHandle handle, javax.slee.resource.FireableEventType eventType, java.lang.Object event, javax.slee.Address arg3, javax.slee.resource.ReceivableService arg4, int arg5)
           
 void failOver(SipActivityHandle activityHandle)
           
protected  void fireEvent(SipActivityHandle handle, javax.slee.resource.FireableEventType eventType, java.lang.Object event, javax.slee.Address address, int eventFlags)
           
 java.lang.Object getActivity(javax.slee.resource.ActivityHandle arg0)
           
 javax.slee.resource.ActivityHandle getActivityHandle(java.lang.Object activity)
           
 SipActivityManagement getActivityManagement()
           
 DialogWrapper getDialogWrapper(javax.sip.Dialog d)
          Retrieves the wrapper associated with a dialog, recreating if needed in a cluster env.
 EventIDCache getEventIdCache()
           
 EventIDFilter getEventIDFilter()
           
 javax.slee.facilities.EventLookupFacility getEventLookupFacility()
           
 javax.slee.resource.Marshaler getMarshaler()
           
 SleeSipProviderImpl getProviderWrapper()
           
 java.lang.Object getResourceAdaptorInterface(java.lang.String raTypeSbbInterfaceclassName)
           
 org.mobicents.slee.container.resource.SleeEndpoint getSleeEndpoint()
           
 javax.slee.facilities.Tracer getTracer(java.lang.String tracerName)
           
 TransactionWrapper getTransactionWrapper(javax.sip.Transaction t)
          Retrieves the wrapper associated with a tx, recreating if needed in a cluster env.
 boolean inLocalMode()
          Indicates if the RA is running in local mode or in a clustered environment
 void processDialogTerminated(javax.sip.DialogTerminatedEvent dte)
           
 void processDialogTerminated(DialogWrapper dw)
           
 void processIOException(javax.sip.IOExceptionEvent arg0)
           
 void processRequest(javax.sip.RequestEvent req)
           
 void processResponse(javax.sip.ResponseEvent responseEvent)
           
 void processTimeout(javax.sip.TimeoutEvent timeoutEvent)
           
 void processTransactionTerminated(javax.sip.TransactionTerminatedEvent txTerminatedEvent)
           
 void queryLiveness(javax.slee.resource.ActivityHandle arg0)
           
 void raActive()
           
 void raConfigurationUpdate(javax.slee.resource.ConfigProperties properties)
           
 void raConfigure(javax.slee.resource.ConfigProperties properties)
           
 void raInactive()
           
 void raStopping()
           
 void raUnconfigure()
           
 void raVerifyConfiguration(javax.slee.resource.ConfigProperties properties)
           
 void serviceActive(javax.slee.resource.ReceivableService receivableService)
           
 void serviceInactive(javax.slee.resource.ReceivableService receivableService)
           
 void serviceStopping(javax.slee.resource.ReceivableService receivableService)
           
 void setFaultTolerantResourceAdaptorContext(org.mobicents.slee.resource.cluster.FaultTolerantResourceAdaptorContext<SipActivityHandle,java.lang.String> context)
           
 void setResourceAdaptorContext(javax.slee.resource.ResourceAdaptorContext raContext)
           
 void unsetFaultTolerantResourceAdaptorContext()
           
 void unsetResourceAdaptorContext()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_EVENT_FLAGS

public static final int DEFAULT_EVENT_FLAGS
for all events we are interested in knowing when the event failed to be processed

See Also:
Constant Field Values

UNREFERENCED_EVENT_FLAGS

public static final int UNREFERENCED_EVENT_FLAGS

NON_MARSHABLE_ACTIVITY_FLAGS

public static final int NON_MARSHABLE_ACTIVITY_FLAGS
See Also:
Constant Field Values

MARSHABLE_ACTIVITY_FLAGS

public static final int MARSHABLE_ACTIVITY_FLAGS
Constructor Detail

SipResourceAdaptor

public SipResourceAdaptor()
Method Detail

processIOException

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

processRequest

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

endActivity

protected boolean endActivity(Wrapper activity)

fireEvent

protected void fireEvent(SipActivityHandle handle,
                         javax.slee.resource.FireableEventType eventType,
                         java.lang.Object event,
                         javax.slee.Address address,
                         int eventFlags)
                  throws javax.slee.resource.UnrecognizedActivityHandleException,
                         javax.slee.resource.IllegalEventException,
                         javax.slee.resource.ActivityIsEndingException,
                         java.lang.NullPointerException,
                         javax.slee.SLEEException,
                         javax.slee.resource.FireEventException
Throws:
javax.slee.resource.UnrecognizedActivityHandleException
javax.slee.resource.IllegalEventException
javax.slee.resource.ActivityIsEndingException
java.lang.NullPointerException
javax.slee.SLEEException
javax.slee.resource.FireEventException

getDialogWrapper

public DialogWrapper getDialogWrapper(javax.sip.Dialog d)
Retrieves the wrapper associated with a dialog, recreating if needed in a cluster env.

Parameters:
d -
Returns:

getTransactionWrapper

public TransactionWrapper getTransactionWrapper(javax.sip.Transaction t)
Retrieves the wrapper associated with a tx, recreating if needed in a cluster env.

Parameters:
t -
Returns:

processResponse

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

processTimeout

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

processTransactionTerminated

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

processDialogTerminated

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

processDialogTerminated

public void processDialogTerminated(DialogWrapper dw)
Parameters:
dw -

addActivity

public boolean addActivity(Wrapper wrapperActivity)
Parameters:
wrapperActivity -
transacted -
Returns:

addSuspendedActivity

public boolean addSuspendedActivity(Wrapper wrapperActivity)
Parameters:
wrapperActivity -
Returns:

raActive

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

raInactive

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

raStopping

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

eventProcessingFailed

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

eventProcessingSuccessful

public void eventProcessingSuccessful(javax.slee.resource.ActivityHandle arg0,
                                      javax.slee.resource.FireableEventType arg1,
                                      java.lang.Object arg2,
                                      javax.slee.Address arg3,
                                      javax.slee.resource.ReceivableService arg4,
                                      int arg5)
Specified by:
eventProcessingSuccessful in interface javax.slee.resource.ResourceAdaptor

eventUnreferenced

public void eventUnreferenced(javax.slee.resource.ActivityHandle handle,
                              javax.slee.resource.FireableEventType eventType,
                              java.lang.Object event,
                              javax.slee.Address arg3,
                              javax.slee.resource.ReceivableService arg4,
                              int arg5)
Specified by:
eventUnreferenced in interface javax.slee.resource.ResourceAdaptor

raConfigurationUpdate

public void raConfigurationUpdate(javax.slee.resource.ConfigProperties properties)
Specified by:
raConfigurationUpdate in interface javax.slee.resource.ResourceAdaptor

raConfigure

public void raConfigure(javax.slee.resource.ConfigProperties properties)
Specified by:
raConfigure in interface javax.slee.resource.ResourceAdaptor

raUnconfigure

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

raVerifyConfiguration

public void raVerifyConfiguration(javax.slee.resource.ConfigProperties properties)
                           throws javax.slee.resource.InvalidConfigurationException
Specified by:
raVerifyConfiguration in interface javax.slee.resource.ResourceAdaptor
Throws:
javax.slee.resource.InvalidConfigurationException

serviceActive

public void serviceActive(javax.slee.resource.ReceivableService receivableService)
Specified by:
serviceActive in interface javax.slee.resource.ResourceAdaptor

serviceInactive

public void serviceInactive(javax.slee.resource.ReceivableService receivableService)
Specified by:
serviceInactive in interface javax.slee.resource.ResourceAdaptor

serviceStopping

public void serviceStopping(javax.slee.resource.ReceivableService receivableService)
Specified by:
serviceStopping in interface javax.slee.resource.ResourceAdaptor

setResourceAdaptorContext

public void setResourceAdaptorContext(javax.slee.resource.ResourceAdaptorContext raContext)
Specified by:
setResourceAdaptorContext in interface javax.slee.resource.ResourceAdaptor

unsetResourceAdaptorContext

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

getEventLookupFacility

public javax.slee.facilities.EventLookupFacility getEventLookupFacility()
Returns:

getSleeEndpoint

public org.mobicents.slee.container.resource.SleeEndpoint getSleeEndpoint()
Returns:

getTracer

public javax.slee.facilities.Tracer getTracer(java.lang.String tracerName)
Parameters:
tracerName -
Returns:

getActivityManagement

public SipActivityManagement getActivityManagement()
Returns:
the activityManagement

activityEnded

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

administrativeRemove

public void administrativeRemove(javax.slee.resource.ActivityHandle activityHandle)
Specified by:
administrativeRemove in interface javax.slee.resource.ResourceAdaptor

activityUnreferenced

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

getActivity

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

getActivityHandle

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

queryLiveness

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

getResourceAdaptorInterface

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

getMarshaler

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

getProviderWrapper

public SleeSipProviderImpl getProviderWrapper()

getEventIdCache

public EventIDCache getEventIdCache()
Returns:
the eventIdCache

getEventIDFilter

public EventIDFilter getEventIDFilter()
Returns:
the eventIDFilter

disableSequenceNumberValidation

public boolean disableSequenceNumberValidation()
Returns:
true if jsip dialog should not validate cseq.

inLocalMode

public boolean inLocalMode()
Indicates if the RA is running in local mode or in a clustered environment

Returns:
true if the RA is running in local mode, false if is running in a clustered environment

dataRemoved

public void dataRemoved(SipActivityHandle handle)
Specified by:
dataRemoved in interface org.mobicents.slee.resource.cluster.FaultTolerantResourceAdaptor<SipActivityHandle,java.lang.String>

failOver

public void failOver(SipActivityHandle activityHandle)
Specified by:
failOver in interface org.mobicents.slee.resource.cluster.FaultTolerantResourceAdaptor<SipActivityHandle,java.lang.String>

setFaultTolerantResourceAdaptorContext

public void setFaultTolerantResourceAdaptorContext(org.mobicents.slee.resource.cluster.FaultTolerantResourceAdaptorContext<SipActivityHandle,java.lang.String> context)
Specified by:
setFaultTolerantResourceAdaptorContext in interface org.mobicents.slee.resource.cluster.FaultTolerantResourceAdaptor<SipActivityHandle,java.lang.String>

unsetFaultTolerantResourceAdaptorContext

public void unsetFaultTolerantResourceAdaptorContext()
Specified by:
unsetFaultTolerantResourceAdaptorContext in interface org.mobicents.slee.resource.cluster.FaultTolerantResourceAdaptor<SipActivityHandle,java.lang.String>


Copyright © 2012. All Rights Reserved.