Class RemoteLogClient

java.lang.Object
  |
  +--RemoteLogClient
All Implemented Interfaces:
Log

public class RemoteLogClient
extends java.lang.Object
implements Log

A RemoteLogClient is the client-side implementation of the Log interface. It sends events to a RemoteLogServer which actually processes the given commands, storing and retrieving log records.


Field Summary
static int PORT
          The default port on which to make connections.
 
Constructor Summary
RemoteLogClient(java.net.InetAddress addr, int port)
          Constructor takes parameters for connecting to the RemoteLogServer.
 
Method Summary
 void add(LogRecord record)
          Adds a record to the log administered by the RemoteLogServer, assuming there is enough space in the server log, and that it matches the filter set by setFilter.
 LogRecord[] getAll(long windowMS)
          Returns all of the records stored at the RemoteLogServer that have timestamps within the given window.
 void setFilter(java.lang.String pattern)
          Sets the inclusion filter for the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PORT

public static final int PORT
The default port on which to make connections.

Constructor Detail

RemoteLogClient

public RemoteLogClient(java.net.InetAddress addr,
                       int port)
Constructor takes parameters for connecting to the RemoteLogServer.

Parameters:
addr - the address of the remote server
port - the TCP port the server is listening for connections on
Method Detail

add

public void add(LogRecord record)
Adds a record to the log administered by the RemoteLogServer, assuming there is enough space in the server log, and that it matches the filter set by setFilter.

Specified by:
add in interface Log

getAll

public LogRecord[] getAll(long windowMS)
Returns all of the records stored at the RemoteLogServer that have timestamps within the given window.

Specified by:
getAll in interface Log
Parameters:
windowMS - all records whose timestamps are between the current time and [windowMS] milliseconds ago will be returned.

setFilter

public void setFilter(java.lang.String pattern)
Sets the inclusion filter for the server.

Specified by:
setFilter in interface Log
Parameters:
pattern - the pattern to set the filter to.


Web Accessibility