The Gaudi Framework  master (37c0b60a)
IFileCatalog.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDIFILECATALOG_IFILECATALOG_H
12 #define GAUDIFILECATALOG_IFILECATALOG_H
13 
14 #include <Gaudi/PluginService.h>
15 #include <GaudiKernel/IInterface.h>
16 #include <string>
17 #include <utility>
18 #include <vector>
19 
20 class IMessageSvc;
21 
22 /*
23  * Gaudi namespace declaration
24  */
25 namespace Gaudi {
26 
36  class GAUDI_API IFileCatalog : virtual public IInterface {
37 
38  public:
41 
42  using Factory = Gaudi::PluginService::Factory<IInterface*( const std::string&, IMessageSvc* )>;
43 
49 
51  virtual std::string createFID() const = 0;
54  virtual const std::string& connectInfo() const = 0;
56  virtual void init() = 0;
58  virtual void commit() = 0;
60  virtual void rollback() = 0;
62  virtual bool readOnly() const = 0;
64  virtual bool dirty() const = 0;
66  virtual void getPFN( const std::string& fid, Files& files ) const = 0;
68  virtual void getLFN( const std::string& fid, Files& files ) const = 0;
70  virtual void getFID( Strings& fids ) const = 0;
72  virtual bool existsPFN( const std::string& pfn ) const = 0;
74  virtual std::string lookupPFN( const std::string& lfn ) const = 0;
76  virtual bool existsLFN( const std::string& lfn ) const = 0;
78  virtual std::string lookupLFN( const std::string& lfn ) const = 0;
80  virtual bool existsFID( const std::string& fid ) const = 0;
82  virtual void deleteFID( const std::string& FileID ) const = 0;
84  virtual void registerPFN( const std::string& fid, const std::string& pfn, const std::string& ftype ) const = 0;
86  virtual void registerLFN( const std::string& fid, const std::string& lfn ) const = 0;
88  virtual void registerFID( const std::string& fid ) const = 0;
90  virtual void renamePFN( const std::string& pfn, const std::string& new_pfn ) const = 0;
92  virtual void deletePFN( const std::string& pfn ) const = 0;
94  virtual void getMetaData( const std::string& fid, Attributes& attr ) const = 0;
96  virtual std::string getMetaDataItem( const std::string& fid, const std::string& name ) const = 0;
98  virtual void setMetaData( const std::string& fid, const std::string& name, const std::string& value ) const = 0;
100  virtual void dropMetaData( const std::string& fid ) const = 0;
102  virtual void dropMetaData( const std::string& fid, const std::string& attr ) const = 0;
103  };
104 } /* End namespace Gaudi */
105 #endif /* GAUDIFILECATALOG_IFILECATALOG_H */
Gaudi::IFileCatalog::rollback
virtual void rollback()=0
Save catalog to file.
Gaudi::IFileCatalog::connectInfo
virtual const std::string & connectInfo() const =0
Access to connect string.
std::string
STL class.
IMessageSvc
Definition: IMessageSvc.h:47
Gaudi::IFileCatalog::readOnly
virtual bool readOnly() const =0
Check if the catalog is read-only.
Gaudi::IFileCatalog::lookupPFN
virtual std::string lookupPFN(const std::string &lfn) const =0
Lookup file identifier by physical file name.
Gaudi::IFileCatalog
Definition: IFileCatalog.h:36
std::pair< std::string, std::string >
Gaudi::IFileCatalog::commit
virtual void commit()=0
Save catalog to file.
std::vector
STL class.
Gaudi::IFileCatalog::renamePFN
virtual void renamePFN(const std::string &pfn, const std::string &new_pfn) const =0
rename a PFN
Gaudi::IFileCatalog::dirty
virtual bool dirty() const =0
Check if the catalog should be updated.
Gaudi::IFileCatalog::Strings
std::vector< std::string > Strings
Definition: IFileCatalog.h:48
Gaudi::IFileCatalog::registerLFN
virtual void registerLFN(const std::string &fid, const std::string &lfn) const =0
Create a Node for a FileID and DOM Node of the LFN with all the attributes.
Gaudi::IFileCatalog::DeclareInterfaceID
DeclareInterfaceID(IFileCatalog, 2, 0)
InterfaceID.
Gaudi::IFileCatalog::Factory
Gaudi::PluginService::Factory< IInterface *(const std::string &, IMessageSvc *)> Factory
Definition: IFileCatalog.h:42
Gaudi::IFileCatalog::existsPFN
virtual bool existsPFN(const std::string &pfn) const =0
Return the status of a PFName.
PluginService.h
Gaudi::IFileCatalog::lookupLFN
virtual std::string lookupLFN(const std::string &lfn) const =0
Lookup file identifier by physical file name.
Gaudi::IFileCatalog::registerFID
virtual void registerFID(const std::string &fid) const =0
Create a Node for a FileID and DOM Node.
IInterface.h
Gaudi::IFileCatalog::dropMetaData
virtual void dropMetaData(const std::string &fid) const =0
Drop all metadata of one FID.
Gaudi::IFileCatalog::Files
std::vector< NamedItem > Files
Definition: IFileCatalog.h:47
Gaudi::IFileCatalog::existsLFN
virtual bool existsLFN(const std::string &lfn) const =0
Return the status of a LFName.
Gaudi::IFileCatalog::getLFN
virtual void getLFN(const std::string &fid, Files &files) const =0
Dump all LFNames of the catalog associate to the FileID.
Gaudi::IFileCatalog::registerPFN
virtual void registerPFN(const std::string &fid, const std::string &pfn, const std::string &ftype) const =0
Create a Node for a FileID and DOM Node of the PFN with all the attributes.
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition: __init__.py:1
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
Gaudi::IFileCatalog::setMetaData
virtual void setMetaData(const std::string &fid, const std::string &name, const std::string &value) const =0
Insert/update metadata item.
Gaudi::IFileCatalog::getMetaData
virtual void getMetaData(const std::string &fid, Attributes &attr) const =0
Dump all MetaData of the catalog for a given file ID.
Gaudi::IFileCatalog::getPFN
virtual void getPFN(const std::string &fid, Files &files) const =0
Dump all PFNames of the catalog and their attributes associate to the FileID.
IInterface
Definition: IInterface.h:239
Gaudi::IFileCatalog::init
virtual void init()=0
Parse the DOM tree of the XML catalog.
Gaudi::IFileCatalog::NamedItem
std::pair< std::string, std::string > NamedItem
Public type definitions.
Definition: IFileCatalog.h:45
Gaudi::IFileCatalog::dropMetaData
virtual void dropMetaData(const std::string &fid, const std::string &attr) const =0
Drop specified metadata item.
Gaudi::IFileCatalog::getFID
virtual void getFID(Strings &fids) const =0
Dump all file Identifiers.
Gaudi::IFileCatalog::getMetaDataItem
virtual std::string getMetaDataItem(const std::string &fid, const std::string &name) const =0
Access metadata item.
Gaudi::IFileCatalog::deleteFID
virtual void deleteFID(const std::string &FileID) const =0
Delete FileID Node from the catalog.
Gaudi::IFileCatalog::deletePFN
virtual void deletePFN(const std::string &pfn) const =0
remove a PFN
Gaudi::IFileCatalog::existsFID
virtual bool existsFID(const std::string &fid) const =0
Return the status of a FileID.
Gaudi::IFileCatalog::Attributes
std::vector< NamedItem > Attributes
Definition: IFileCatalog.h:46
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81