public class Snooper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Map |
clientMap_ |
private static java.util.logging.Logger |
logger_ |
private static byte[] |
newline_ |
private java.io.OutputStream |
out_ |
Constructor and Description |
---|
Snooper(ClientProfile profile,
Subscriptions subs,
Metadata meta,
java.io.OutputStream out,
int autoSec)
Constructor using custom metadata.
|
Snooper(ClientProfile profile,
Subscriptions subs,
java.io.OutputStream out,
int autoSec)
Constructor using default metadata.
|
Modifier and Type | Method and Description |
---|---|
static Metadata |
createDefaultMetadata()
Returns the default metadata for the Snooper client.
|
private void |
log(java.lang.String senderId,
Message msg,
java.lang.String msgId)
Logs a received message.
|
static void |
main(java.lang.String[] args)
Main method.
|
static int |
runMain(java.lang.String[] args)
Does the work for the main method.
|
private final java.io.OutputStream out_
private final java.util.Map clientMap_
private static final byte[] newline_
private static final java.util.logging.Logger logger_
public Snooper(ClientProfile profile, Subscriptions subs, java.io.OutputStream out, int autoSec)
profile
- profilesubs
- subscriptions defining which messages are received
and loggedout
- destination stream for logging infoautoSec
- number of seconds between auto connection attemptspublic Snooper(ClientProfile profile, Subscriptions subs, Metadata meta, java.io.OutputStream out, int autoSec)
profile
- profilesubs
- subscriptions defining which messages are received
and loggedmeta
- client metadataout
- destination stream for logging infoautoSec
- number of seconds between auto connection attemptsprivate void log(java.lang.String senderId, Message msg, java.lang.String msgId) throws java.io.IOException
senderId
- message sender public IDmsg
- message objectmsgId
- message ID for call/response type messages
(null for notify type messages)java.io.IOException
public static Metadata createDefaultMetadata()
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