ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
pool::IStorageExplorer Class Referenceabstract

#include <StorageSvc/IStorageExplorer.h>

Inheritance diagram for pool::IStorageExplorer:
Collaboration diagram for pool::IStorageExplorer:

Public Types

typedef std::pair< std::string, std::string > Parameter
 Database parameter definition. More...
 
typedef std::vector< ParameterParameters
 Database parameter container definition. More...
 

Public Member Functions

virtual DbStatus queryInterface (const Guid &riid, void **ppvUnkn)=0
 IInterface implementation: Query interfaces of Interface. More...
 
virtual unsigned int addRef ()=0
 IInterface implementation: Reference Interface instance
More...
 
virtual unsigned int release ()=0
 IInterface implementation: Release Interface instance
More...
 
virtual DbStatus startSession (int mode, int tech, SessionH &session)=0
 Start a new Database Session. More...
 
virtual DbStatus endSession (const SessionH session)=0
 End the Database session. More...
 
virtual DbStatus connect (const SessionH sessionH, int mode, FileDescriptor &refDB)=0
 Connect to a logical Database unit. More...
 
virtual DbStatus disconnect (FileDescriptor &refDB)=0
 Disconnect from a logical Database unit. More...
 
virtual long long int databaseSize (FileDescriptor &refDB) const =0
 Access the size of the database: May be undefined for some technologies. More...
 
virtual DbStatus containers (FileDescriptor &refDB, std::vector< const Token * > &conts, bool intern=false)=0
 Access the containers in a given database. More...
 
virtual DbStatus associations (FileDescriptor &refDB, std::vector< const Token * > &assocs)=0
 Access the container level associations between objects. More...
 
virtual DbStatus shapes (FileDescriptor &refDB, std::vector< ShapeH > &shapes)=0
 Access Shapes known to the database. More...
 
virtual DbStatus addDbParam (FileDescriptor &refDB, const std::string &nam, const std::string &val)=0
 Add a persistent parameter to the database. More...
 
virtual DbStatus dbParam (FileDescriptor &refDB, const std::string &nam, std::string &val)=0
 Retrieve existing parameter by name. More...
 
virtual DbStatus dbParams (FileDescriptor &refDB, Parameters &vals)=0
 Retrieve all parameters. More...
 
virtual DbStatus getDomainOption (const SessionH sessionH, DbOption &opt)=0
 Access options for a given database domain. More...
 
virtual DbStatus setDomainOption (const SessionH sessionH, const DbOption &opt)=0
 Set options for a given database domain. More...
 
virtual DbStatus getDatabaseOption (FileDescriptor &refDB, DbOption &opt)=0
 Access options for a given database. More...
 
virtual DbStatus setDatabaseOption (FileDescriptor &refDB, const DbOption &opt)=0
 Set options for a given database. More...
 
virtual DbStatus getContainerOption (FileDescriptor &refDB, const std::string &cntName, DbOption &opt)=0
 Access options for a given database container. More...
 
virtual DbStatus setContainerOption (FileDescriptor &refDB, const std::string &cntName, const DbOption &opt)=0
 Set options for a given database container. More...
 
virtual DbStatus select (FileDescriptor &refDB, const std::string &cntName, DbSelect &sel)=0
 Initiate a selection on a given container. More...
 
virtual DbStatus next (DbSelect &context, Token *&refpTok)=0
 Access the next token of a sequence. More...
 

Static Public Member Functions

static const GuidinterfaceID ()
 Retrieve interface ID. More...
 

Protected Member Functions

virtual ~IStorageExplorer ()
 Destructor (called only by sub-classes) More...
 

Detailed Description

The IStorageExplorer interface is able to handle user request for

Author
Markus Frank
Version
1.0

Definition at line 53 of file IStorageExplorer.h.

Member Typedef Documentation

◆ Parameter

typedef std::pair<std::string, std::string> pool::IStorageExplorer::Parameter

Database parameter definition.

Definition at line 60 of file IStorageExplorer.h.

◆ Parameters

Database parameter container definition.

Definition at line 62 of file IStorageExplorer.h.

Constructor & Destructor Documentation

◆ ~IStorageExplorer()

virtual pool::IStorageExplorer::~IStorageExplorer ( )
inlineprotectedvirtual

Destructor (called only by sub-classes)

Definition at line 56 of file IStorageExplorer.h.

56 { }

Member Function Documentation

◆ addDbParam()

virtual DbStatus pool::IStorageExplorer::addDbParam ( FileDescriptor refDB,
const std::string &  nam,
const std::string &  val 
)
pure virtual

Add a persistent parameter to the database.

Add a user specified parameter to the database. The database must be open in CREATE or UPDATE mode.

Parameters
refDB[IN] Reference to Database descriptor
nam[IN] Name of the user parameter to be added.
val[IN] Value of the user parameter to be added.
Returns
DbStatus code indicating success or failure.

Implemented in pool::DbStorageExplorer.

◆ addRef()

virtual unsigned int pool::IStorageExplorer::addRef ( )
pure virtual

IInterface implementation: Reference Interface instance

Implemented in pool::DbStorageExplorer.

◆ associations()

virtual DbStatus pool::IStorageExplorer::associations ( FileDescriptor refDB,
std::vector< const Token * > &  assocs 
)
pure virtual

Access the container level associations between objects.

Parameters
refDB[IN] Reference to Database descriptor
assocs[OUT] Vector with tokens to used containers.
Returns
DbStatus code indicating success or failure.

◆ connect()

virtual DbStatus pool::IStorageExplorer::connect ( const SessionH  sessionH,
int  mode,
FileDescriptor refDB 
)
pure virtual

Connect to a logical Database unit.

A connection is equivalent to the triple (OCISession, OCIServer, OCISvcCtx) in ORACLE, a login to a datasource using ODBC, or a single federation for Objectivity. For file based technologies, such as root, MS Access, ODBC/Text etc., this is involves the opening of the requested file.

Parameters
sessionH[IN] Session context to be used to open the Database.
mode[IN] Flag to indicate the accessmode of the session. READ, NEW/CREATE/WRITE, UPDATE, RECREATE.
refDB[I/O] Descriptor of the Database to be opened. On successful return the Database handle is valid.
Returns
DbStatus code indicating success or failure.

Implemented in pool::DbStorageExplorer.

◆ containers()

virtual DbStatus pool::IStorageExplorer::containers ( FileDescriptor refDB,
std::vector< const Token * > &  conts,
bool  intern = false 
)
pure virtual

Access the containers in a given database.

Parameters
refDB[IN] Reference to Database descriptor
conts[OUT] Vector with tokens to used containers.
intern[IN] Flag to access also internal containers
Returns
DbStatus code indicating success or failure.

◆ databaseSize()

virtual long long int pool::IStorageExplorer::databaseSize ( FileDescriptor refDB) const
pure virtual

Access the size of the database: May be undefined for some technologies.

Parameters
refDB[IN] Descriptor of the Database access. This handle was retrieved when connecting to the logical Database.
Returns
Database size. std::string::npos in case of failure.

Implemented in pool::DbStorageExplorer.

◆ dbParam()

virtual DbStatus pool::IStorageExplorer::dbParam ( FileDescriptor refDB,
const std::string &  nam,
std::string &  val 
)
pure virtual

Retrieve existing parameter by name.

Retrieve single user specified parameter from the database.

Parameters
refDB[IN] Reference to Database descriptor
nam[IN] Name of the user parameter to be retrieved.
val[OUT] Value of the user parameter to be retrieved.
Returns
DbStatus code indicating success or failure.

Implemented in pool::DbStorageExplorer.

◆ dbParams()

virtual DbStatus pool::IStorageExplorer::dbParams ( FileDescriptor refDB,
Parameters vals 
)
pure virtual

Retrieve all parameters.

Retrieve all user parameters from the database.

Parameters
refDB[IN] Reference to Database descriptor
vals[OUT] Vector containing all parameter nam/value pairs.
Returns
DbStatus code indicating success or failure.

Implemented in pool::DbStorageExplorer.

◆ disconnect()

virtual DbStatus pool::IStorageExplorer::disconnect ( FileDescriptor refDB)
pure virtual

Disconnect from a logical Database unit.

The request for disconnect requires, that all pending Transactions are already commited. Otherwise data are lost. On disconnection the access to the Database is finalized, closed. The token will be invalidated may not be used at any longer after disconnection.

Parameters
refDB[IN] Descriptor of the Database access. This handle was retrieved when connecting to the logical Database. On successful return the Database handle will be invalidated.
Returns
DbStatus code indicating success or failure.

Implemented in pool::DbStorageExplorer.

◆ endSession()

virtual DbStatus pool::IStorageExplorer::endSession ( const SessionH  session)
pure virtual

End the Database session.

The request to end a Database session requires, that all pending Transactions and connections are closed. Otherwise internally the close will be forced and potentially data on pending Transactions will be lost. The token will be invalidated may not be used at any longer once the session ended.

Parameters
session[IN] Handle to the Database session. This handle was retrieved when starting the session.
Returns
DbStatus code indicating success or failure.

Implemented in pool::DbStorageExplorer.

◆ getContainerOption()

virtual DbStatus pool::IStorageExplorer::getContainerOption ( FileDescriptor refDB,
const std::string &  cntName,
DbOption opt 
)
pure virtual

Access options for a given database container.

Note: The options depend on the underlying implementation and are not normalized.

Parameters
refDB[IN] Reference to Database descriptor
cntName[IN] Name of the database container
opt[IN] Reference to option object.
Returns
DbStatus code indicating success or failure.

Implemented in pool::DbStorageExplorer.

◆ getDatabaseOption()

virtual DbStatus pool::IStorageExplorer::getDatabaseOption ( FileDescriptor refDB,
DbOption opt 
)
pure virtual

Access options for a given database.

Note: The options depend on the underlying implementation and are not normalized.

Parameters
refDB[IN] Reference to Database descriptor
opt[IN] Reference to option object.
Returns
DbStatus code indicating success or failure.

Implemented in pool::DbStorageExplorer.

◆ getDomainOption()

virtual DbStatus pool::IStorageExplorer::getDomainOption ( const SessionH  sessionH,
DbOption opt 
)
pure virtual

Access options for a given database domain.

Domain options are global options, which refer to the database technology and not to a particular connection.

Note: The options depend on the underlying implementation and are not normalized.

Parameters
sessionH[IN] Session context to be used to open the Database.
opt[IN] Reference to option object.
Returns
DbStatus code indicating success or failure.

Implemented in pool::DbStorageExplorer.

◆ interfaceID()

static const Guid& pool::IStorageExplorer::interfaceID ( )
static

Retrieve interface ID.

◆ next()

virtual DbStatus pool::IStorageExplorer::next ( DbSelect context,
Token *&  refpTok 
)
pure virtual

Access the next token of a sequence.

The token to the next entry in the scanned container is returned. it is up to the user to release the allocated memory used by the token.

Parameters
context[IN] Reference to selection context.
refpTok[IN/OUT] Location to store pointer to token
Returns
DbStatus code indicating success or failure.

Implemented in pool::DbStorageExplorer.

◆ queryInterface()

virtual DbStatus pool::IStorageExplorer::queryInterface ( const Guid riid,
void **  ppvUnkn 
)
pure virtual

IInterface implementation: Query interfaces of Interface.

Implemented in pool::DbStorageExplorer.

◆ release()

virtual unsigned int pool::IStorageExplorer::release ( )
pure virtual

IInterface implementation: Release Interface instance

Implemented in pool::DbStorageExplorer.

◆ select()

virtual DbStatus pool::IStorageExplorer::select ( FileDescriptor refDB,
const std::string &  cntName,
DbSelect sel 
)
pure virtual

Initiate a selection on a given container.

The criteria according to which the selection is supposed to be executed must be present in the passed criteria. Empty criteria will select all entries in the container.

Parameters
refDB[IN] Reference to Database descriptor
cntName[IN] Container name to be scanned.
sel[IN/OUT] Selection criteria
Returns
DbStatus code indicating success or failure.

Implemented in pool::DbStorageExplorer.

◆ setContainerOption()

virtual DbStatus pool::IStorageExplorer::setContainerOption ( FileDescriptor refDB,
const std::string &  cntName,
const DbOption opt 
)
pure virtual

Set options for a given database container.

Note: The options depend on the underlying implementation and are not normalized.

Parameters
refDB[IN] Reference to Database descriptor
cntName[IN] Name of the database container
opt[IN] Reference to option object.
Returns
DbStatus code indicating success or failure.

Implemented in pool::DbStorageExplorer.

◆ setDatabaseOption()

virtual DbStatus pool::IStorageExplorer::setDatabaseOption ( FileDescriptor refDB,
const DbOption opt 
)
pure virtual

Set options for a given database.

Note: The options depend on the underlying implementation and are not normalized.

Parameters
refDB[IN] Reference to Database descriptor
opt[IN] Reference to option object.
Returns
DbStatus code indicating success or failure.

Implemented in pool::DbStorageExplorer.

◆ setDomainOption()

virtual DbStatus pool::IStorageExplorer::setDomainOption ( const SessionH  sessionH,
const DbOption opt 
)
pure virtual

Set options for a given database domain.

Domain options are global options, which refer to the database technology and not to a particular connection.

Note: The options depend on the underlying implementation and are not normalized.

Parameters
sessionH[IN] Session context to be used to open the Database.
opt[IN] Reference to option object.
Returns
DbStatus code indicating success or failure.

Implemented in pool::DbStorageExplorer.

◆ shapes()

virtual DbStatus pool::IStorageExplorer::shapes ( FileDescriptor refDB,
std::vector< ShapeH > &  shapes 
)
pure virtual

Access Shapes known to the database.

Parameters
refDB[IN] Reference to Database descriptor
shapes[OUT] Vector with shapes to used within the database.
Returns
DbStatus code indicating success or failure.

Implemented in pool::DbStorageExplorer.

◆ startSession()

virtual DbStatus pool::IStorageExplorer::startSession ( int  mode,
int  tech,
SessionH session 
)
pure virtual

Start a new Database Session.

The Database session handles Databases of one given type. This involves specific handling of a given domain represented by a technology type. All subsequent actions involving Database actions will re-use this technology identifier. The session is a purely logical concept, which typically cannot fail unless the underlying technology requires global initialization calls.

Parameters
mode[IN] Flag to indicate the accessmode of the session. READ, NEW/CREATE/WRITE, UPDATE, RECREATE
tech[IN] Flag indicating the technology type of the Database the user wants to connect to.
session[OUT] Token or handle to the Database session. This handle may later be used to open a new Database connection.
Returns
DbStatus code indicating success or failure.

Implemented in pool::DbStorageExplorer.


The documentation for this class was generated from the following file: