netcom.log
Class LogMessage

java.lang.Object
  extended bynetcom.log.LogMessage
All Implemented Interfaces:
java.io.Serializable

public class LogMessage
extends java.lang.Object
implements java.io.Serializable

Title: LogMessage This is the object which is used to communicate between the logger and the GUI This object is sent via ObjectIOStream and thus has to implement Serializable Copyright: Copyright (c) 2002 Company NETCOM

See Also:
Serialized Form

Field Summary
static int DISCONNECT
           
static int LOG_ENTRIES
           
static int STATISTICS
           
 
Constructor Summary
LogMessage()
          Default Constructor
LogMessage(int the_type, int the_session, int from, int till, java.lang.String the_ip)
          Constructor Creates new LogMessage used when GUI wants LogEntries and asks by sending this
LogMessage(int the_type, java.lang.String the_ip)
          Creates new LogMessage used when GUI wants stats, or wants to disconnect ...
LogMessage(int mdsnode_type, java.lang.String the_name, java.lang.String the_IP, int the_port, int the__current_session, java.util.Collection the_friends, int the_num_connections)
          Creates new LogMessage that will be sent back to GUI upon request for stats of mds
LogMessage(int mdsnode_type, java.lang.String the_name, java.lang.String the_IP, int the_port, int the__current_session, int the_num_connections)
          Creates new LogMessage that will be sent back to GUI upon request for stats of proxy
LogMessage(int mdsnode_type, java.lang.String the_name, java.lang.String the_IP, int the_port, java.util.Vector the_log_sessions)
          LogMessage object that Logger will send back to GUI when GUI requests for LogEntries in a specified LogRange
 
Method Summary
 java.util.Collection getFreinds()
          accessor for Collection that holds the names of the friends of the node Only used if parent is mds node...
 java.lang.String getIP()
          accessor for IP of node that Logmessage is sent to
 java.util.Vector getLogEntries()
          accessor for Vector that holds the LogEntries that are requested for by GUI
 java.lang.String getNodeName()
          accessor for name of node that Logmessage is sent to
 int getNodeType()
          Accessor for variable that tells if logger is looging for a mds node or proxy node
 int getNumConnections()
          accessor for variable that holds number of connections the node has at time of request
 int getPort()
          accessor for variable that holds port number of parent node
 int getRangeFrom()
          Accessor for variable that tells where the range of requested Logentries begin
 int getRangeTo()
          Accessor for variable that tells where the range of requested Logentries end
 int getSession()
          Accessor for variable that tells which session we want logentries from
 int getType()
          accessor for variable that specifies the request type of GUI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATISTICS

public static final int STATISTICS
See Also:
Constant Field Values

LOG_ENTRIES

public static final int LOG_ENTRIES
See Also:
Constant Field Values

DISCONNECT

public static final int DISCONNECT
See Also:
Constant Field Values
Constructor Detail

LogMessage

public LogMessage()
Default Constructor


LogMessage

public LogMessage(int the_type,
                  java.lang.String the_ip)
Creates new LogMessage used when GUI wants stats, or wants to disconnect ... asks by sending this

Parameters:
the_type - 0 if asking for stats the_type, 2 if Disconnecting
the_ip - put the ip address of Logger the GUI sendig this will connect to you can put null if you don't know

LogMessage

public LogMessage(int the_type,
                  int the_session,
                  int from,
                  int till,
                  java.lang.String the_ip)
Constructor Creates new LogMessage used when GUI wants LogEntries and asks by sending this

Parameters:
the_type - 1 if asking for LogEntries
the_session - specifies session number the GUI wants LogEntries of
the_ip - put the ip address of Logger the GUI sendig this will connect to you can put null if you don't know

LogMessage

public LogMessage(int mdsnode_type,
                  java.lang.String the_name,
                  java.lang.String the_IP,
                  int the_port,
                  int the__current_session,
                  java.util.Collection the_friends,
                  int the_num_connections)
Creates new LogMessage that will be sent back to GUI upon request for stats of mds

Parameters:
mdsnode_type - you have to put 1 because you only use this when sending stats for mds
the_name - specifies the name of the mds node
the_IP - specifies the ip of parent mds
the_port - specifies port listening for proxy nodes
the__current_session - specifies current log session of the log file particular to that mds node
the_num_connections - specifies number of connections mds currently has

LogMessage

public LogMessage(int mdsnode_type,
                  java.lang.String the_name,
                  java.lang.String the_IP,
                  int the_port,
                  int the__current_session,
                  int the_num_connections)
Creates new LogMessage that will be sent back to GUI upon request for stats of proxy

Parameters:
mdsnode_type - you have to put 2 because you only use this when sending stats for proxy
the_name - specifies the name of the proxy node
the_IP - specifies the ip of parent proxy
the_port - specifies port listening for pclients/pservers
the__current_session - specifies current log session of the log file particular to that proxy node
the_num_connections - specifies number of connections proxy currently has

LogMessage

public LogMessage(int mdsnode_type,
                  java.lang.String the_name,
                  java.lang.String the_IP,
                  int the_port,
                  java.util.Vector the_log_sessions)
LogMessage object that Logger will send back to GUI when GUI requests for LogEntries in a specified LogRange

Parameters:
mdsnode_type - returns type of node parent of logger is... 1 if mds, 2 if proxy
the_name - returns name of parent node
the_IP - returns ip of parent node
the_port - returns port of parent node
the_log_sessions - returns Vector of LogEntries
Method Detail

getType

public int getType()
accessor for variable that specifies the request type of GUI

Returns:
type a private variable of integer type that specifies the type of request

getRangeFrom

public int getRangeFrom()
Accessor for variable that tells where the range of requested Logentries begin

Returns:
range_to a private variable of integer type that specifies where the logentries should begin from.

getRangeTo

public int getRangeTo()
Accessor for variable that tells where the range of requested Logentries end

Returns:
range_to a private variable of integer type that specifies where the logentries should end

getSession

public int getSession()
Accessor for variable that tells which session we want logentries from

Returns:
log_session_id a private variable of integer type that specifies where the desired session number

getNodeType

public int getNodeType()
Accessor for variable that tells if logger is looging for a mds node or proxy node

Returns:
node_type a private variable of integer type that specifies node type, if it's a proxy, return 1, if mds return 0

getNodeName

public java.lang.String getNodeName()
accessor for name of node that Logmessage is sent to

Returns:
name a string that tells the name of parent node of logger

getIP

public java.lang.String getIP()
accessor for IP of node that Logmessage is sent to

Returns:
ip the string that holds ip address of parent

getFreinds

public java.util.Collection getFreinds()
accessor for Collection that holds the names of the friends of the node Only used if parent is mds node... you need java 1.4 for this

Returns:
friends holds collection of InetSocketAddresses that are friends of parent mds node

getLogEntries

public java.util.Vector getLogEntries()
accessor for Vector that holds the LogEntries that are requested for by GUI

Returns:
log_sessions vector of Objects of type LogEntry that give detailed information about the log file to the GUI

getNumConnections

public int getNumConnections()
accessor for variable that holds number of connections the node has at time of request

Returns:
num_connections private var that holds number of connections parent node has

getPort

public int getPort()
accessor for variable that holds port number of parent node

Returns:
port private var that holds port of parent node