com.ibm.pvc.we.ins
Class NotificationService
java.lang.Object
|
+--com.ibm.pvc.we.ins.ANotificationService
|
+--com.ibm.pvc.we.ins.NotificationService
- public class NotificationService
- extends ANotificationService
An instance of NotificationService can be used
to send messages to a Notification Server of
same version
- Since:
- 1 February 2001
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
host
protected java.lang.String host
- Host name of notification server
port
protected int port
- Port number of notification server
connection
protected NotificationService.NSConnection connection
- The connection to the notification server
outstandingRequests
protected java.util.Map outstandingRequests
- Outstanding requests. The key is the request id and the value is
the IListener object.
NotificationService
public NotificationService(java.lang.String host,
int port)
- Creates a NotificationService instance
- Parameters:
host - domain name of the Notification Service hostport - TCP port number of the notification server
NotificationService
public NotificationService(java.lang.String host,
int port,
ANotificationService.IConnectionListener conListener)
- Creates a NotificationService instance
- Parameters:
host - domain name of the Notification Service hostport - TCP port number of the notification server
NotificationService
public NotificationService()
init
public void init(java.lang.String initString)
throws NotificationServiceException
- Overrides:
init in class ANotificationService
setConnectionListener
public void setConnectionListener(ANotificationService.IConnectionListener conListener)
- insert comment
- Overrides:
setConnectionListener in class ANotificationService
isConnected
public boolean isConnected()
- Overrides:
isConnected in class ANotificationService
sendMessage
public int sendMessage(java.lang.String notificationML,
DeliveryOptionsExtended senderPrefs,
ANotificationService.IListener listener)
throws java.io.IOException
- Send a notification and be notified of the success or failure of the
notification through a listener object.
- Overrides:
sendMessage in class ANotificationService
- Parameters:
notificationML - the notification MLsenderPrefs - the send preferenceslistener - where the result of the notification is sent. My be null
if the result is to be ignored.- Returns:
- completion status of the operation. Possible values are:
UND_DELIVERY_FAILURE : if delivery adaptors, such as instant messaging adaptor, could not send the message
(for example because the recipient is offline on instant messaging)
RUNTIME_ERROR : request processing cut short by internal UND error
INCORRECT_REQUEST_SPECIFICATION : request was not made of usable Notification ML
DELIVERY_NOT_POSSIBLE : delivery was not possible, as no user devices on which to deliver were exposed. This
may be for a number of reasons. For example, the user may have no devices,
but they may have also specified that the sender is not entitled to use their
devices. The difference cannot be revealed without breaching the recipients privacy, and
therefore that information is not revealed. The same error is returned if the
the user is inactive, non-existent, or if the device database is out of service
INCOMPATIBLE_REALMS_FOR_COMMUNICATION : The sender and the recipient are in realms that are not
entitled to communicate with each other. The request is therefore rejected.
ASYNCHRONOUS_REQUEST : The listener object will get the real result.
OK : The listener was null. The message was sent to
the Notification Server.
- Throws:
java.io.IOException -
If there are problems with the Universal Notification Dispatcher connection.
Any subclass of IOException can be thrown. Its name and associated message
provide more information on the error that has occured.
Common examples are:
java.net.ConnectException if no process on the destination host accepts the connection
java.net.BindException if the connection is local and could not be made, for example because of port clash
java.net.UnknownHostException if the requested host is unknown
java.net.NoRouteToHostException if there is no route available for the requested host
java.io.InterruptedIOException if the IO stream is prematurely terminated.
start
public void start()
throws java.io.IOException
- insert comment
- Overrides:
start in class ANotificationService
- Throws:
java.io.IOException -
stop
public void stop()
throws java.io.IOException
- Overrides:
stop in class ANotificationService
- Throws:
java.io.IOException -
getNumberOutstandingRequests
public int getNumberOutstandingRequests()
- Overrides:
getNumberOutstandingRequests in class ANotificationService
- Returns:
-