/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes
DbiSvc Class Reference

#include <DbiSvc.h>

Inheritance diagram for DbiSvc:
Inheritance graph
[legend]
Collaboration diagram for DbiSvc:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DbiSvc (const std::string &name, ISvcLocator *sl)
virtual ~DbiSvc ()
virtual StatusCode reinitialize ()
virtual StatusCode initialize ()
virtual StatusCode finalize ()
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
virtual StatusCode ShowStatistics () const
virtual void updateOutputLevel (Property &)
virtual void updateRollbackDates (Property &)
virtual void updateExtraConditions (Property &)
virtual void updateLevel2Cache (Property &)
virtual void updateConnectionsPermanent (Property &)
virtual void updateOrderContextQuery (Property &)
void info (const char *s)

Static Public Member Functions

static const InterfaceID & interfaceID ()

Public Attributes

IntegerProperty mOutputLevel
StringProperty mRollbackDates
StringProperty mExtraConditions
StringProperty mLevel2Cache
BooleanProperty mConnectionsPermanent
BooleanProperty mOrderContextQuery

Private Attributes

IMessageSvc * m_msgSvc

Detailed Description

Definition at line 15 of file DbiSvc.h.


Constructor & Destructor Documentation

DbiSvc::DbiSvc ( const std::string &  name,
ISvcLocator *  sl 
)

Definition at line 11 of file DbiSvc.cc.

       : Service(name, sl),   
         m_msgSvc(0)
{
  LOG(dbi,Logging::kVerbose) << "DbiSvc created";

  // Declare settings:
  // Note.. ensure these defaults match DBI.
  declareProperty( "OutputLevel",          mOutputLevel = Logging::kInfo, "Log output verbosity");
  declareProperty( "RollbackDates",        mRollbackDates = "",          "A list of <tablename>=<date> strings. Wildcards allowed in table names.");
  declareProperty( "ExtraConditions",      mExtraConditions = "",        "An @ delimited string containing  <tablename>=<condition> pairs. Wildcards allowed in table names.");
  declareProperty( "Level2Cache",          mLevel2Cache = "",             "Where to put cache files. Null string for cache off (default).");
  declareProperty( "ConnectionsPermanent", mConnectionsPermanent = false, "Set true to make connections to MySQL server peramanent");
  declareProperty( "OrderContextQuery",    mOrderContextQuery = false,    "Set true to order context queries");

  mOutputLevel          .declareUpdateHandler(&DbiSvc::updateOutputLevel         ,this);
  mRollbackDates        .declareUpdateHandler(&DbiSvc::updateRollbackDates       ,this);
  mExtraConditions      .declareUpdateHandler(&DbiSvc::updateExtraConditions     ,this);
  mLevel2Cache          .declareUpdateHandler(&DbiSvc::updateLevel2Cache         ,this);
  mConnectionsPermanent .declareUpdateHandler(&DbiSvc::updateConnectionsPermanent,this);
  mOrderContextQuery    .declareUpdateHandler(&DbiSvc::updateOrderContextQuery   ,this);
}
DbiSvc::~DbiSvc ( ) [virtual]

Definition at line 34 of file DbiSvc.cc.

{
}

Member Function Documentation

StatusCode DbiSvc::reinitialize ( ) [virtual]

Definition at line 47 of file DbiSvc.cc.

{
  // Initialize the DBI (if it hasn't been done already)
  DbiTableProxyRegistry::Instance();
  if(DbiTableProxyRegistry::IsActive()) return StatusCode::SUCCESS;
  return StatusCode::FAILURE;
}
StatusCode DbiSvc::initialize ( ) [virtual]

Definition at line 55 of file DbiSvc.cc.

{
  StatusCode sc;

  sc = Service::initialize();
  if( sc.isFailure() ) return sc;

  m_msgSvc = msgSvc();
  if( !m_msgSvc ) return StatusCode::FAILURE;

  info("initialize DbiTableProxyRegistry");

  // Set my own properties
  sc = setProperties();
  if (sc.isFailure()) return sc;
  
  // Initialize the DBI (if it hasn't been done already)
  DbiTableProxyRegistry::Instance();  
  if(DbiTableProxyRegistry::IsActive()) return StatusCode::SUCCESS;
  return StatusCode::FAILURE;
}
StatusCode DbiSvc::finalize ( ) [virtual]

Definition at line 77 of file DbiSvc.cc.

{
  // Print out goodies.
  ShowStatistics();
  
  // Attempt to shut down DBI. This may fail.
  if(DbiTableProxyRegistry::fgInstance)
    delete DbiTableProxyRegistry::fgInstance;
  DbiTableProxyRegistry::fgInstance = 0;
  
  return StatusCode::SUCCESS;
}
StatusCode DbiSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvInterface 
) [virtual]

Definition at line 91 of file DbiSvc.cc.

{
  StatusCode sc = StatusCode::FAILURE;
  if (ppvInterface) {
    *ppvInterface = 0;

    if (IDbiSvc::interfaceID().versionMatch(riid)) {
      *ppvInterface = static_cast<IDbiSvc*>(this);
      sc = StatusCode::SUCCESS;
      addRef();
    }
    else sc = Service::queryInterface( riid, ppvInterface );
  }
  return sc;
}
StatusCode DbiSvc::ShowStatistics ( ) const [virtual]

Implements IDbiSvc.

Definition at line 149 of file DbiSvc.cc.

{
  return StatusCode::SUCCESS;  
}
void DbiSvc::updateOutputLevel ( Property &  ) [virtual]

Definition at line 114 of file DbiSvc.cc.

{
  info("updateOutputLevel"); 
  dbi().Enable(mOutputLevel);
}
void DbiSvc::updateRollbackDates ( Property &  ) [virtual]

Definition at line 120 of file DbiSvc.cc.

void DbiSvc::updateExtraConditions ( Property &  ) [virtual]

Definition at line 126 of file DbiSvc.cc.

void DbiSvc::updateLevel2Cache ( Property &  ) [virtual]
void DbiSvc::updateConnectionsPermanent ( Property &  ) [virtual]
void DbiSvc::updateOrderContextQuery ( Property &  ) [virtual]

Definition at line 142 of file DbiSvc.cc.

void DbiSvc::info ( const char *  s)

Definition at line 38 of file DbiSvc.cc.

                                {
  if( !m_msgSvc ){
      m_msgSvc = msgSvc();
   }
   std::ostringstream msgStr;
   msgStr << s ;
   m_msgSvc->reportMessage("DbiSvc",MSG::INFO,msgStr.str());
}
static const InterfaceID& IDbiSvc::interfaceID ( ) [inline, static, inherited]

Definition at line 12 of file IDbiSvc.h.

{ return IID_IDbiSvc; }

Member Data Documentation

IntegerProperty DbiSvc::mOutputLevel

Definition at line 44 of file DbiSvc.h.

StringProperty DbiSvc::mRollbackDates

Definition at line 45 of file DbiSvc.h.

StringProperty DbiSvc::mExtraConditions

Definition at line 46 of file DbiSvc.h.

StringProperty DbiSvc::mLevel2Cache

Definition at line 47 of file DbiSvc.h.

Definition at line 48 of file DbiSvc.h.

BooleanProperty DbiSvc::mOrderContextQuery

Definition at line 49 of file DbiSvc.h.

IMessageSvc* DbiSvc::m_msgSvc [private]

Definition at line 53 of file DbiSvc.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:56:53 for DbiSvc by doxygen 1.7.4