All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class calypso.core.atmswitch.SwitchStatistics

java.lang.Object
   |
   +----calypso.core.atmswitch.SwitchStatistics

public class SwitchStatistics
extends Object
Keeps record of statistical data for each port in the FSR-switch.

Author:
Kim Lahti / TCM laboratory / HUT

Variable Index

 o DEFAULT_SPEED_DISPLAY_ENABLED
Constant to define if the default mode is, to take the amount of cells transfered every second NOTE ! If true default view_port and view_info must be set.
 o DEFAULT_UPDATE_INTERFACE_AND_TYPE
Constant to define if the default mode is, to update the interfaces and port types every minute or not.
 o listeners
Vector object keeping knowledge about current listeners.
 o ONE_DAY_IN_HOURS
Constant that is used to define the length of a day in hours.
 o ONE_DAY_IN_MILLIS
Constant that is used to define the length of a day in milliseconds.
 o ONE_HOUR_IN_MILLIS
Constant that is used to define the length of an hour in milliseconds.
 o ONE_MINUTE_IN_MILLIS
Constant that is used to define the length of a minute in milliseconds.
 o ONE_MINUTE_IN_SECONDS
Constant that is used to define the length of a minute in seconds.
 o ONE_SECOND_IN_MILLIS
Constant that is used to define the length of the interval investigated, in this case the length of a second in milliseconds.
 o PORT_INFO
Constant that is used to define the number of info parameters obtained with method getInfo.

Constructor Index

 o SwitchStatistics(int)

Method Index

 o addStatisticsListener(StatisticsListener)
Method to add listener.
 o getStartTime()
Gets the time when the switch was started.
 o getTotal()
Gets the total amount since the switch was started.
 o notifyInterfaceChanged(int[])
Method that notifies the event to all listeners.
 o notifyMinute(int[][])
Method that notifies the event to all listeners.
 o notifyPortTypeChanged(int[])
Method that notifies the event to all listeners.
 o notifySecond(int)
Method that notifies the event to all listeners.
 o removeStatisticsListener(StatisticsListener)
Method to remove listener.
 o setSpeedDisplay(boolean, int, int)
Enables the cells per second check.

Variables

 o listeners
 protected Vector listeners
Vector object keeping knowledge about current listeners.

 o DEFAULT_SPEED_DISPLAY_ENABLED
 protected static final boolean DEFAULT_SPEED_DISPLAY_ENABLED
Constant to define if the default mode is, to take the amount of cells transfered every second NOTE ! If true default view_port and view_info must be set.

 o DEFAULT_UPDATE_INTERFACE_AND_TYPE
 protected static final boolean DEFAULT_UPDATE_INTERFACE_AND_TYPE
Constant to define if the default mode is, to update the interfaces and port types every minute or not.

 o ONE_SECOND_IN_MILLIS
 protected static final int ONE_SECOND_IN_MILLIS
Constant that is used to define the length of the interval investigated, in this case the length of a second in milliseconds.

 o ONE_MINUTE_IN_MILLIS
 protected static final int ONE_MINUTE_IN_MILLIS
Constant that is used to define the length of a minute in milliseconds.

 o ONE_HOUR_IN_MILLIS
 protected static final int ONE_HOUR_IN_MILLIS
Constant that is used to define the length of an hour in milliseconds.

 o ONE_DAY_IN_MILLIS
 protected static final int ONE_DAY_IN_MILLIS
Constant that is used to define the length of a day in milliseconds.

 o ONE_MINUTE_IN_SECONDS
 protected static final int ONE_MINUTE_IN_SECONDS
Constant that is used to define the length of a minute in seconds.

 o ONE_DAY_IN_HOURS
 protected static final int ONE_DAY_IN_HOURS
Constant that is used to define the length of a day in hours.

 o PORT_INFO
 protected static final int PORT_INFO
Constant that is used to define the number of info parameters obtained with method getInfo.

Constructors

 o SwitchStatistics
 protected SwitchStatistics(int maxPortNumber_)

Methods

 o getStartTime
 protected Calendar getStartTime()
Gets the time when the switch was started.

 o setSpeedDisplay
 protected void setSpeedDisplay(boolean isEnabled_,
                                int port_,
                                int info_)
Enables the cells per second check.

 o getTotal
 protected synchronized long[][] getTotal()
Gets the total amount since the switch was started. This method is used if listener wants to get total amount. Listener calls this mehtod and updates total amount with the oneSecond notification.

Returns:
Returns the result of the query.
 o removeStatisticsListener
 public synchronized void removeStatisticsListener(StatisticsListener sl_)
Method to remove listener.

Parameters:
sl_ - The listener removed.
 o addStatisticsListener
 public synchronized void addStatisticsListener(StatisticsListener sl_)
Method to add listener.

Parameters:
sl_ - The listener added.
 o notifySecond
 protected void notifySecond(int value_)
Method that notifies the event to all listeners.

Parameters:
value_ - The value of events occured to the switch.
 o notifyMinute
 protected void notifyMinute(int value_[][])
Method that notifies the event to all listeners.

Parameters:
value_ - The value of events occured to the switch.
 o notifyInterfaceChanged
 protected void notifyInterfaceChanged(int interfaces_[])
Method that notifies the event to all listeners.

Parameters:
interfaces_ - The value of events occured to the switch.
 o notifyPortTypeChanged
 protected void notifyPortTypeChanged(int portTypes_[])
Method that notifies the event to all listeners.

Parameters:
portTypes_ - The value of events occured to the switch.

All Packages  Class Hierarchy  This Package  Previous  Next  Index