public abstract class MessageSender
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
MessageSender.AsynchSender
MessageSender implementation which uses the Asynchronous Call/Response
pattern.
|
private static class |
MessageSender.BlockingMap
Map implementation which dispenses its contents via an iterator
which will block until all the results are in.
|
private static class |
MessageSender.BlockingSet
Set implementation which dispenses its contents via an iterator
which will block until all results are in.
|
private static class |
MessageSender.MetaClient
Client implementation which may know about metadata.
|
private static class |
MessageSender.NotifySender
MessageSender implementation which uses the Notify pattern.
|
private static class |
MessageSender.SynchSender
MessageSender implementation which uses the Synchronous Call/Response
pattern.
|
Modifier and Type | Field and Description |
---|---|
private static java.util.logging.Logger |
logger_ |
Constructor and Description |
---|
MessageSender() |
Modifier and Type | Method and Description |
---|---|
(package private) abstract java.util.Map |
getResponses(HubConnection connection,
Message msg,
java.lang.String[] recipientIds)
Sends a message to a given list of recipients.
|
static void |
main(java.lang.String[] args)
Main method.
|
private static java.lang.String[] |
namesToIds(HubConnection conn,
java.lang.String[] names)
Translates an array of client names to client IDs.
|
static int |
runMain(java.lang.String[] args)
Does the work for the main method.
|
(package private) void |
showResults(HubConnection connection,
Message msg,
java.lang.String[] recipientIds,
java.io.PrintStream out)
Sends a message to a list of recipients and displays the results
on an output stream.
|
abstract java.util.Map getResponses(HubConnection connection, Message msg, java.lang.String[] recipientIds) throws java.io.IOException
recipientIds
is null, then will be sent to all
subscribed clients.connection
- hub connectionmsg
- message to sendrecipientIds
- array of recipients to target, or nulljava.io.IOException
void showResults(HubConnection connection, Message msg, java.lang.String[] recipientIds, java.io.PrintStream out) throws java.io.IOException
connection
- hub connectionmsg
- message to sendrecipientIds
- array of recipients to target, or nulldestination
- print streamjava.io.IOException
private static java.lang.String[] namesToIds(HubConnection conn, java.lang.String[] names) throws SampException
conn
- hub connectionnames
- array of client names, interpreted case-insensitivelynames
SampException
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
public static int runMain(java.lang.String[] args) throws java.io.IOException
java.io.IOException