org.mobicents.slee.resource.diameter.rf
Class RfResourceAdaptor

java.lang.Object
  extended by org.mobicents.slee.resource.diameter.rf.RfResourceAdaptor
All Implemented Interfaces:
java.io.Serializable, javax.slee.resource.ResourceAdaptor, org.jdiameter.api.EventListener<org.jdiameter.api.Request,org.jdiameter.api.Answer>, org.jdiameter.api.NetworkReqListener, org.mobicents.diameter.stack.DiameterListener, org.mobicents.slee.resource.diameter.base.handlers.BaseSessionCreationListener

public class RfResourceAdaptor
extends java.lang.Object
implements javax.slee.resource.ResourceAdaptor, org.mobicents.diameter.stack.DiameterListener, org.mobicents.slee.resource.diameter.base.handlers.BaseSessionCreationListener

RfResourceAdaptor.java
Project: mobicents
9:50:28 AM Apr 8, 2009

Author:
Alexandre Mendonca , Bartosz Baranowski
See Also:
Serialized Form

Field Summary
protected  net.java.slee.resource.diameter.rf.RfActivityContextInterfaceFactory acif
           
 
Fields inherited from interface javax.slee.resource.ResourceAdaptor
SBB_PROCESSED_EVENT
 
Fields inherited from interface org.mobicents.slee.resource.diameter.base.handlers.BaseSessionCreationListener
_AbortSessionAnswer, _AbortSessionRequest, _AccountingAnswer, _AccountingRequest, _CapabilitiesExchangeAnswer, _CapabilitiesExchangeRequest, _DeviceWatchdogAnswer, _DeviceWatchdogRequest, _DisconnectPeerAnswer, _DisconnectPeerRequest, _ErrorAnswer, _ExtensionDiameterMessage, _ReAuthAnswer, _ReAuthRequest, _SessionTerminationAnswer, _SessionTerminationRequest
 
Constructor Summary
RfResourceAdaptor()
           
 
Method Summary
 void activityEnded(javax.slee.resource.ActivityHandle handle)
          implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 301 for further information.
 void activityUnreferenced(javax.slee.resource.ActivityHandle handle)
          implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 301 for further information.
 void entityActivated()
          implements javax.slee.resource.ResourceAdaptor The JSLEE v1.1 Specification does not include entityActivated().
 void entityCreated(javax.slee.resource.BootstrapContext bootstrapContext)
          implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 298 for further information.
 void entityDeactivated()
          implements javax.slee.resource.ResourceAdaptor The JSLEE v1.1 Specification does not include entityDeactivated().
 void entityDeactivating()
          This method is called in context of project Mobicents in context of resource adaptor deactivation.
 void entityRemoved()
          implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 299 for further information.
 void eventProcessingFailed(javax.slee.resource.ActivityHandle handle, java.lang.Object event, int eventID, javax.slee.Address address, int flags, javax.slee.resource.FailureReason reason)
          implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 300 for further information.
 void eventProcessingSuccessful(javax.slee.resource.ActivityHandle handle, java.lang.Object event, int eventID, javax.slee.Address address, int flags)
          implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 300 for further information.
 void fireEvent(java.lang.String sessionId, java.lang.String name, org.jdiameter.api.Request request, org.jdiameter.api.Answer answer)
           
 java.lang.Object getActivity(javax.slee.resource.ActivityHandle handle)
          implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 301 for further information.
 javax.slee.resource.ActivityHandle getActivityHandle(java.lang.Object activity)
          implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 301 for further information.
protected  org.mobicents.slee.resource.diameter.base.DiameterActivityHandle getActivityHandle(java.lang.String sessionId)
          Create the Diameter Activity Handle for an given session id
 net.java.slee.resource.diameter.base.events.avp.DiameterIdentity[] getConnectedPeers()
           
 javax.slee.resource.Marshaler getMarshaler()
          implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 302 for further information.
 java.lang.Object getSBBResourceAdaptorInterface(java.lang.String className)
          implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 302 for further information.
 org.jdiameter.api.ApplicationId[] getSupportedApplications()
           
 org.jdiameter.api.Answer processRequest(org.jdiameter.api.Request request)
           
 void queryLiveness(javax.slee.resource.ActivityHandle handle)
          implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 301 for further information.
 void receivedSuccessMessage(org.jdiameter.api.Request req, org.jdiameter.api.Answer ans)
           
 void serviceActivated(java.lang.String serviceKey)
          implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 303 for further information.
 void serviceDeactivated(java.lang.String serviceKey)
          implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 304 for further information.
 void serviceInstalled(java.lang.String serviceKey, int[] eventIDs, java.lang.String[] resourceOptions)
          implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 302 for further information.
 void serviceUninstalled(java.lang.String serviceKey)
          implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 303 for further information.
 void sessionCreated(org.jdiameter.api.acc.ClientAccSession session)
           
 void sessionCreated(org.jdiameter.api.auth.ClientAuthSession session)
           
 void sessionCreated(org.jdiameter.api.acc.ServerAccSession session)
           
 void sessionCreated(org.jdiameter.api.auth.ServerAuthSession session)
           
 void sessionCreated(org.jdiameter.api.Session session)
           
 void sessionDestroyed(java.lang.String sessionId, java.lang.Object appSession)
           
 boolean sessionExists(java.lang.String sessionId)
           
 void timeoutExpired(org.jdiameter.api.Request req)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

acif

protected net.java.slee.resource.diameter.rf.RfActivityContextInterfaceFactory acif
Constructor Detail

RfResourceAdaptor

public RfResourceAdaptor()
Method Detail

activityEnded

public void activityEnded(javax.slee.resource.ActivityHandle handle)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 301 for further information.
The SLEE calls this method to inform the resource adaptor that the SLEE has completed activity end processing for the activity represented by the activity handle. The resource adaptor should release any resource related to this activity as the SLEE will not ask for it again.

Specified by:
activityEnded in interface javax.slee.resource.ResourceAdaptor

activityUnreferenced

public void activityUnreferenced(javax.slee.resource.ActivityHandle handle)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 301 for further information.
The SLEE calls this method to inform the resource adaptor that the activitys Activity Context object is no longer attached to any SBB entities and is no longer referenced by any SLEE Facilities. This enables the resource adaptor to implicitly end the Activity object.

Specified by:
activityUnreferenced in interface javax.slee.resource.ResourceAdaptor

entityActivated

public void entityActivated()
                     throws javax.slee.resource.ResourceException
implements javax.slee.resource.ResourceAdaptor The JSLEE v1.1 Specification does not include entityActivated(). However, the API description of JSLEE v1.1 does include this method already. So, the documentation follows the code.
This method is called in context of project Mobicents in context of resource adaptor activation. More precisely, org.mobicents.slee.resource.ResourceAdaptorEntity.activate() calls this method entityActivated(). This method signals the resource adaptor the transition from state "INACTIVE" to state "ACTIVE".

Specified by:
entityActivated in interface javax.slee.resource.ResourceAdaptor
Throws:
javax.slee.resource.ResourceException

entityCreated

public void entityCreated(javax.slee.resource.BootstrapContext bootstrapContext)
                   throws javax.slee.resource.ResourceException
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 298 for further information.
This method is called by the SLEE when a resource adaptor object instance is bootstrapped, either when a resource adaptor entity is created or during SLEE startup. The SLEE implementation will construct the resource adaptor object and then invoke the entityCreated method before any other operations can be invoked on the resource adaptor object.

Specified by:
entityCreated in interface javax.slee.resource.ResourceAdaptor
Throws:
javax.slee.resource.ResourceException

entityDeactivated

public void entityDeactivated()
implements javax.slee.resource.ResourceAdaptor The JSLEE v1.1 Specification does not include entityDeactivated(). However, the API description of JSLEE v1.1 does include this method already. So, the documentation follows the code.
This method is called in context of project Mobicents in context of resource adaptor deactivation. More precisely, org.mobicents.slee.resource.ResourceAdaptorEntity.deactivate() calls this method entityDeactivated(). The method call is done AFTER the call to entityDeactivating(). This method signals the resource adaptor the transition from state "STOPPING" to state "INACTIVE".

Specified by:
entityDeactivated in interface javax.slee.resource.ResourceAdaptor

entityDeactivating

public void entityDeactivating()
This method is called in context of project Mobicents in context of resource adaptor deactivation. More precisely, org.mobicents.slee.resource.ResourceAdaptorEntity.deactivate() calls this method entityDeactivating() PRIOR to invoking entityDeactivated(). This method signals the resource adaptor the transition from state "ACTIVE" to state "STOPPING".

Specified by:
entityDeactivating in interface javax.slee.resource.ResourceAdaptor

entityRemoved

public void entityRemoved()
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 299 for further information.
This method is called by the SLEE when a resource adaptor object instance is being removed, either when a resource adaptor entity is deleted or during SLEE shutdown. When receiving this invocation the resource adaptor object is expected to close any system resources it has allocated.

Specified by:
entityRemoved in interface javax.slee.resource.ResourceAdaptor

eventProcessingFailed

public void eventProcessingFailed(javax.slee.resource.ActivityHandle handle,
                                  java.lang.Object event,
                                  int eventID,
                                  javax.slee.Address address,
                                  int flags,
                                  javax.slee.resource.FailureReason reason)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 300 for further information.
The SLEE calls this method to inform the resource adaptor object that the specified event was processed unsuccessfully by the SLEE. Event processing can fail if, for example, the SLEE doesnt have enough resource to process the event, a SLEE node fails during event processing or a system level failure prevents the SLEE from committing transactions.

Specified by:
eventProcessingFailed in interface javax.slee.resource.ResourceAdaptor

eventProcessingSuccessful

public void eventProcessingSuccessful(javax.slee.resource.ActivityHandle handle,
                                      java.lang.Object event,
                                      int eventID,
                                      javax.slee.Address address,
                                      int flags)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 300 for further information.
The SLEE calls this method to inform the resource adaptor object that the specified event was processed successfully by the SLEE. An event is considered to be processed successfully if the SLEE has attempted to deliver the event to all interested SBBs.

Specified by:
eventProcessingSuccessful in interface javax.slee.resource.ResourceAdaptor

getActivity

public java.lang.Object getActivity(javax.slee.resource.ActivityHandle handle)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 301 for further information.
The SLEE calls this method to get access to the underlying activity for an activity handle. The resource adaptor is expected to pass back a non-null object.

Specified by:
getActivity in interface javax.slee.resource.ResourceAdaptor

getActivityHandle

public javax.slee.resource.ActivityHandle getActivityHandle(java.lang.Object activity)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 301 for further information.
The SLEE calls this method to get an activity handle for an activity created by the underlying resource. This method is invoked by the SLEE when it needs to construct an activity context for an activity via an activity context interface factory method invoked by an SBB.

Specified by:
getActivityHandle in interface javax.slee.resource.ResourceAdaptor

getMarshaler

public javax.slee.resource.Marshaler getMarshaler()
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 302 for further information.
The SLEE calls this method to get reference to the Marshaler object. The resource adaptor implements the Marshaler interface. The Marshaler is used by the SLEE to convert between object and distributable forms of events and event handles.

Specified by:
getMarshaler in interface javax.slee.resource.ResourceAdaptor

getSBBResourceAdaptorInterface

public java.lang.Object getSBBResourceAdaptorInterface(java.lang.String className)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 302 for further information.
The SLEE calls this method to get access to the underlying resource adaptor interface that enables the SBB to invoke the resource adaptor, to send messages for example.

Specified by:
getSBBResourceAdaptorInterface in interface javax.slee.resource.ResourceAdaptor

queryLiveness

public void queryLiveness(javax.slee.resource.ActivityHandle handle)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 301 for further information.
The SLEE calls this method to query if a specific activity belonging to this resource adaptor object is alive.

Specified by:
queryLiveness in interface javax.slee.resource.ResourceAdaptor

serviceActivated

public void serviceActivated(java.lang.String serviceKey)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 303 for further information.
The SLEE calls this method to inform the resource adaptor that a service has been activated and is interested in the event types associated to the service key. The service must be installed with the resource adaptor via the serviceInstalled method before it can be activated.

Specified by:
serviceActivated in interface javax.slee.resource.ResourceAdaptor

serviceDeactivated

public void serviceDeactivated(java.lang.String serviceKey)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 304 for further information.
The SLEE calls this method to inform the SLEE that a service has been deactivated and is no longer interested in the event types associated to the service key.

Specified by:
serviceDeactivated in interface javax.slee.resource.ResourceAdaptor

serviceInstalled

public void serviceInstalled(java.lang.String serviceKey,
                             int[] eventIDs,
                             java.lang.String[] resourceOptions)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 302 for further information.
The SLEE calls this method to signify to the resource adaptor that a service has been installed and is interested in a specific set of events. The SLEE passes an event filter which identifies a set of event types that services in the SLEE are interested in. The SLEE calls this method once a service is installed.

Specified by:
serviceInstalled in interface javax.slee.resource.ResourceAdaptor

serviceUninstalled

public void serviceUninstalled(java.lang.String serviceKey)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1 Specification Page 303 for further information.
The SLEE calls this method to signify that a service has been un-installed in the SLEE. The event types associated to the service key are no longer of interest to a particular application.

Specified by:
serviceUninstalled in interface javax.slee.resource.ResourceAdaptor

getActivityHandle

protected org.mobicents.slee.resource.diameter.base.DiameterActivityHandle getActivityHandle(java.lang.String sessionId)
Create the Diameter Activity Handle for an given session id

Parameters:
sessionId - the session identifier to create the activity handle from
Returns:
a DiameterActivityHandle for the provided sessionId

processRequest

public org.jdiameter.api.Answer processRequest(org.jdiameter.api.Request request)
Specified by:
processRequest in interface org.jdiameter.api.NetworkReqListener

receivedSuccessMessage

public void receivedSuccessMessage(org.jdiameter.api.Request req,
                                   org.jdiameter.api.Answer ans)
Specified by:
receivedSuccessMessage in interface org.jdiameter.api.EventListener<org.jdiameter.api.Request,org.jdiameter.api.Answer>

timeoutExpired

public void timeoutExpired(org.jdiameter.api.Request req)
Specified by:
timeoutExpired in interface org.jdiameter.api.EventListener<org.jdiameter.api.Request,org.jdiameter.api.Answer>

getConnectedPeers

public net.java.slee.resource.diameter.base.events.avp.DiameterIdentity[] getConnectedPeers()
Returns:

fireEvent

public void fireEvent(java.lang.String sessionId,
                      java.lang.String name,
                      org.jdiameter.api.Request request,
                      org.jdiameter.api.Answer answer)
Specified by:
fireEvent in interface org.mobicents.slee.resource.diameter.base.handlers.BaseSessionCreationListener

sessionCreated

public void sessionCreated(org.jdiameter.api.acc.ClientAccSession session)
Specified by:
sessionCreated in interface org.mobicents.slee.resource.diameter.base.handlers.BaseSessionCreationListener

sessionCreated

public void sessionCreated(org.jdiameter.api.acc.ServerAccSession session)
Specified by:
sessionCreated in interface org.mobicents.slee.resource.diameter.base.handlers.BaseSessionCreationListener

sessionCreated

public void sessionCreated(org.jdiameter.api.auth.ServerAuthSession session)
Specified by:
sessionCreated in interface org.mobicents.slee.resource.diameter.base.handlers.BaseSessionCreationListener

sessionCreated

public void sessionCreated(org.jdiameter.api.auth.ClientAuthSession session)
Specified by:
sessionCreated in interface org.mobicents.slee.resource.diameter.base.handlers.BaseSessionCreationListener

sessionCreated

public void sessionCreated(org.jdiameter.api.Session session)
Specified by:
sessionCreated in interface org.mobicents.slee.resource.diameter.base.handlers.BaseSessionCreationListener

sessionDestroyed

public void sessionDestroyed(java.lang.String sessionId,
                             java.lang.Object appSession)
Specified by:
sessionDestroyed in interface org.mobicents.slee.resource.diameter.base.handlers.BaseSessionCreationListener

sessionExists

public boolean sessionExists(java.lang.String sessionId)
Specified by:
sessionExists in interface org.mobicents.slee.resource.diameter.base.handlers.BaseSessionCreationListener

getSupportedApplications

public org.jdiameter.api.ApplicationId[] getSupportedApplications()
Specified by:
getSupportedApplications in interface org.mobicents.slee.resource.diameter.base.handlers.BaseSessionCreationListener


Copyright © 2009. All Rights Reserved.