Class JDPServerSender

java.lang.Object
   |
   +----JDPServerSender

public class JDPServerSender
extends Object
Class JDPServerSender represents a class to send messages to a listening client.


Constructor Index

 o JDPServerSender(JDPJagg)
Creates a Sender that can send messages to a listening client.
 o JDPServerSender(JDPUser)
Creates a Sender that can send messages to a listening client.

Method Index

 o getConnectedClients()
Retrieve a list of connected clients from the server.
 o getIdleFor(int)
Get the number of milliseconds since this user made a connection to JaggServer.
 o getIPAddress(int)
Get the IP address for this user.
 o getIPAddresses()
Get the list of IP addresses of users currently connected.
 o getJDPSystem(int)
Get the JDPSystem that this user is logged in to.
 o getTotalConnectedUsers()
Get the total number of users currently connected.
 o getUserid(int)
Get the JDP userid for this user.
 o sendEventToClient(String, String, Event)
Send an event to the selected client machine.

Constructors

 o JDPServerSender
 public JDPServerSender(JDPUser user)
Creates a Sender that can send messages to a listening client.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.
 o JDPServerSender
 public JDPServerSender(JDPJagg jaggSQL)
Creates a Sender that can send messages to a listening client.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.

Methods

 o sendEventToClient
 public boolean sendEventToClient(String clientAddress,
                                  String requestName,
                                  Event thisEvent)
Send an event to the selected client machine.

Parameters:
clientAddress - the IP address of the client to attempt to send to.
requestName - the request name to send. The client must have a class that has registered to listen for this request name.
thisEvent - the event to send to the client.
Returns:
whether send was successful.
 o getConnectedClients
 public boolean getConnectedClients()
Retrieve a list of connected clients from the server. When attempting to send a message to a client a client will only receive the message if there is an active class on the client listening for requests. Although the list returned contains the IP addresses of available clients some or all of these clients may have gone offline and therefore may not receive any message sent to them.

Returns:
whether the list was returned successfully.
 o getTotalConnectedUsers
 public int getTotalConnectedUsers()
Get the total number of users currently connected. getConnectedClients must be called prior to calling this method.

Returns:
the number of currently connected users.
 o getUserid
 public int getUserid(int userNumber)
Get the JDP userid for this user.

Parameters:
userNumber - the number of this user.
Returns:
the userid for this user.
 o getIPAddress
 public String getIPAddress(int userNumber)
Get the IP address for this user.

Parameters:
userNumber - the number of this user.
Returns:
the IP address for this user.
 o getJDPSystem
 public String getJDPSystem(int userNumber)
Get the JDPSystem that this user is logged in to.

Parameters:
userNumber - the number of this user.
Returns:
the JDPSystem that this user is logged in to.
 o getIdleFor
 public long getIdleFor(int userNumber)
Get the number of milliseconds since this user made a connection to JaggServer.

Parameters:
userNumber - the number of this user.
Returns:
the number of milliseconds since this user made a connection to JaggServer.
 o getIPAddresses
 public String[] getIPAddresses()
Get the list of IP addresses of users currently connected.

Returns:
the list of IP addresses of users currently connected.