ATLAS Offline Software
|
#include <CollectionFactory/CollectionFactory.h>
Public Member Functions | |
virtual ICollection * | create (const ICollectionDescription &description, ICollection::OpenMode openMode, ISession *session=0) const |
Creates an instance of a collection or collection fragment, given its storage technology type. More... | |
virtual ICollection * | createAndRegister (const ICollectionDescription &description, IFileCatalog *collectionCatalog, bool overwrite=false, std::string logicalName="", ISession *session=0) const |
Creates or overwrites a collection given a description of its properties, and registers it in a collection catalog. More... | |
virtual bool | registerExisting (const ICollectionDescription &description, IFileCatalog *collectionCatalog, std::string logicalName="", ISession *session=0) const |
Registers an existing collection in a collection catalog, given a specification of its properties. More... | |
virtual bool | registerExisting (ICollection *collection, bool overwrite, IFileCatalog *collectionCatalog, std::string logicalName="", ISession *session=0) const |
Registers an existing collection in a collection catalog, but uses user-supplied exiting collection object. More... | |
virtual ICollection * | openWithPhysicalName (const std::string &physicalName, IFileCatalog *collectionCatalog, ICollection::OpenMode openMode=pool::ICollection::READ, ISession *session=0) const |
Opens an existing collection for read or update transactions, given its physical name. More... | |
virtual ICollection * | openWithLogicalName (const std::string &logicalName, IFileCatalog *collectionCatalog, bool readOnly=true, ISession *session=0) const |
Opens an existing collection for read or update transactions, given a logical name assigned to it in a collection catalog. More... | |
virtual ICollection * | openWithGuid (const FileCatalog::FileID &guid, IFileCatalog *collectionCatalog, bool readOnly=true, ISession *session=0) const |
Opens an existing collection for read or update transactions, given the globally unique identifier used to register it in a collection catalog. More... | |
virtual void | resolveDescription (CollectionDescription &description, bool readOnly=true) const |
virtual CollectionDescription | descFromPhysicalName (const std::string &physicalName, IFileCatalog *collectionCatalog, bool readOnly) const |
virtual CollectionDescription | descFromLogicalName (const std::string &logicalName, IFileCatalog *collectionCatalog, bool readOnly) const |
virtual CollectionDescription | descFromGuid (const FileCatalog::FileID &guid, IFileCatalog *collectionCatalog, bool readOnly) const |
void | setDefaultCatalog (pool::IFileCatalog *catalog) |
set external file catalog (it will not be deleted) pass 0 to reset the existing file catalog More... | |
void | setWriteCatalog (const std::string &cat) |
set write catalog (once it is set, it can only be changed by resetting) More... | |
IFileCatalog * | getDefaultCatalog () const |
get the default file catalog if there was no file catalog, new one will be created according to environment variables POOL_COLLECTION_[WRITE|READ]_CATALOG More... | |
Static Public Member Functions | |
static CollectionFactory * | get () |
Retrieves the collection factory singleton. More... | |
Protected Attributes | |
bool | m_myOwnCatalog |
IFileCatalog * | m_catalog |
Private Member Functions | |
CollectionFactory () | |
Default constructor. More... | |
virtual | ~CollectionFactory () |
Default destructor. More... | |
bool | isUnique (const FileCatalog::FileID &guid, IFileCatalog &collectionCatalog) const |
Indicates whether the GUID of a collection is unique in a collection catalog. More... | |
void | extract (const std::string &physicalName, std::string &type, std::string &connection, std::string &name) const |
Extracts the collection storage technology type and database connection string and name from the physical name of a collection used to store it in a collection catalog. More... | |
ICollection * | create_callPlugin (const ICollectionDescription &description, ICollection::OpenMode openMode, ISession *session=0) const |
Static Private Attributes | |
static CollectionFactory | s_instance |
Collection factory singleton. More... | |
static const std::string | c_fileType |
Definition of file catalog entry type for collections registered in catalog. More... | |
A plugin factory for the creation of storage technology specific collections or collection fragments.
Definition at line 29 of file CollectionFactory.h.
|
private |
Default constructor.
|
privatevirtual |
Default destructor.
|
virtual |
Creates an instance of a collection or collection fragment, given its storage technology type.
If the collection or collection fragment does not exist a new one can be created. If it already exists it may be overwritten or opened for read or update transactions.
type | Storage technology type of collection or collection fragment. |
description | Specification of collection or collection fragment properties. |
openMode | Open mode for collection or collection fragment (CREATE, CREATE_AND_OVERWRITE, READ or UPDATE). |
session | Reference to database session (only needed for implicit collections). |
|
private |
|
virtual |
Creates or overwrites a collection given a description of its properties, and registers it in a collection catalog.
Throws an exception if the collection has been replicated, if an attempt is being made to overwrite an existing collection in CREATE open mode or if the object being registered is a collection fragment.
description | Specification of collection properties. |
collectionCatalog | Collection catalog manager. |
overwrite | Flag indicating whether to overwrite existing collection. |
logicalName | Optional logical name assigned to collection in collection catalog. |
session | Reference to database session (place holder for factory). |
|
virtual |
|
virtual |
|
virtual |
|
private |
Extracts the collection storage technology type and database connection string and name from the physical name of a collection used to store it in a collection catalog.
type | Storage technology type of collection. |
connection | Connection to database containing collection. |
name | Name of collection. |
physicalName | physical name of collection in catalog. |
|
static |
Retrieves the collection factory singleton.
IFileCatalog* pool::CollectionFactory::getDefaultCatalog | ( | ) | const |
get the default file catalog if there was no file catalog, new one will be created according to environment variables POOL_COLLECTION_[WRITE|READ]_CATALOG
|
private |
Indicates whether the GUID of a collection is unique in a collection catalog.
guid | GUID of collection in collection catalog. |
collectionCatalog | Collection catalog manager. |
|
virtual |
Opens an existing collection for read or update transactions, given the globally unique identifier used to register it in a collection catalog.
Throws an exception if a collection with this GUID cannot be found in the catalog.
guid | Globally unique identifier of collection in collection catalog. |
catalog | Collection catalog manager. |
readOnly | Flag indicating whether collection is opened for read or update. |
session | Reference to database session (place holder for factory). |
|
virtual |
Opens an existing collection for read or update transactions, given a logical name assigned to it in a collection catalog.
Throws an exception if a collection with this logical name cannot be found in the catalog.
LogicalName | Logical name of collection in collection catalog. |
collectionCatalog | Collection catalog manager. |
readOnly | Flag indicating whether collection is opened for read or update. |
session | Reference to database session (place holder for factory). |
|
virtual |
Opens an existing collection for read or update transactions, given its physical name.
Throws an exception if a collection with this physical name cannot be found in the catalog.
physicalName | Physical name of collection in collection catalog. |
collectionCatalog | Collection catalog manager. |
openMode | The mode in which to open the collection |
session | Reference to database session (place holder for factory). |
|
virtual |
Registers an existing collection in a collection catalog, given a specification of its properties.
Throws an exception if the collection does not exist, if a collection has already been registered in the catalog with identical physical name, or if the object being registered is a collection fragment. NOTE: will open the collection - do NOT use if you opened the collection for update
description | Specification of collection properties. |
collectionCatalog | Collection catalog manager. |
logicalName | Optional logical name assigned to collection in collection catalog. |
session | Reference to database session (place holder for factory). |
|
virtual |
Registers an existing collection in a collection catalog, but uses user-supplied exiting collection object.
collection | The collection to register |
overwrite | If true overwrite catalog entry for the same collection name |
collectionCatalog | Collection catalog manager. |
logicalName | Optional logical name assigned to collection in collection catalog. |
session | Reference to database session (place holder for factory). |
|
virtual |
void pool::CollectionFactory::setDefaultCatalog | ( | pool::IFileCatalog * | catalog | ) |
set external file catalog (it will not be deleted) pass 0 to reset the existing file catalog
void pool::CollectionFactory::setWriteCatalog | ( | const std::string & | cat | ) |
set write catalog (once it is set, it can only be changed by resetting)
|
staticprivate |
Definition of file catalog entry type for collections registered in catalog.
Definition at line 186 of file CollectionFactory.h.
|
mutableprotected |
Definition at line 219 of file CollectionFactory.h.
|
mutableprotected |
Definition at line 218 of file CollectionFactory.h.
|
staticprivate |
Collection factory singleton.
Definition at line 183 of file CollectionFactory.h.