org.logicalcobwebs.proxool.admin
Class Snapshot

java.lang.Object
  extended by org.logicalcobwebs.proxool.admin.Snapshot
All Implemented Interfaces:
SnapshotIF

 class Snapshot
extends java.lang.Object
implements SnapshotIF

Implementation of SnapshotIF

Since:
Proxool 0.7
Version:
$Revision: 1.4 $, $Date: 2005/10/02 12:32:01 $
Author:
bill, $Author: billhorsman $ (current maintainer)

Field Summary
private  int activeConnectionCount
           
private  int availableConnectionCount
           
private  long connectionCount
           
private  java.util.Collection connectionInfos
           
private  java.util.Date dateStarted
           
private static Log LOG
           
private  int maximumConnectionCount
           
private  int offlineConnectionCount
           
private  long refusedCount
           
private  long servedCount
           
private  java.util.Date snapshotDate
           
 
Constructor Summary
Snapshot(java.util.Date snapshotDate)
           
 
Method Summary
 int getActiveConnectionCount()
          The number of active (busy) connections
 int getAvailableConnectionCount()
          The number of available (free) connections
 long getConnectionCount()
           
 ConnectionInfoIF getConnectionInfo(long id)
          The details of one connection.
 ConnectionInfoIF[] getConnectionInfos()
          The details of each connection.
 java.util.Date getDateStarted()
          When the pool was started
 int getMaximumConnectionCount()
          Get the maximum possible connections (as defined in the definition.
 int getOfflineConnectionCount()
          The number of offline connections.
 long getRefusedCount()
          How many connections have been refused since the pool started
 long getServedCount()
          How many connections have been served since the pool started
 java.util.Date getSnapshotDate()
          The date that this snapshot applies
 boolean isDetail()
          Whether we have requested detailed information about each connection
 void setActiveConnectionCount(int activeConnectionCount)
           
 void setAvailableConnectionCount(int availableConnectionCount)
           
 void setConnectionCount(long connectionCount)
           
 void setConnectionInfos(java.util.Collection connectionInfos)
           
 void setDateStarted(java.util.Date dateStarted)
           
 void setMaximumConnectionCount(int maximumConnectionCount)
           
 void setOfflineConnectionCount(int offlineConnectionCount)
           
 void setRefusedCount(long refusedCount)
           
 void setServedCount(long servedCount)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Log LOG

dateStarted

private java.util.Date dateStarted

servedCount

private long servedCount

refusedCount

private long refusedCount

activeConnectionCount

private int activeConnectionCount

availableConnectionCount

private int availableConnectionCount

offlineConnectionCount

private int offlineConnectionCount

maximumConnectionCount

private int maximumConnectionCount

snapshotDate

private java.util.Date snapshotDate

connectionInfos

private java.util.Collection connectionInfos

connectionCount

private long connectionCount
Constructor Detail

Snapshot

public Snapshot(java.util.Date snapshotDate)
Parameters:
snapshotDate - see SnapshotIF.getSnapshotDate()
Method Detail

getDateStarted

public java.util.Date getDateStarted()
Description copied from interface: SnapshotIF
When the pool was started

Specified by:
getDateStarted in interface SnapshotIF
Returns:
dateStarted
See Also:
SnapshotIF.getDateStarted()

setDateStarted

public void setDateStarted(java.util.Date dateStarted)
See Also:
SnapshotIF.getDateStarted()

getServedCount

public long getServedCount()
Description copied from interface: SnapshotIF
How many connections have been served since the pool started

Specified by:
getServedCount in interface SnapshotIF
Returns:
servedCount
See Also:
SnapshotIF.getServedCount()

setServedCount

public void setServedCount(long servedCount)
See Also:
SnapshotIF.getServedCount()

getRefusedCount

public long getRefusedCount()
Description copied from interface: SnapshotIF
How many connections have been refused since the pool started

Specified by:
getRefusedCount in interface SnapshotIF
Returns:
refusedCount
See Also:
SnapshotIF.getRefusedCount()

setRefusedCount

public void setRefusedCount(long refusedCount)
See Also:
SnapshotIF.getRefusedCount()

getActiveConnectionCount

public int getActiveConnectionCount()
Description copied from interface: SnapshotIF
The number of active (busy) connections

Specified by:
getActiveConnectionCount in interface SnapshotIF
Returns:
activeConnectionCount
See Also:
SnapshotIF.getActiveConnectionCount()

setActiveConnectionCount

public void setActiveConnectionCount(int activeConnectionCount)
See Also:
SnapshotIF.getActiveConnectionCount()

getAvailableConnectionCount

public int getAvailableConnectionCount()
Description copied from interface: SnapshotIF
The number of available (free) connections

Specified by:
getAvailableConnectionCount in interface SnapshotIF
Returns:
availableConnectionCount
See Also:
SnapshotIF.getAvailableConnectionCount()

setAvailableConnectionCount

public void setAvailableConnectionCount(int availableConnectionCount)
See Also:
SnapshotIF.getAvailableConnectionCount()

getOfflineConnectionCount

public int getOfflineConnectionCount()
Description copied from interface: SnapshotIF
The number of offline connections. A connection is offline if it is being tested by the house keeper.

Specified by:
getOfflineConnectionCount in interface SnapshotIF
Returns:
offlineConnectionCount
See Also:
SnapshotIF.getOfflineConnectionCount()

setOfflineConnectionCount

public void setOfflineConnectionCount(int offlineConnectionCount)
See Also:
SnapshotIF.getOfflineConnectionCount()

getMaximumConnectionCount

public int getMaximumConnectionCount()
Description copied from interface: SnapshotIF
Get the maximum possible connections (as defined in the definition.

Specified by:
getMaximumConnectionCount in interface SnapshotIF
Returns:
maximumConnectionCount
See Also:
SnapshotIF.getMaximumConnectionCount()

setMaximumConnectionCount

public void setMaximumConnectionCount(int maximumConnectionCount)
See Also:
SnapshotIF.getMaximumConnectionCount()

getSnapshotDate

public java.util.Date getSnapshotDate()
Description copied from interface: SnapshotIF
The date that this snapshot applies

Specified by:
getSnapshotDate in interface SnapshotIF
Returns:
snapshotDate
See Also:
SnapshotIF.getSnapshotDate()

getConnectionInfos

public ConnectionInfoIF[] getConnectionInfos()
Description copied from interface: SnapshotIF
The details of each connection. Will be null if this is not a detailed snapshot.

Specified by:
getConnectionInfos in interface SnapshotIF
Returns:
connectionInfos
See Also:
SnapshotIF.getConnectionInfos()

setConnectionInfos

public void setConnectionInfos(java.util.Collection connectionInfos)
See Also:
SnapshotIF.getConnectionInfos()

getConnectionInfo

public ConnectionInfoIF getConnectionInfo(long id)
Description copied from interface: SnapshotIF
The details of one connection. Will be null if this is not a detailed snapshot or if this ID is not found.

Specified by:
getConnectionInfo in interface SnapshotIF
Parameters:
id - the connection ID
Returns:
connectionInfo
See Also:
SnapshotIF.getConnectionInfo(long)

isDetail

public boolean isDetail()
Description copied from interface: SnapshotIF
Whether we have requested detailed information about each connection

Specified by:
isDetail in interface SnapshotIF
Returns:
detail
See Also:
SnapshotIF.isDetail()

getConnectionCount

public long getConnectionCount()
Specified by:
getConnectionCount in interface SnapshotIF

setConnectionCount

public void setConnectionCount(long connectionCount)