Oracle Application Server Wireless Java API Reference
B14043-01


oracle.panama.messaging.push
Class PushClientBase

java.lang.Object
  extended byoracle.panama.messaging.push.PushClientBase

Direct Known Subclasses:
Push, PushLite

public abstract class PushClientBase
extends java.lang.Object

Base class of all Push clients.


Constructor Summary
PushClientBase(java.lang.String messagingGatewayURL, java.lang.String username, java.lang.String password)

Method Summary
java.lang.String getServerVersion()
Get the version of PushServer
java.lang.String[] getSupportedTransports()
Get names of available transport types from Push server.
java.lang.String getVersion()
Get version of Push API.
void removeStatusListener()
Unregister the status listener registered by setStatusListener()
void setProxy(java.lang.String host, int port)
If Push client machine is inside firewall and Push Server is outside firewall, user may need to tell Push client his/her HTTP proxy settings.
void setProxy(java.lang.String host, int port, java.lang.String username, java.lang.String password)
If Push client machine is inside firewall and Push Server is outside firewall, user may need to tell Push client his/her HTTP proxy settings.
void setStatusListener(StatusListener listener)
Registering StatusListener to get realtime message status updates for local Push.
void setStatusListener(StatusListener listener, java.lang.String callbackHost, int port)
Registering StatusListener to get realtime message status updates for remote Push clients.

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PushClientBase

public PushClientBase(java.lang.String messagingGatewayURL,
                      java.lang.String username,
                      java.lang.String password)

Method Detail

getServerVersion

public java.lang.String getServerVersion()
                                  throws PushException
Get the version of PushServer
Throws:
PushException

getSupportedTransports

public java.lang.String[] getSupportedTransports()
                                          throws PushException
Get names of available transport types from Push server. Use this method to get transport types the Push server supports currently. For example: if the return values are: "SMS","email". You may only send out SMS and email messages through this gateway.
Throws:
PushException

getVersion

public java.lang.String getVersion()
Get version of Push API.

removeStatusListener

public void removeStatusListener()
                          throws PushException
Unregister the status listener registered by setStatusListener()
Throws:
PushException

setProxy

public void setProxy(java.lang.String host,
                     int port)
If Push client machine is inside firewall and Push Server is outside firewall, user may need to tell Push client his/her HTTP proxy settings.
DO NOT set proxy if:
- Push server is on Internet and Push client machine connects to internet directly
- they both on the same intranet
- local installation
Parameters:
host - host name of proxy For example: proxy.company.com
port - port number of the proxy. For example: 80

setProxy

public void setProxy(java.lang.String host,
                     int port,
                     java.lang.String username,
                     java.lang.String password)
If Push client machine is inside firewall and Push Server is outside firewall, user may need to tell Push client his/her HTTP proxy settings.
DO NOT set proxy if:
- Push server is on Internet and Push client machine connects to internet directly
- they both on the same intranet
- local installation
Parameters:
host - host name of proxy For example: proxy.company.com
port - port number of the proxy. For example: 80
username - username of the proxy server
password - password of the username on proxy server.

setStatusListener

public void setStatusListener(StatusListener listener)
                       throws PushException
Registering StatusListener to get realtime message status updates for local Push. The callback is done by Java method call instead of HTTP call. If this function is called multiple times, the last call prevails.
Parameters:
listener - the status listener.
Throws:
PushException

setStatusListener

public void setStatusListener(StatusListener listener,
                              java.lang.String callbackHost,
                              int port)
                       throws PushException
Registering StatusListener to get realtime message status updates for remote Push clients. Set the status listener of Push client. Status callback is notified over the network. Push client tells Push Server which URL should be notified in case of status update and Push client listens to that port. For example: push client is running on client.foo.com and Push server is running on server.foo.com. Push client tells server: " I'll be listening to port 5555 for status callback. Please send a message to 'http://client.foo.com:5555' when you have a status update."
The callback URL must be reachable from Push Server. The port number should be available on the client machine.
If this function is called multiple times, the last call prevails.
This method MUST be called BEFORE any methods which communitate the server.
Only one callback URL is allowed per user no matter how many push clients are using the same user name.
Push has a HTTP server listener which listens to callback from PushServer.
Parameters:
listener - the status listener.
callbackHost - is the machine name of Push client which will be used by Push Server for callback. For example: client.foo.com
port - TCP port number which Push client will be listening to.
This method is optional and may need to be running on a machine reachable by Push Server. This machine is usually out side of firewall if Push Server is running on internet.
Throws:
PushException

Oracle Application Server Wireless Java API Reference
B14043-01


Copyright © 2004 Oracle Corporation. All Rights Reserved.