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