ATLAS Offline Software
Loading...
Searching...
No Matches
pool::IStorageSvc Class Referenceabstract

The IStorageSvc interface is able to handle user request for. More...

#include <StorageSvc/IStorageSvc.h>

Inheritance diagram for pool::IStorageSvc:
Collaboration diagram for pool::IStorageSvc:

Public Member Functions

virtual StatusCode queryInterface (const Guid &riid, void **ppvUnkn)=0
 IInterface implementation: Query interfaces of Interface.
virtual unsigned int addRef ()=0
 IInterface implementation: Reference Interface instance.
virtual unsigned int release ()=0
 IInterface implementation: Release Interface instance.
virtual std::string getContName (FileDescriptor &refDB, Token &pToken)=0
 Get container name for object.
virtual StatusCode allocate (FileDescriptor &refDB, const std::string &refCont, int technology, const void *object, ShapeH shapeH, Token *&refpTok)=0
 Register object for write.
virtual StatusCode read (const FileDescriptor &refDB, const Token &pToken, ShapeH shapeH, void **object)=0
 Read a persistent object from the medium.
virtual StatusCode getShape (FileDescriptor &refDB, const Guid &objType, ShapeH &shapeH)=0
 Retrieve persistent shape from Storage manager.
virtual ShapeH createShape (const Guid &shapeID)=0
 Create a Shape representation based on a ShapeID.
virtual StatusCode startSession (int mode, int tech, SessionH &session)=0
 Start a new Database Session.
virtual StatusCode endSession (const SessionH session)=0
 End the Database session.
virtual StatusCode existsConnection (const SessionH sessionH, int mode, const FileDescriptor &refDB)=0
 Check the existence of a logical Database unit.
virtual StatusCode connect (const SessionH sessionH, int mode, FileDescriptor &refDB)=0
 Connect to a logical Database unit.
virtual StatusCode disconnect (FileDescriptor &refDB)=0
 Disconnect from a logical Database unit.
virtual StatusCode openMode (FileDescriptor &refDB, int &mode)=0
 Query the access mode of a Database unit.
virtual StatusCode endTransaction (ConnectionH conn, Transaction::Action typ)=0
 End/Finish an existing Transaction sequence.
virtual StatusCode getDomainOption (const SessionH sessionH, DbOption &opt)=0
 Access options for a given database domain.
virtual StatusCode setDomainOption (const SessionH sessionH, const DbOption &opt)=0
 Set options for a given database domain.

Static Public Member Functions

static const GuidinterfaceID ()
 Retrieve interface ID.
static const char * category ()
 Retrieve category name.

Protected Member Functions

virtual ~IStorageSvc ()
 Destructor (called only by sub-classes)

Detailed Description

The IStorageSvc interface is able to handle user request for.

  • transient objects to become persistent and
  • persistent objects to be made trasient. What the storage manager however needs to perform this task are object mappings, which translate between the two representations.

The activity of the storage manager includes the Transaction handling and hence the management of

  • Database sessions: The Database session handles Databases of one given type. This involves specific handling of a given domain represented by a technology type.
  • Database connections: 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 file.
  • Database Transactions: Start and end a Transaction.
Author
Markus Frank
Version
1.0

Definition at line 56 of file IStorageSvc.h.

Constructor & Destructor Documentation

◆ ~IStorageSvc()

virtual pool::IStorageSvc::~IStorageSvc ( )
inlineprotectedvirtual

Destructor (called only by sub-classes)

Definition at line 59 of file IStorageSvc.h.

59{ }

Member Function Documentation

◆ addRef()

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

IInterface implementation: Reference Interface instance.

Implemented in pool::DbStorageSvc.

◆ allocate()

virtual StatusCode pool::IStorageSvc::allocate ( FileDescriptor & refDB,
const std::string & refCont,
int technology,
const void * object,
ShapeH shapeH,
Token *& refpTok )
pure virtual

Register object for write.

Parameters
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.
Returns
StatusCode code indicating success or failure.

Implemented in pool::DbStorageSvc.

◆ category()

const char * pool::IStorageSvc::category ( )
inlinestatic

Retrieve category name.

Definition at line 66 of file IStorageSvc.h.

66{ return "pool_IStorageSvc"; }

◆ connect()

virtual StatusCode pool::IStorageSvc::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
StatusCode code indicating success or failure.

Implemented in pool::DbStorageSvc.

◆ createShape()

virtual ShapeH pool::IStorageSvc::createShape ( const Guid & shapeID)
pure virtual

Create a Shape representation based on a ShapeID.

Parameters
shapeID[IN] Shape identifier.
Returns
Handle to persistent mapping of a given object type.

Implemented in pool::DbStorageSvc.

◆ disconnect()

virtual StatusCode pool::IStorageSvc::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
StatusCode code indicating success or failure.

Implemented in pool::DbStorageSvc.

◆ endSession()

virtual StatusCode pool::IStorageSvc::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
StatusCode code indicating success or failure.

Implemented in pool::DbStorageSvc.

◆ endTransaction()

virtual StatusCode pool::IStorageSvc::endTransaction ( ConnectionH conn,
Transaction::Action typ )
pure 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.

Parameters
conn[IN] Database 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.
Returns
StatusCode code indicating success or failure.

Implemented in pool::DbStorageSvc.

◆ existsConnection()

virtual StatusCode pool::IStorageSvc::existsConnection ( const SessionH sessionH,
int mode,
const FileDescriptor & refDB )
pure virtual

Check the existence of a logical Database unit.

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
StatusCode code indicating success or failure.

Implemented in pool::DbStorageSvc.

◆ getContName()

virtual std::string pool::IStorageSvc::getContName ( FileDescriptor & refDB,
Token & pToken )
pure virtual

Get container name for object.

Parameters
refDB[IN] Reference to Database descriptor
pToken[IN] Token to the persistent object.
Returns
std::string container name.

Implemented in pool::DbStorageSvc.

◆ getDomainOption()

virtual StatusCode pool::IStorageSvc::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
StatusCode code indicating success or failure.

Implemented in pool::DbStorageSvc.

◆ getShape()

virtual StatusCode pool::IStorageSvc::getShape ( FileDescriptor & refDB,
const Guid & objType,
ShapeH & shapeH )
pure 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).

Parameters
refDB[IN] Reference to Database descriptor
objType[IN] Shape identifier.
shapeH[OUT] Handle to persistent mapping of a given object type.
Returns
StatusCode code indicating success or failure.

Implemented in pool::DbStorageSvc.

◆ interfaceID()

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

Retrieve interface ID.

◆ openMode()

virtual StatusCode pool::IStorageSvc::openMode ( FileDescriptor & refDB,
int & mode )
pure virtual

Query the access mode of a Database unit.

Parameters
refDB[IN] Descriptor of the Database to be queried.
mode[OUT] Open mod to the database.
Returns
StatusCode code indicating success or failure.

Implemented in pool::DbStorageSvc.

◆ queryInterface()

virtual StatusCode pool::IStorageSvc::queryInterface ( const Guid & riid,
void ** ppvUnkn )
pure virtual

IInterface implementation: Query interfaces of Interface.

Implemented in pool::DbStorageSvc.

◆ read()

virtual StatusCode pool::IStorageSvc::read ( const FileDescriptor & refDB,
const Token & pToken,
ShapeH shapeH,
void ** object )
pure virtual

Read a persistent object from the medium.

Reading an object does not create the object.

Parameters
refDB[IN] Reference to Database descriptor
pToken[IN] Reference to persistent token information.
object[OUT] Pointer to persistent data pointer.
shapeH[IN] Desired object shape to be read
Returns
StatusCode code indicating success or failure.

Implemented in pool::DbStorageSvc.

◆ release()

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

IInterface implementation: Release Interface instance.

Implemented in pool::DbStorageSvc.

◆ setDomainOption()

virtual StatusCode pool::IStorageSvc::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
StatusCode code indicating success or failure.

Implemented in pool::DbStorageSvc.

◆ startSession()

virtual StatusCode pool::IStorageSvc::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
StatusCode code indicating success or failure.

Implemented in pool::DbStorageSvc.


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