SPI Sample Implementation
The structure of the SPI sample implementation and demo application is as follows:
The sample implementation calls EJBs to manipulate a database. Also, it calls SipServlet and manipulates the database from SIP Servlet Engine and SPI via JMS.
The list and JNDI names of EJBs called from the sample implementation are as follows:
EJB Name |
EJB Type |
Local JNDI Name |
Remote JNDI Name |
SubscriberEditorBean |
SLSB*1 |
SubscriberEditorLocal |
SubscriberEditorBean |
LocationEditorBean |
SLSB |
LocatoinEditorLocal |
LocatoinEditorBean |
PresenceACLEditorBean |
SLSB |
PresenceACLEditorLocal |
PresenceACLEditorBean |
RoleEditorBean |
SLSB |
RoleEditorLocal |
RoleEditorBean |
SubscriberBean |
CMP*2 |
SubscriberLocal |
N/A |
DigestauthBean |
CMP |
DigestauthLocal |
N/A |
RegistrationBean |
CMP |
RegistrationLocal |
N/A |
AcceptSubscriptionBean |
CMP |
AcceptSubscriptionLocal |
N/A |
DenySubscriptionBean |
CMP |
DenySubscriptionLocal |
N/A |
RolesBean |
CMP |
RolesLocal |
N/A |
RoleMapBean |
CMP |
RoleMapLocal |
N/A |
The following sections describe each sample implementation and its relation to EJBs.
Sample Implementation of User Management Interface
The structure of the user management interface sample implementation is as follows:
Initialization parameters of this sample implementation is described below:
First Parameter |
Specifies the JNDI name of the stateless session Bean. In the default deployment environment, it is always SubscriberEditorBean. |
Second Parameter |
Specifies the default realm used on user authentication. token.realm in deploy.properties is applied. |
The operation specific to the sample implementation is described below:
- The realm specified when a user is created is not used. The default realm is always used.
- The createSubscriberInfo() method always return SubscriberInfoImpl.
- SubscriberInfoImpl includes our unique user information.
- It is assumed that our unique user information alias is used as the user part of SipURI. So the combination of alias and the host part of SipURI is recognized as user defined SipURI. If you attempt to use this combination to add another user, InvalidSubscriberException is thrown.
- If a method with the SubscriberInfo argument passes an argument other than SubscriberInfoImpl, IllegalArgumentException occurs.
- If a user other than WebLogic administrator executes a certain method (createSubscriber(), removeSubscriber(), updateSubscriber(), or resetPassword()) of the SubscriberEditor interface, a security exception occurs. (EJB security is applied. If it is not necessary, edit the EJB configuration file.)
Sample Implementation of Location Management Interface
The structure of the location management interface sample implementation is as follows:
Initialization parameters of this sample implementation is described below:
First Parameter |
Specifies the JNDI name of the stateless session Bean. In the default deployment environment, it is always LocationEditorBean. |
Second Parameter |
The name of the JMS factory. It is used for event notification via JMS when ACL information is updated. |
Third Parameter |
The name of the JMS topic. It is used for event notification via JMS when ACL information is updated. |
Fourth Parameter |
Specifies true if location information is editable. If the implementation works with NS, false must be specified. |
The operation specific to the sample implementation is described below:
- Upon startup of this implementation, a thread is started to delete expired location information.
- If location information is not editable (the implementation works with NS), executing a method defined in LocationEditor results in IllegalOperationException.
- If location information is editable (the implementation does not work with NS), a thread is started to delete expired location information from the database. This thread searches the database every 30 seconds and deletes expired location information.
- If location information is editable, SubscriberEvent is registered with the specified topic name when addRegistration() or removeRegistration() is executed.
- RegistrationInfoImpl is always returned as the implementation of RegistrationInfo.
Sample Implementation of Presence Management Interface
The structure of the presence management interface sample implementation is as follows:
Initialization parameters of this sample implementation is described below:
First Parameter |
Specifies the JNDI name of the stateless session Bean. In the default deployment environment, it is always PresenceACLEditorBean. |
Second Parameter |
The name of the JMS factory. It is used for event notification via JMS when ACL information is updated. |
Third Parameter |
The name of the JMS topic. It is used for event notification via JMS when ACL information is updated. |
Fourth Parameter |
If the implementation works with NS, it specifies the name of the host that is notified of updating ACL information via UDP. If it is an empty string, event notification via UDP is not executed. |
Fifth Parameter |
If the implementation works with NS, it specifies the number of the port that is notified of updating ACL information via UDP. |
The operation specific to the sample implementation is described below:
- Only SipURI can be specified in the URI presentity argument. If other URI (such as TelURI) is specified, IllegalArgumentException occurs.
- When ACL information is changed, SubscriberEvent is registered with the specified topic name.
- When ACL information is changed, a notification is sent to the specified host name and port number in NS-specific UDP packet.
- You can add a string including *@*, alice@*, *@oki.com, and bob@oki.com as a value of watcher. It is assumed that thorough string check is done at application level.
Sample Implementation of Role Management Interface
Initialization parameters of this sample implementation is described below:
First Parameter |
Specifies the JNDI name of the stateless session Bean. In the default deployment environment, it is always RoleEditorBean. |
Second Parameter |
Specifies the default role assigned to the registered user. |
The operation specific to the sample implementation is described below:
- The default role is always added to the registered user.
- RoleMapInfoImpl is always returned as the implementation of RoleMap.
JMS Interaction
This section describes the interaction between the SPI sample implementation, SIP Servlet Engine, and demo application via JMS.
The configuration of the interaction is shown below:
When Authentication Fails
If digest authentication fails using the authentication function of SIP Servlet Engine, the following sequence is performed.
- SIP Servlet Engine registers SubscriberEvent to notify JMS of the authentication failure.
- EventManagerBean receives SubscriberEvent and performs a process that increments the failure count.
When REGISTER Succeeds
The following sequence is executed:
- RegistrarServlet invokes LocationEditor.addRegistration().
- The LcationEditor sample implementation registers SubscriberEvent with JMS.
Currently, there is no MDB to receive and handle such event.
When UNREGISTER Succeeds
- RegistrarServlet invokes LocationEditor.removeRegistration().
- The LcationEditor sample implementation registers SubscriberEvent with JMS.
Currently, there is no MDB to receive and handle such event.
Changing Presence ACL Information
This section describes the sequence where the sample application changes presence ACL information.
- HTTP Servlet invokes SPI (such as PresenceACLEditor.addAcceptURI()) to change presence ACL information.
- The PresenceACLEditor sample implementation registers SubscriptionEvent with JMS.
- If EventSubscriptionBean receives SubscriptionEvent and adds a permission or rejection list, PresenceServlet is called to send NOTIFY.
*1: Stateless Session Bean *2: CMP Entity Bean
Last Modified:Wed Jan 12 08:09:32 PM JST 2005
|