ATLAS Offline Software
|
#include <POOLCore/DbStorageSvc.h>
Public Types | |
enum | : unsigned { ISTORAGESVC_ERROR = DbStatus::Error, INVALID_SESSION_TOKEN = ISTORAGESVC_ERROR+2, INVALID_CONNECTION_TOKEN = ISTORAGESVC_ERROR+4, INVALID_TRANSACTION_TOKEN = ISTORAGESVC_ERROR+6, INVALID_AUTHENTICATION = ISTORAGESVC_ERROR+8, TRANSACTION_FAILED = ISTORAGESVC_ERROR+10, INVALID_OBJECT = ISTORAGESVC_ERROR+12, INVALID_OBJ_TOKEN = ISTORAGESVC_ERROR+14, OBJ_NOT_LOADED = ISTORAGESVC_ERROR+16, CONNECTION_NOT_EXISTING = ISTORAGESVC_ERROR+18, ISTORAGESVC_LAST = ISTORAGESVC_ERROR+20, ISTORAGESVC_INFO = DbStatus::Info, SHAPE_NOT_AVAILIBLE = ISTORAGESVC_INFO+2, IS_PERSISTENT_SHAPE = ISTORAGESVC_INFO+4 } |
DbStatus code definitions. More... | |
Public Member Functions | |
DbStorageSvc () | |
Standard Constructor: Constructs an object of type DbStorageSvc. More... | |
DbStorageSvc (const std::string &name) | |
Initializing Constructor: Constructs an object of type DbStorageSvc. More... | |
virtual | ~DbStorageSvc () |
Standard destructor. More... | |
DbStorageSvc (const DbStorageSvc &)=delete | |
DbStorageSvc & | operator= (const DbStorageSvc &)=delete |
DbSession & | sessionHdl () |
Database session handle. More... | |
DbDomain & | domainHdl () |
Database domain handle. More... | |
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... | |
IService interface | |
| |
virtual DbStatus | initialize () |
IService implementation override: Initilize Service. More... | |
virtual DbStatus | finalize () |
IService implementation override: Finalize Service More... | |
virtual const std::string & | name () const |
IService implementation: Retrieve name of the service More... | |
IStorageExplorer interface | |
| |
virtual DbStatus | allocate (FileDescriptor &refDB, const std::string &refCont, int technology, const void *object, ShapeH shapeH, Token *&refpTok) |
Register object for write. More... | |
virtual DbStatus | update (FileDescriptor &refDB, const void *object, ShapeH shapeH, Token &refToken) |
In place update of an existing object. More... | |
virtual DbStatus | destroy (FileDescriptor &refDB, Token &refToken) |
Destroy an existing persistent object. More... | |
virtual DbStatus | read (const FileDescriptor &refDB, const Token &persToken, ShapeH shapeH, void **object) |
Read a persistent object from the medium. More... | |
virtual std::string | getContName (FileDescriptor &refDB, Token &persToken) |
Get container name for object. More... | |
virtual DbStatus | getShape (FileDescriptor &refDB, const Guid &objType, ShapeH &shapeH) |
Retrieve persistent shape from Storage manager. More... | |
virtual DbStatus | createShape (const FileDescriptor &refDB, const std::string &cntName, const Guid &shapeID, ShapeH &shapeH) |
Create a persistent shape a given Database container location. 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 | existsConnection (const SessionH sessionH, int mode, const FileDescriptor &refDB) |
Check the existence of a logical Database unit. More... | |
virtual DbStatus | connect (const SessionH sessionH, int mode, FileDescriptor &refDB) |
Connect to a logical Database unit. More... | |
virtual DbStatus | reconnect (FileDescriptor &refDB, int mode) |
Reconnect to a logical Database unit with different access mode. More... | |
virtual DbStatus | disconnect (FileDescriptor &refDB) |
Disconnect from a logical Database unit. More... | |
virtual DbStatus | openMode (FileDescriptor &refDB, int &mode) |
Query the access mode of a Database unit. More... | |
virtual DbStatus | endTransaction (ConnectionH conn, Transaction::Action typ) |
End/Finish an existing Transaction sequence. 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... | |
Static Public Member Functions | |
static const char * | catalogLabel () |
Label of the specific class. More... | |
static const Guid & | interfaceID () |
Retrieve interface ID. More... | |
static const char * | category () |
Retrieve category name. More... | |
Private Types | |
typedef std::vector< const Token * > | TokenVec |
Private Attributes | |
std::string | m_name |
Service Name More... | |
unsigned int | m_refCount |
Reference counter More... | |
DbSession | m_sesH |
Database session handle. More... | |
DbDomain | m_domH |
Database domain handle. More... | |
int | m_ageLimit |
Property: AgeLimit indicating the maximal allowed age of files. More... | |
DbType | m_type |
Technology type. More... | |
DbStorageExplorer * | m_explorer |
Reference to storage explorer object. More... | |
The DbStorageSvc class is able to handle user request for
This functionality is defined in the IDbStorageSvc interface and implemented in the DbStorageSvc class. Please refer to the header file POOLCore/IDbStorageSvc for further details.
Definition at line 41 of file DbStorageSvc.h.
|
private |
Definition at line 43 of file DbStorageSvc.h.
|
inherited |
DbStatus code definitions.
Enumerator | |
---|---|
ISTORAGESVC_ERROR | Error tag. |
INVALID_SESSION_TOKEN | Invalid Database session token. |
INVALID_CONNECTION_TOKEN | Invalid Database connection token. |
INVALID_TRANSACTION_TOKEN | Invalid Database Transaction token. |
INVALID_AUTHENTICATION | Invalid Database authentication. |
TRANSACTION_FAILED | The Transaction failed. |
INVALID_OBJECT | Object pointer is invalid. |
INVALID_OBJ_TOKEN | Invalid object address. |
OBJ_NOT_LOADED | Sorry, the requested object is not loaded. |
CONNECTION_NOT_EXISTING | Database does not exist. |
ISTORAGESVC_LAST | Terminator. |
ISTORAGESVC_INFO | Info tag. |
SHAPE_NOT_AVAILIBLE | Requested shape is unfortunately not availible. |
IS_PERSISTENT_SHAPE | Requested shape the persistent shape. |
Definition at line 313 of file IStorageSvc.h.
pool::DbStorageSvc::DbStorageSvc | ( | ) |
Standard Constructor: Constructs an object of type DbStorageSvc.
pool::DbStorageSvc::DbStorageSvc | ( | const std::string & | name | ) |
Initializing Constructor: Constructs an object of type DbStorageSvc.
|
virtual |
Standard destructor.
|
delete |
|
virtual |
IInterface implementation: Reference Interface instance
Implements pool::IStorageSvc.
|
virtual |
Register object for write.
refDB | [IN] Reference to Database descriptor |
refCont | [IN] Reference to container name |
technology[IN] | Specialised sub-technology |
object | [IN] Pointer to persistent data object. |
shapeH | [IN] Handle to persistent type information |
refpTok | [OUT] Reference to location for storing the pointer of the persistent object token. |
Implements pool::IStorageSvc.
|
inlinestatic |
Label of the specific class.
Definition at line 74 of file DbStorageSvc.h.
|
inlinestaticinherited |
Retrieve category name.
Definition at line 66 of file IStorageSvc.h.
|
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::IStorageSvc.
|
virtual |
Create a persistent shape a given Database container location.
This request involves Database actions. On creation of a shape the corresponding Database container is created.
refDB | [IN] Reference to Database descriptor |
cntName | [IN] Shape/Container name. |
shapeID | [IN] Shape identifier. |
shapeH | [OUT] Handle to persistent mapping of a given object type. |
Implements pool::IStorageSvc.
|
virtual |
Destroy an existing persistent object.
refDB | [IN] Reference to Database descriptor |
refToken | [IN] Reference to token containing the location information of the persistent object. |
Implements pool::IStorageSvc.
|
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::IStorageSvc.
|
inline |
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::IStorageSvc.
|
virtual |
End/Finish an existing Transaction sequence.
At this phase all objects, which were marked for write when the Transaction was started, are either going to be made persistent or scratched. After the Transaction ended, the Transaction context is invalidated and may no longer be used independent wether the Transaction was successful or not.
conn | [IN] DB connection |
typ | [IN] Enum indicating an action to be performed. Valid arguments are COMMIT and ROLLBACK. ROLLBACK can only be suported if the underlying technology supports the necessary features. |
Implements pool::IStorageSvc.
|
virtual |
Check the existence of a logical Database unit.
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::IStorageSvc.
|
virtual |
IService implementation override: Finalize Service
|
virtual |
Get container name for object.
refDB | [IN] Reference to Database descriptor |
pToken | [IN] Token to the persistent object. |
Implements pool::IStorageSvc.
|
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. |
|
virtual |
Retrieve persistent shape from Storage manager.
The persistent shape is saved at write time to a Database. To match the transient shape of an object to the persistent shape of the data at the time the data were written should allow for schema evolution and object transformation(s).
refDB | [IN] Reference to Database descriptor |
objType | [IN] Shape identifier. |
shapeH | [OUT] Handle to persistent mapping of a given object type. |
Implements pool::IStorageSvc.
|
virtual |
IService implementation override: Initilize Service.
|
inlinevirtual |
|
virtual |
Query the access mode of a Database unit.
In order to reconnect, the database obviously must already be open.
refDB | [IN] Descriptor of the Database to be queried. |
mode | [OUT] Open mod to the database. |
Implements pool::IStorageSvc.
|
delete |
|
virtual |
IInterface implementation: Query interfaces of Interface.
Implements pool::IStorageSvc.
|
virtual |
Read a persistent object from the medium.
Reading an object does not create the object.
refDB | [IN] Reference to Database descriptor |
persToken | [IN] Reference to persistent token information. |
object | [OUT] Pointer to persistent data pointer. |
shapeH | [IN] Desired object shape to be read |
Implements pool::IStorageSvc.
|
virtual |
Reconnect to a logical Database unit with different access mode.
In order to reconnect, the database obviously must already be open.
refDB | [IN] Descriptor of the Database to be re-opened. |
mode | [IN] Flag to indicate the accessmode of the session. Since a database can only be re-opened if it exists, possible values may only be: READ, UPDATE. |
Implements pool::IStorageSvc.
|
virtual |
IInterface implementation: Release Interface instance
Implements pool::IStorageSvc.
|
inline |
|
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. |
|
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::IStorageSvc.
|
virtual |
In place update of an existing object.
refDB | [IN] Reference to Database descriptor |
object | [IN] Pointer to persistent data object. |
shapeH | [IN] Handle to persistent type information |
refToken | [IN] Reference to token containing the location information of the persistent object. |
Implements pool::IStorageSvc.
|
private |
Property: AgeLimit indicating the maximal allowed age of files.
Definition at line 54 of file DbStorageSvc.h.
|
private |
Database domain handle.
Definition at line 52 of file DbStorageSvc.h.
|
private |
Reference to storage explorer object.
Definition at line 58 of file DbStorageSvc.h.
|
private |
Service Name
Definition at line 46 of file DbStorageSvc.h.
|
private |
Reference counter
Definition at line 48 of file DbStorageSvc.h.
|
private |
Database session handle.
Definition at line 50 of file DbStorageSvc.h.
|
private |
Technology type.
Definition at line 56 of file DbStorageSvc.h.