ATLAS Offline Software
|
#include <StorageSvc/DbStorageExplorer.h>
Public Types | |
typedef std::pair< std::string, std::string > | Parameter |
Database parameter definition. More... | |
typedef std::vector< Parameter > | Parameters |
Database parameter container definition. More... | |
Public Member Functions | |
DbStorageExplorer () | |
Standard Constructor: Constructs an object of type DbStorageExplorer. More... | |
DbStorageExplorer (const std::string &name, DbDomain &domH, DbStorageSvc *pOuter) | |
Initializing Constructor: Constructs an object of type DbStorageExplorer. More... | |
virtual | ~DbStorageExplorer () |
Standard destructor. 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... | |
IStorageExplorer interface | |
| |
virtual DbStatus | queryInterface (const Guid &riid, void **ppvUnknown) |
IInterface implementation: Query interfaces of Interface. More... | |
virtual unsigned int | addRef () |
IInterface implementation: Reference Interface instance More... | |
virtual unsigned int | release () |
IInterface implementation: Release Interface instance More... | |
virtual DbStatus | startSession (int mode, int tech, SessionH &session) |
Start a new Database Session. More... | |
virtual DbStatus | endSession (const SessionH session) |
End the Database session. More... | |
virtual DbStatus | connect (const SessionH sessionH, int mode, FileDescriptor &refDB) |
Connect to a logical Database unit. More... | |
virtual DbStatus | disconnect (FileDescriptor &refDB) |
Disconnect from a logical Database unit. More... | |
virtual long long int | databaseSize (FileDescriptor &refDB) const |
Access the size of the database: May be undefined for some technologies. More... | |
virtual DbStatus | containers (FileDescriptor &refDB, TokenVec &conts, bool intern) |
Access the containers in a given database. More... | |
virtual DbStatus | associations (FileDescriptor &refDB, TokenVec &assocs) |
Access the container level associations between objects. More... | |
virtual DbStatus | shapes (FileDescriptor &refDB, std::vector< ShapeH > &shapes) |
Access Shapes known to the database. More... | |
virtual DbStatus | addDbParam (FileDescriptor &refDB, const std::string &nam, const std::string &val) |
Add a persistent parameter to the database. More... | |
virtual DbStatus | dbParam (FileDescriptor &refDB, const std::string &nam, std::string &val) |
Retrieve existing parameter by name. More... | |
virtual DbStatus | dbParams (FileDescriptor &refDB, Parameters &vals) |
Retrieve all parameters. More... | |
virtual DbStatus | getDomainOption (const SessionH sessionH, DbOption &opt) |
Access options for a given database domain. More... | |
virtual DbStatus | setDomainOption (const SessionH sessionH, const DbOption &opt) |
Set options for a given database domain. More... | |
virtual DbStatus | getDatabaseOption (FileDescriptor &refDB, DbOption &opt) |
Access options for a given database. More... | |
virtual DbStatus | setDatabaseOption (FileDescriptor &refDB, const DbOption &opt) |
Set options for a given database. More... | |
virtual DbStatus | getContainerOption (FileDescriptor &refDB, const std::string &cntName, DbOption &opt) |
Access options for a given database container. More... | |
virtual DbStatus | setContainerOption (FileDescriptor &refDB, const std::string &cntName, const DbOption &opt) |
Set options for a given database container. More... | |
virtual DbStatus | select (FileDescriptor &refDB, const std::string &cntName, DbSelect &sel) |
Initiate a selection on a given container. More... | |
virtual DbStatus | next (DbSelect &context, Token *&refpTok) |
Access the next token of a sequence. More... | |
Static Public Member Functions | |
static const Guid & | interfaceID () |
Retrieve interface ID. More... | |
Private Types | |
typedef std::vector< const Token * > | TokenVec |
Private Attributes | |
DbStorageSvc * | m_pOuter |
Reference to outer interface. More... | |
DbDomain & | m_domH |
Reference to domain handle. More... | |
std::string | m_name |
Explorer name. More... | |
The DbStorageExplorer class is able to handle user request for accessing database information such as the container information and to issue scans over database containers.
This functionality is defined in the IStorageExplorer interface and implemented in the DbStorageExplorer class. Please refer to the header file IStorageExplorer for further details.
Definition at line 35 of file DbStorageExplorer.h.
|
inherited |
Database parameter definition.
Definition at line 60 of file IStorageExplorer.h.
|
inherited |
Database parameter container definition.
Definition at line 62 of file IStorageExplorer.h.
|
private |
Definition at line 37 of file DbStorageExplorer.h.
pool::DbStorageExplorer::DbStorageExplorer | ( | ) |
Standard Constructor: Constructs an object of type DbStorageExplorer.
pool::DbStorageExplorer::DbStorageExplorer | ( | const std::string & | name, |
DbDomain & | domH, | ||
DbStorageSvc * | pOuter | ||
) |
Initializing Constructor: Constructs an object of type DbStorageExplorer.
Once a proper framework exists, most of these arguments will go away.
|
virtual |
Standard destructor.
|
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.
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. |
Implements pool::IStorageExplorer.
|
virtual |
IInterface implementation: Reference Interface instance
Implements pool::IStorageExplorer.
|
pure virtualinherited |
Access the container level associations between objects.
refDB | [IN] Reference to Database descriptor |
assocs | [OUT] Vector with tokens to used containers. |
|
virtual |
Access the container level associations between objects.
refDB | [IN] Reference to Database descriptor |
assocs | [OUT] Vector with tokens to used containers. |
|
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.
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. |
Implements pool::IStorageExplorer.
|
pure virtualinherited |
Access the containers in a given database.
refDB | [IN] Reference to Database descriptor |
conts | [OUT] Vector with tokens to used containers. |
intern | [IN] Flag to access also internal containers |
|
virtual |
Access the containers in a given database.
refDB | [IN] Reference to Database descriptor |
conts | [OUT] Vector with tokens to used containers. |
intern | [IN] Flag to access also internal containers |
|
virtual |
Access the size of the database: May be undefined for some technologies.
refDB | [IN] Descriptor of the Database access. This handle was retrieved when connecting to the logical Database. |
Implements pool::IStorageExplorer.
|
virtual |
Retrieve existing parameter by name.
Retrieve single user specified parameter from the database.
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. |
Implements pool::IStorageExplorer.
|
virtual |
Retrieve all parameters.
Retrieve all user parameters from the database.
refDB | [IN] Reference to Database descriptor |
vals | [OUT] Vector containing all parameter nam/value pairs. |
Implements pool::IStorageExplorer.
|
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.
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. |
Implements pool::IStorageExplorer.
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.
session | [IN] Handle to the Database session. This handle was retrieved when starting the session. |
Implements pool::IStorageExplorer.
|
virtual |
Access options for a given database container.
Note: The options depend on the underlying implementation and are not normalized.
refDB | [IN] Reference to Database descriptor |
cntName | [IN] Name of the database container |
opt | [IN] Reference to option object. |
Implements pool::IStorageExplorer.
|
virtual |
Access options for a given database.
Note: The options depend on the underlying implementation and are not normalized.
refDB | [IN] Reference to Database descriptor |
opt | [IN] Reference to option object. |
Implements pool::IStorageExplorer.
|
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.
sessionH | [IN] Session context to be used to open the Database. |
opt | [IN] Reference to option object. |
Implements pool::IStorageExplorer.
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.
context | [IN] Reference to selection context. |
refpTok | [IN/OUT] Location to store pointer to token |
Implements pool::IStorageExplorer.
|
virtual |
IInterface implementation: Query interfaces of Interface.
Implements pool::IStorageExplorer.
|
virtual |
IInterface implementation: Release Interface instance
Implements pool::IStorageExplorer.
|
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.
refDB | [IN] Reference to Database descriptor |
cntName | [IN] Container name to be scanned. |
sel | [IN/OUT] Selection criteria |
Implements pool::IStorageExplorer.
|
virtual |
Set options for a given database container.
Note: The options depend on the underlying implementation and are not normalized.
refDB | [IN] Reference to Database descriptor |
cntName | [IN] Name of the database container |
opt | [IN] Reference to option object. |
Implements pool::IStorageExplorer.
|
virtual |
Set options for a given database.
Note: The options depend on the underlying implementation and are not normalized.
refDB | [IN] Reference to Database descriptor |
opt | [IN] Reference to option object. |
Implements pool::IStorageExplorer.
|
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.
sessionH | [IN] Session context to be used to open the Database. |
opt | [IN] Reference to option object. |
Implements pool::IStorageExplorer.
|
virtual |
Access Shapes known to the database.
refDB | [IN] Reference to Database descriptor |
shapes | [OUT] Vector with shapes to used within the database. |
Implements pool::IStorageExplorer.
|
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.
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. |
Implements pool::IStorageExplorer.
|
private |
Reference to domain handle.
Definition at line 43 of file DbStorageExplorer.h.
|
private |
Explorer name.
Definition at line 46 of file DbStorageExplorer.h.
|
private |
Reference to outer interface.
Definition at line 40 of file DbStorageExplorer.h.