code::IndexMonitor Class Reference

List of all members.

Detailed Description

This is a singleton that monitors the supplied Index objects, reconnecting to the Indexes if no records are received in the time specified.

Author:
Lakshman
Version:
Id
code_IndexMonitor.h,v 1.3 2009/06/02 20:17:39 lakshman Exp


Public Member Functions

void addIndex (SmartPtr< Index > index, const TimeInterval &maximumTimeBetweenRecords)
 The IndexMonitor takes over this Index at this point.
SmartPtr< IndexgetIndexByName (const std::string &name)
 Don't keep this index beyond this call; on the next timer, we may reconnect and the index will then be invalid.
SmartPtr< IndexgetIndexByURL (const URL &url)
 Don't keep this index beyond this call; on the next timer, we may reconnect and the index will then be invalid.
void checkIndexes ()
 This method is called through a timer.

Static Public Member Functions

static IndexMonitorinstance (time_t checkingInterval=60)
 By default, we'll check every 60 seconds.

Classes

struct  IndexInfo


Member Function Documentation

void code::IndexMonitor::addIndex ( SmartPtr< Index index,
const TimeInterval maximumTimeBetweenRecords 
)

The IndexMonitor takes over this Index at this point.

Do not retain the SmartPtr<Index> any more, because if the IndexMonitor reconnects, your pointer will no longer be valid. Get the index by name or url if needed. Note: we don't check to see if we already have the index.

void code::IndexMonitor::checkIndexes (  ) 

This method is called through a timer.

There is no need for clients to call it explicitly.

SmartPtr<Index> code::IndexMonitor::getIndexByName ( const std::string &  name  ) 

Don't keep this index beyond this call; on the next timer, we may reconnect and the index will then be invalid.

SmartPtr<Index> code::IndexMonitor::getIndexByURL ( const URL url  ) 

Don't keep this index beyond this call; on the next timer, we may reconnect and the index will then be invalid.

static IndexMonitor& code::IndexMonitor::instance ( time_t  checkingInterval = 60  )  [static]

By default, we'll check every 60 seconds.

The first call to this method gets the checkingInterval. subsequent callers can not change it.


Generated on Fri May 4 13:40:13 2012 for WDSS-IIw2 by  doxygen 1.4.7