|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.services.impl.JMSNotificationService
public class JMSNotificationService
Implementation of INotificationService that uses JMS to talk to a notification server. General design is client creates a temporary topic and connects to a JMS ControlQueue and sends a login message that includes a TemporaryTopic for that user. The server authenticates the user, and registers the Temporary Topic as a destination. When messages go threw the JMS server, if the user is authorized to see the message, it is sent to the user's TemporaryTopic. Any message selectors are applied to the TemporaryTopic, which filters the messages the user actually sees. Class also handles the jms message received over the TemporaryTopic, and processes them.
| Constructor Summary | |
|---|---|
JMSNotificationService(java.util.Properties properties)
Create new JMSNotificationService with given configuration properties |
|
| Method Summary | |
|---|---|
void |
connect()
Connect to the Notification Server |
void |
disconnect()
Disconnect from the Notification Server |
java.lang.String |
getServicePassword()
Get the Password for the current thread |
java.lang.String |
getServiceUser()
Get the UserId for the current thread |
boolean |
isConnected()
Determine if the service is connected |
boolean |
isNotificationEnabled()
Determine if if notification is enabled |
void |
onMessage(javax.jms.Message message)
|
void |
registerNotificationListener(INotificationListener listener)
Register an INotificationListener with service |
void |
registerSelector(java.lang.String selector)
Register a message selector with NotificationServer |
void |
setServicePassword(java.lang.String password)
Set the password for the current thread's operations |
void |
setServiceUser(java.lang.String userName)
Set the UserID for the current thread's operations |
void |
setUsingNotification(boolean enableNotification)
Enable or disable notification |
void |
unregisterNotificationListener(INotificationListener listener)
Unregister an INotificationListener with service |
void |
unregisterSelector(java.lang.String selector)
Unregister a message selector from NotificationServer |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JMSNotificationService(java.util.Properties properties)
properties - Configuration properties| Method Detail |
|---|
public void connect()
throws NotificationException
INotificationService
connect in interface INotificationServiceNotificationException - if there was an error connecting to the Notification Server
public void disconnect()
throws NotificationException
INotificationService
disconnect in interface INotificationServiceNotificationException - if there was an error disconnecting to the Notification Serverpublic void onMessage(javax.jms.Message message)
onMessage in interface javax.jms.MessageListener
public void setUsingNotification(boolean enableNotification)
throws NotificationException
INotificationService
setUsingNotification in interface INotificationServiceenableNotification - state to set notification service
NotificationException - if enabling or disabling notification fails
public void registerSelector(java.lang.String selector)
throws NotificationException
INotificationService
registerSelector in interface INotificationServiceselector - Message selector to register
NotificationException - if there was an error registering selector with the server
public void unregisterSelector(java.lang.String selector)
throws NotificationException
INotificationService
unregisterSelector in interface INotificationServiceselector - Message selector to unregister
NotificationException - if there was an error unregistering selector from the serverpublic void registerNotificationListener(INotificationListener listener)
INotificationServiceINotificationListener with service
registerNotificationListener in interface INotificationServicelistener - to registerpublic void unregisterNotificationListener(INotificationListener listener)
INotificationServiceINotificationListener with service
unregisterNotificationListener in interface INotificationServicelistener - to unregisterpublic boolean isConnected()
isConnected in interface INotificationServicepublic boolean isNotificationEnabled()
INotificationService
isNotificationEnabled in interface INotificationServicepublic java.lang.String getServicePassword()
IService
getServicePassword in interface IServicepublic void setServicePassword(java.lang.String password)
IService
setServicePassword in interface IServicepassword - Password to use in current thread's operationspublic java.lang.String getServiceUser()
IService
getServiceUser in interface IServicepublic void setServiceUser(java.lang.String userName)
IService
setServiceUser in interface IServiceuserName - UserId to use in current thread's operations
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||