1 #ifndef GAUDIUTILS_XMLFILECATALOG_H 2 #define GAUDIUTILS_XMLFILECATALOG_H 5 #include "xercesc/dom/DOMDocument.hpp" 6 #include "xercesc/dom/DOMElement.hpp" 7 #include "xercesc/parsers/XercesDOMParser.hpp" 8 #include "xercesc/sax/ErrorHandler.hpp" 66 void getPFN( CSTR fid, Files& files )
const override;
68 void getLFN( CSTR fid, Files& files )
const override;
70 void getFID( Strings& fids )
const override;
72 void deleteFID( CSTR FileID )
const override;
74 void registerPFN( CSTR fid, CSTR pfn, CSTR ftype )
const override;
76 void registerLFN( CSTR fid, CSTR lfn )
const override;
80 void getMetaData( CSTR fid, Attributes& attr )
const override;
84 void setMetaData( CSTR fid, CSTR name, CSTR value )
const override;
91 xercesc::DOMDocument*
getDoc(
bool throw_if_no_exists =
true )
const;
95 xercesc::DOMNode*
element( CSTR fid,
bool print_err =
true )
const;
96 xercesc::DOMNode*
child( xercesc::DOMNode*
par, CSTR tag, CSTR attr =
"", CSTR val =
"" )
const;
std::string getMetaDataItem(CSTR fid, CSTR name) const override
Access metadata item.
bool readOnly() const override
Check if the catalog is read-only.
Base class used to implement the interfaces.
void registerPFN(CSTR fid, CSTR pfn, CSTR ftype) const override
Create a FileID and Node of the physical file name with all the attributes.
void rollback() override
Save DOM catalog to file.
std::string lookupPFN(CSTR fid) const override
Lookup file identifier by physical file name.
std::string lookupFID(CSTR lfn) const
std::string getfile(bool create)
xercesc::DOMNode * element(CSTR fid, bool print_err=true) const
std::unique_ptr< xercesc::XercesDOMParser > m_parser
std::string lookupLFN(CSTR lfn) const override
Lookup file identifier by logical file name.
xercesc::DOMNode * child(xercesc::DOMNode *par, CSTR tag, CSTR attr="", CSTR val="") const
bool existsPFN(CSTR pfn) const override
Return the status of a physical file name.
void printError(CSTR msg, bool throw_exc=true) const
void getMetaData(CSTR fid, Attributes &attr) const override
Dump all MetaData of the catalog for a given file ID.
std::unique_ptr< xercesc::ErrorHandler > m_errHdlr
The IMessage is the interface implemented by the message service.
xercesc::DOMDocument * m_doc
xercesc::DOMDocument * getDoc(bool throw_if_no_exists=true) const
CSTR connectInfo() const override
Access to connect string.
bool existsLFN(CSTR lfn) const override
Return the status of a logical file name.
void getLFN(CSTR fid, Files &files) const override
Dump all logical file names of the catalog associate to the FileID.
XMLFileCatalog(CSTR url, IMessageSvc *m)
Create a catalog file, initialization of XercesC.
~XMLFileCatalog() override=default
Destructor,.
bool existsFID(CSTR fid) const override
Return the status of a FileID.
void setMetaData(CSTR fid, CSTR name, CSTR value) const override
Insert/update metadata item.
std::string createGuidAsString()
Helper function creating file identifier using the UUID mechanism.
void registerLFN(CSTR fid, CSTR lfn) const override
Create a FileID and Node of the logical file name with all the attributes.
void commit() override
Save DOM catalog to file.
std::pair< xercesc::DOMElement *, xercesc::DOMElement * > i_registerFID(CSTR fid) const
void init() override
Parse the DOM tree of the XML catalog.
void registerFID(CSTR fid) const override
Create a FileID and Node.
void getPFN(CSTR fid, Files &files) const override
Dump all physical file names of the catalog and their attributes associate to the FileID...
This class constitutes the core of the XML based FileCatalog API for POOL.
bool dirty() const override
Check if the catalog should be updated.
std::string createFID() const override
Catalog interface.
Helper functions to set/get the application return code.
void getFID(Strings &fids) const override
Dump all file Identifiers.
void dropMetaData(CSTR fid) const override
Drop all metadata of one FID.
void deleteFID(CSTR FileID) const override
Delete FileID Node from the catalog.