org.deltava.beans.acars
Class Bandwidth

java.lang.Object
  extended by org.deltava.beans.acars.Bandwidth
All Implemented Interfaces:
Comparable<Bandwidth>

public class Bandwidth
extends Object
implements Comparable<Bandwidth>

A bean to store ACARS bandwidth statistics.

Since:
2.1
Version:
3.0
Author:
Luke

Constructor Summary
Bandwidth(Date dt)
          Initializes the bean.
 
Method Summary
 int compareTo(Bandwidth bw2)
          Compares two beans by comparing their start dates and intervals.
 long getBytesIn()
          Returns the number of inbound bytes during the window.
 long getBytesOut()
          Returns the number of outbound bytes during the window.
 int getConnections()
          Returns the number of connections during the window.
 Date getDate()
          Returns the start date of the window.
 Date getEndDate()
          Returns the end date of the window.
 int getErrors()
          Returns the number of write errors during the window.
 int getInterval()
          Returns the window size.
 long getMaxBytes()
          Returns the maximum number of bytes transferred for the period.
 int getMaxConnections()
          Returns the maximum number of connections for the period.
 int getMaxMsgs()
          Returns the maximum number of messages for the period.
 int getMsgsIn()
          Returns the number of inbound messages during the window.
 int getMsgsOut()
          Returns the number of outbound messages during the window.
 int hashCode()
           
 void setBytes(long bytesIn, long bytesOut)
          Updates the bandwidth during the window.
 void setConnections(int cons)
          Updates the number of connections during the window.
 void setErrors(int errors)
          Updates the number of errors during the window.
 void setInterval(int interval)
          Sets the window size.
 void setMaxBytes(long bytes)
          Updates the maximum number of bytes transferred for the period.
 void setMaxConnections(int cons)
          Updates the maximum number of connections for the period.
 void setMaxMsgs(int msgs)
          Updates the maximum number of messages for the period.
 void setMessages(int msgIn, int msgOut)
          Updates the number of messages during the window.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Bandwidth

public Bandwidth(Date dt)
Initializes the bean.

Parameters:
dt - the start/date of this window
Throws:
NullPointerException - if dt is null
Method Detail

getDate

public Date getDate()
Returns the start date of the window.

Returns:
the window start date/time

getEndDate

public Date getEndDate()
Returns the end date of the window.

Returns:
the window end date/time

getInterval

public int getInterval()
Returns the window size.

Returns:
the window size in minutes

getConnections

public int getConnections()
Returns the number of connections during the window.

Returns:
the number of connections

getMsgsIn

public int getMsgsIn()
Returns the number of inbound messages during the window.

Returns:
the number of messages

getMsgsOut

public int getMsgsOut()
Returns the number of outbound messages during the window.

Returns:
the number of messages

getBytesIn

public long getBytesIn()
Returns the number of inbound bytes during the window.

Returns:
the number of bytes

getBytesOut

public long getBytesOut()
Returns the number of outbound bytes during the window.

Returns:
the number of bytes

getErrors

public int getErrors()
Returns the number of write errors during the window.

Returns:
the number of errors

getMaxConnections

public int getMaxConnections()
Returns the maximum number of connections for the period.

Returns:
the number of connections

getMaxMsgs

public int getMaxMsgs()
Returns the maximum number of messages for the period.

Returns:
the number of messages

getMaxBytes

public long getMaxBytes()
Returns the maximum number of bytes transferred for the period.

Returns:
the number of bytes

setConnections

public void setConnections(int cons)
Updates the number of connections during the window.

Parameters:
cons - the number of connections

setErrors

public void setErrors(int errors)
Updates the number of errors during the window.

Parameters:
errors - the number of errors

setMessages

public void setMessages(int msgIn,
                        int msgOut)
Updates the number of messages during the window.

Parameters:
msgIn - the number of inbound messages
msgOut - the number of outbound messages

setBytes

public void setBytes(long bytesIn,
                     long bytesOut)
Updates the bandwidth during the window.

Parameters:
bytesIn - the number of bytes in
bytesOut - the number of bytes out

setMaxConnections

public void setMaxConnections(int cons)
Updates the maximum number of connections for the period. This is only populated if the window is greater than one minute.

Parameters:
cons - the maximum number of connections

setMaxMsgs

public void setMaxMsgs(int msgs)
Updates the maximum number of messages for the period. This is only populated if the window is greater than one minute.

Parameters:
msgs - the maximum number of messages

setMaxBytes

public void setMaxBytes(long bytes)
Updates the maximum number of bytes transferred for the period. This is only populated if the window is greater than one minute.

Parameters:
bytes - the maximum number of bytes

setInterval

public void setInterval(int interval)
Sets the window size.

Parameters:
interval - the size in minutes

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Bandwidth bw2)
Compares two beans by comparing their start dates and intervals.

Specified by:
compareTo in interface Comparable<Bandwidth>


Copyright © 2004-2009 Global Virtual Airlines Group. All Rights Reserved.