org.openanzo.model.embedded
Class EmbeddedNotificationService

java.lang.Object
  extended by org.openanzo.model.embedded.EmbeddedNotificationService
All Implemented Interfaces:
INotificationService, IService

public class EmbeddedNotificationService
extends java.lang.Object
implements INotificationService

An Embedded version of the INotificationService which has a direct connection to the Anzo server.

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
EmbeddedNotificationService(EmbeddedServiceBase baseService)
          Get an instance of the EmbeddedNotificationService
 
Method Summary
 void connect()
          Connect to the Notification Server
 void disableNotification()
          Disable notification
 void disconnect()
          Disconnect from the Notification Server
 void enableNotification()
          Enable notification
static INotificationService getInstance(java.lang.Object parent, java.util.Properties props)
          Get an instance of the EmbeddedNotificationService
 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 INotificationService is connected to the Notification Server
 boolean isNotificationEnabled()
          Determine if if notification is enabled
 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 userId)
          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

EmbeddedNotificationService

public EmbeddedNotificationService(EmbeddedServiceBase baseService)
Get an instance of the EmbeddedNotificationService

Parameters:
baseService - the base embedded service which this service is built upon
Method Detail

getInstance

public static INotificationService getInstance(java.lang.Object parent,
                                               java.util.Properties props)
Get an instance of the EmbeddedNotificationService

Parameters:
parent - The object creating this service
props - The configuration properties for this service
Returns:
A newly created EmbeddedNotificationService

setUsingNotification

public void setUsingNotification(boolean enableNotification)
                          throws NotificationException
Description copied from interface: INotificationService
Enable or disable notification

Specified by:
setUsingNotification in interface INotificationService
Parameters:
enableNotification - state to set notification service
Throws:
NotificationException - if enabling or disabling notification fails

connect

public void connect()
Description copied from interface: INotificationService
Connect to the Notification Server

Specified by:
connect in interface INotificationService

disableNotification

public void disableNotification()
Disable notification


disconnect

public void disconnect()
Description copied from interface: INotificationService
Disconnect from the Notification Server

Specified by:
disconnect in interface INotificationService

enableNotification

public void enableNotification()
Enable notification


isConnected

public boolean isConnected()
Description copied from interface: INotificationService
Determine if the INotificationService is connected to the Notification Server

Specified by:
isConnected in interface INotificationService
Returns:
true if the INotificationService is connected to the Notification Server

isNotificationEnabled

public boolean isNotificationEnabled()
Description copied from interface: INotificationService
Determine if if notification is enabled

Specified by:
isNotificationEnabled in interface INotificationService
Returns:
true if notification is enabled

registerNotificationListener

public void registerNotificationListener(INotificationListener listener)
Description copied from interface: INotificationService
Register an INotificationListener with service

Specified by:
registerNotificationListener in interface INotificationService
Parameters:
listener - to register

registerSelector

public void registerSelector(java.lang.String selector)
                      throws NotificationException
Description copied from interface: INotificationService
Register a message selector with NotificationServer

Specified by:
registerSelector in interface INotificationService
Parameters:
selector - Message selector to register
Throws:
NotificationException - if there was an error registering selector with the server

unregisterNotificationListener

public void unregisterNotificationListener(INotificationListener listener)
Description copied from interface: INotificationService
Unregister an INotificationListener with service

Specified by:
unregisterNotificationListener in interface INotificationService
Parameters:
listener - to unregister

unregisterSelector

public void unregisterSelector(java.lang.String selector)
                        throws NotificationException
Description copied from interface: INotificationService
Unregister a message selector from NotificationServer

Specified by:
unregisterSelector in interface INotificationService
Parameters:
selector - Message selector to unregister
Throws:
NotificationException - if there was an error unregistering selector from the server

getServicePassword

public java.lang.String getServicePassword()
Description copied from interface: IService
Get the Password for the current thread

Specified by:
getServicePassword in interface IService
Returns:
the Password for the current thread

getServiceUser

public java.lang.String getServiceUser()
Description copied from interface: IService
Get the UserId for the current thread

Specified by:
getServiceUser in interface IService
Returns:
the UserId for the current thread

setServicePassword

public void setServicePassword(java.lang.String password)
Description copied from interface: IService
Set the password for the current thread's operations

Specified by:
setServicePassword in interface IService
Parameters:
password - Password to use in current thread's operations

setServiceUser

public void setServiceUser(java.lang.String userId)
Description copied from interface: IService
Set the UserID for the current thread's operations

Specified by:
setServiceUser in interface IService
Parameters:
userId - UserId to use in current thread's operations


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.