rabbit.util
Class SimpleTrafficLogger

java.lang.Object
  extended by rabbit.util.SimpleTrafficLogger
All Implemented Interfaces:
TrafficLogger

public class SimpleTrafficLogger
extends Object
implements TrafficLogger

A class to track of data flows.

Author:
Robert Olofsson

Constructor Summary
SimpleTrafficLogger()
           
 
Method Summary
 void addTo(TrafficLogger other)
          Add the current log into the other TrafficLogger.
 void clear()
          Clear the current log.
 long read()
          Get the number of read bytes
 void read(long read)
          Log a read
 long transferFrom()
          Get the number of bytes transferred from this resource.
 void transferFrom(long transferred)
          Log a file transfer.
 long transferTo()
          Get the number of bytes transferred to this resourse.
 void transferTo(long transferred)
          Lot a file transfer.
 long write()
          Get the number of written bytes.
 void write(long written)
          Log a write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTrafficLogger

public SimpleTrafficLogger()
Method Detail

read

public void read(long read)
Description copied from interface: TrafficLogger
Log a read

Specified by:
read in interface TrafficLogger
Parameters:
read - the number of bytes read.

read

public long read()
Description copied from interface: TrafficLogger
Get the number of read bytes

Specified by:
read in interface TrafficLogger

write

public void write(long written)
Description copied from interface: TrafficLogger
Log a write

Specified by:
write in interface TrafficLogger
Parameters:
written - the number of bytes written.

write

public long write()
Description copied from interface: TrafficLogger
Get the number of written bytes.

Specified by:
write in interface TrafficLogger

transferFrom

public void transferFrom(long transferred)
Description copied from interface: TrafficLogger
Log a file transfer.

Specified by:
transferFrom in interface TrafficLogger
Parameters:
transferred - the number of bytes transferred.

transferFrom

public long transferFrom()
Description copied from interface: TrafficLogger
Get the number of bytes transferred from this resource.

Specified by:
transferFrom in interface TrafficLogger

transferTo

public void transferTo(long transferred)
Description copied from interface: TrafficLogger
Lot a file transfer.

Specified by:
transferTo in interface TrafficLogger
Parameters:
transferred - the number of bytes transferred.

transferTo

public long transferTo()
Description copied from interface: TrafficLogger
Get the number of bytes transferred to this resourse.

Specified by:
transferTo in interface TrafficLogger

clear

public void clear()
Description copied from interface: TrafficLogger
Clear the current log.

Specified by:
clear in interface TrafficLogger

addTo

public void addTo(TrafficLogger other)
Description copied from interface: TrafficLogger
Add the current log into the other TrafficLogger.

Specified by:
addTo in interface TrafficLogger
Parameters:
other - the traffic logger to add this statistics