amber.utility
Class PacketLogger

java.lang.Object
  |
  +--amber.utility.PacketLogger
All Implemented Interfaces:
PacketListener, java.io.Serializable

public class PacketLogger
extends java.lang.Object
implements java.io.Serializable, PacketListener

See Also:
Serialized Form

Field Summary
protected  java.io.FileWriter logFile
          This is the file to log to.
 
Constructor Summary
PacketLogger()
          Default Constructor.
PacketLogger(java.io.FileWriter logFile)
          Initialising Constructor.
PacketLogger(java.lang.String filename)
          Initialising Constructor.
 
Method Summary
 java.io.FileWriter getLogFile()
          Gets the data in the following variable: This is the file to log to.
 void logPacket(Packet p)
          This function logs an input packet to the specified file.
 boolean processPacket(Packet p)
          This function is called when the packet is detected.
 void setLogFile(java.io.FileWriter data)
          Sets the data in the following variable: This is the file to log to.
 java.lang.String toString()
          This function returns the String form of the data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logFile

protected java.io.FileWriter logFile
This is the file to log to.
Constructor Detail

PacketLogger

public PacketLogger()
Default Constructor.

PacketLogger

public PacketLogger(java.io.FileWriter logFile)
Initialising Constructor.
Parameters:
logFile - This is the file to log to.

PacketLogger

public PacketLogger(java.lang.String filename)
Initialising Constructor.
Parameters:
filename - String name of the file to log to.
Method Detail

logPacket

public void logPacket(Packet p)
This function logs an input packet to the specified file.
Parameters:
p - Packet to log.

getLogFile

public java.io.FileWriter getLogFile()
Gets the data in the following variable: This is the file to log to.
Returns:
FileWriter containing the required information.

setLogFile

public void setLogFile(java.io.FileWriter data)
Sets the data in the following variable: This is the file to log to.
Parameters:
data - FileWriter containing the data to set the variable to.

toString

public java.lang.String toString()
This function returns the String form of the data.
Overrides:
toString in class java.lang.Object
Returns:
String containing the string version of this class.

processPacket

public boolean processPacket(Packet p)
Description copied from interface: PacketListener
This function is called when the packet is detected. Should the function return true the packet is removed from the packet queue.
Specified by:
processPacket in interface PacketListener
Following copied from interface: amber.server.component.PacketListener
Parameters:
p - Packet containing the packet to process.
Returns:
boolean. If true then the system removes the packet from the packet queue.


Copyright © 2002 Clearfield Research Ltd. All Rights Reserved.