Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

LcgInfo::SQLtoSQLQuerier Class Reference

This class is used to pose a SQL query expressed in terms of the canonical schema, to the implementated SQL information system. More...

#include <SQLtoSQLQuerier.h>

Inheritance diagram for LcgInfo::SQLtoSQLQuerier:

LcgInfo::Querier List of all members.

Public Methods

 SQLtoSQLQuerier ()
 Constructor.

virtual ~SQLtoSQLQuerier ()
 Destructor of the class.

virtual void setConfig (LcgConfigBuffer::ConfigBuffer &pConf)
 Sets the config buffer object, so that all necessary information for queries is available. More...

virtual std::vector< std::vector<
std::string > > 
query (std::string const &pQueryCanonical)
 Translates the specified SQL query (intended to be posed to the canonical schema) and poses it to the implemented SQL schema, in order to retrieve the same information. More...


Protected Attributes

LcgConfigBuffer::ConfigBuffermConf
 A pointer to the object that reads the configuration file and holds the information there contained. More...

LcgConfigBuffer::ConfigBuffermMap
 A pointer to the object that holds the mapping information (between the canonical and the implementation views of the schema). More...

SQLtoSQLQueryTranslatormTranslator
 A pointer to the translator that will perform the translation to the original SQL query to one that can be posed to the implemented SQL information service.

InfoFromLDAP * mSql
 A pointer to the SQL interface that will be used to query the implemented SQL information service.


Detailed Description

This class is used to pose a SQL query expressed in terms of the canonical schema, to the implementated SQL information system.

It extends the Querier class. All the necessary configuration information is provided using a ConfigBuffer object.

Author:
LCG's EIS Group. CERN.
Version:
1.0
Date:
2004

Definition at line 24 of file SQLtoSQLQuerier.h.


Member Function Documentation

vector< vector< string > > SQLtoSQLQuerier::query std::string const &    pQueryCanonical [virtual]
 

Translates the specified SQL query (intended to be posed to the canonical schema) and poses it to the implemented SQL schema, in order to retrieve the same information.

It may throw a LcgInfoException if the configuration file was not properly set or if there is some error in the translation or the interaction with the information service.

Parameters:
pQueryCanonical  the query to be translated
Returns:
the result values of the query (in a table format)

Implements LcgInfo::Querier.

Definition at line 62 of file SQLtoSQLQuerier.cpp.

References LcgInfo::int2str, mSql, and mTranslator.

void SQLtoSQLQuerier::setConfig LcgConfigBuffer::ConfigBuffer   pConf [virtual]
 

Sets the config buffer object, so that all necessary information for queries is available.

The query method will fail if this method has not been called first. It may throw a ConfigBufferException if no attribute found, or a QueryTranslationException if the mapping file is not found.

Parameters:
pConf  the object with the configuration information

Implements LcgInfo::Querier.

Definition at line 43 of file SQLtoSQLQuerier.cpp.

References LcgConfigBuffer::ConfigBuffer::get_attribute_value, LcgInfo::int2str, mConf, mMap, mSql, mTranslator, and LcgConfigBuffer::ConfigBuffer::populate_from_config.


Member Data Documentation

LcgConfigBuffer::ConfigBuffer* LcgInfo::SQLtoSQLQuerier::mConf [protected]
 

A pointer to the object that reads the configuration file and holds the information there contained.

The object itself is instantiated outside this class (otherwise is NULL and the query() method will not work).

Definition at line 69 of file SQLtoSQLQuerier.h.

Referenced by setConfig.

LcgConfigBuffer::ConfigBuffer* LcgInfo::SQLtoSQLQuerier::mMap [protected]
 

A pointer to the object that holds the mapping information (between the canonical and the implementation views of the schema).

The name of the file from which this object is build is retrieved from mConf.

Definition at line 76 of file SQLtoSQLQuerier.h.

Referenced by setConfig.


The documentation for this class was generated from the following files:
Generated on Tue Oct 5 14:42:45 2004 for LCG Information System Interface by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002