com.sun.im.service
Interface NotificationService


public interface NotificationService

A Notification service is used to send and receive messages. The Notification Service is distinct from the conference service, despite the fact that the same Message definition is used in both. The differences include

About Poll The poll feature is built on top of the notification service. It uses specific content types defined here. here. The service should be intialized by calling intialize() before using any of the methods.


Method Summary
 void addNotificationServiceListener(NotificationServiceListener listener)
          Add an additional NotificationServiceListener to receive the event notifications.
 Message createMessage()
          create a message.
 Message createMessage(java.lang.String destination)
          create a message.
 void initialize(NotificationServiceListener listener)
          intialize the service by providing a NotificationServiceListener.
 void removeNotificationServiceListener(NotificationServiceListener listener)
          Removes an already added ConfereneServiceListener.
 void sendMessage(Message message, MessageStatusListener listener)
          send an alert to a destination.
 

Method Detail

sendMessage

public void sendMessage(Message message,
                        MessageStatusListener listener)
                 throws CollaborationException
send an alert to a destination. An alert is not sent in the context of a conference, as it does not allow for a response and does not require the destination to be online.

Parameters:
message - alert message
listener - callback object used by the provider to convey message disposition notifications.
Throws:
CollaborationException

createMessage

public Message createMessage(java.lang.String destination)
                      throws CollaborationException
create a message.

Parameters:
destination - address of the recipient. more recipient addresses can be added using the Message.addRecipient() method.
Throws:
CollaborationException

createMessage

public Message createMessage()
                      throws CollaborationException
create a message. recipient addresses can be added using the Message.addRecipient() method.

Throws:
CollaborationException

initialize

public void initialize(NotificationServiceListener listener)
                throws CollaborationException
intialize the service by providing a NotificationServiceListener. Service should be initialized by calling this method before using any of the services of NoficationService

Throws:
CollaborationException

addNotificationServiceListener

public void addNotificationServiceListener(NotificationServiceListener listener)
Add an additional NotificationServiceListener to receive the event notifications. To receive all the initial events the first NotificationServiceListener should be added while #initialize(NotificationServiceListener) NotificationService.


removeNotificationServiceListener

public void removeNotificationServiceListener(NotificationServiceListener listener)
Removes an already added ConfereneServiceListener. To prevent loss of any event notification it is advised to have atleast one NotificationServiceListener