ServerData< DataSource > Class Template Reference
[Fountain server]

Encapsulates server speific data sources. More...

#include <ServerData.h>

List of all members.

Public Types

typedef DataSource::HashTable NodeHashTable
 Shorthand so we don't have to type this STL crap each time we want to iterate over the node monitor database.

Public Member Functions

void discover ()
 Discovers the server specific data.
void update ()
 Update the data discovered.
time_t getUpdateInterval () const
 Get the the DataSource object update interval.
void setUpdateInterval (time_t interval)
 Set the the DataSource object update interval.
time_t getLastDiscoverTime () const
 Get the last time the DataSource object was discovered.
time_t getLastUpdateTime () const
 Get the last time the DataSource object was updated.

Static Public Member Functions

static ServerDatagetInstance (NodeHashTable &nodeMonitorDatabase)
 Get the singleton instance of the ServerData object.

Protected Member Functions

 ServerData (NodeHashTable &nodeMonitorDatabase)
 Protected constructor since we are using a singleton design pattern.

Private Member Functions

 ServerData (const ServerData &rhs)
 Private copy constructor so ServerData objects cannot be sliced.
ServerDataoperator= (const ServerData &rhs)
 Private assignment operator so ServerData objects cannot be sliced.

Private Attributes

time_t lastDiscoverTime
time_t lastUpdateTime
time_t updateInterval


Detailed Description

template<class DataSource>
class ServerData< DataSource >

Encapsulates server speific data sources.

Todo:
make this class a Loki singleton. sjm 3-7-2006.
This host class prescribes a single policy class, the DataSource policy which requires the following interface:
  1. A public NodeDataType typedef containing the NodeData object to use for this data source
  2. A public HashTable typedef containing the container type to use for the Fountain Server's node monitor database
  3. A protected explicit constructor taking a single HashTable reference parameter
  4. A protected void discover method to discover the data source
  5. A protected void update method to update the data source
  6. A protected appendInfo(BambooLib::XMLElement*, const std::string&) method returning SUCCESS or FAILURE
  7. A public void parseNodelistFile method

This class uses a Singleton design pattern since the Fountain Server only supports a single server specific data source.


Member Function Documentation

template<class DataSource>
void ServerData< DataSource >::discover  )  [inline]
 

Discovers the server specific data.

Exceptions:
FountainException if the data source could not be discovered

template<class DataSource>
static ServerData* ServerData< DataSource >::getInstance NodeHashTable nodeMonitorDatabase  )  [inline, static]
 

Get the singleton instance of the ServerData object.

Parameters:
nodeMonitorDatabase reference to the node monitor database used by the Fountain server
Exceptions:
FountainException If the ServerData object could not be created
Returns:
A pointer to the singleton ServerData object

template<class DataSource>
time_t ServerData< DataSource >::getLastDiscoverTime  )  const [inline]
 

Get the last time the DataSource object was discovered.

Returns:
the last time this data source was discovered

template<class DataSource>
time_t ServerData< DataSource >::getLastUpdateTime  )  const [inline]
 

Get the last time the DataSource object was updated.

Returns:
the last time this data source was updated

template<class DataSource>
time_t ServerData< DataSource >::getUpdateInterval  )  const [inline]
 

Get the the DataSource object update interval.

Returns:
the number of seconds between DataSource object updates

template<class DataSource>
void ServerData< DataSource >::setUpdateInterval time_t  interval  )  [inline]
 

Set the the DataSource object update interval.

Parameters:
interval The number of seconds betweenDataSource object updates


Member Data Documentation

template<class DataSource>
time_t ServerData< DataSource >::lastDiscoverTime [private]
 

The time the DataSource object was last discovered

template<class DataSource>
time_t ServerData< DataSource >::lastUpdateTime [private]
 

The time the DataSource object was last updated

template<class DataSource>
time_t ServerData< DataSource >::updateInterval [private]
 

The time between DataSource object updates


The documentation for this class was generated from the following file:
Generated on Wed Mar 8 14:43:33 2006 for Fountain by  doxygen 1.4.6