5#ifndef APR_IFILECATALOG_H
6#define APR_IFILECATALOG_H
8#include "GaudiUtils/IFileCatalog.h"
9#include "GaudiUtils/IFileCatalogMgr.h"
10#include "GaudiKernel/SmartIF.h"
13#include "GaudiKernel/IMessageSvc.h"
26 typedef Gaudi::IFileCatalog::Files
Files;
27 typedef Gaudi::IFileCatalog::Strings
Strings;
28 typedef Gaudi::IFileCatalogMgr::Catalogs
Catalogs;
67 void getFirstPFN(
const std::string& fid, std::string& pfn, std::string& tech )
const;
70 void lookupFileByPFN(
const std::string& pfn, std::string& fid, std::string& tech )
const;
73 bool existsPFN(
const std::string& pfn )
const {
return m_fc->existsPFN(pfn); }
76 std::string
lookupPFN(
const std::string& pfn )
const {
return m_fc->lookupPFN(pfn); }
83 std::string
lookupLFN(
const std::string& lfn )
const {
return m_fc->lookupLFN(lfn); }
95 void registerPFN(
const std::string& pfn,
const std::string& ftype, std::string& fid );
98 void renamePFN(
const std::string& pfn,
const std::string& newpfn ) {
m_fc->renamePFN(pfn, newpfn); }
101 void addReplicaPFN(
const std::string& pfn,
const std::string& replica_pfn );
105 const std::string& replica_pfn,
106 const std::string& replica_tech =
"ROOT_All" );
110 void registerLFN(
const std::string& fid,
const std::string& lfn )
const {
m_fc->registerLFN(fid, lfn ); }
140 SmartIF<Gaudi::IFileCatalogMgr>
m_mgr;
141 SmartIF<Gaudi::IFileCatalog>
m_fc;
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
void start()
redirect to init() for Gaudi FC
void commit()
Save catalog to file.
void addReadCatalog(const std::string &connect)
Add new catalog identified by name to the existing ones.
void getPFNs(const std::string &fid, Files &files) const
Dump all PFNames of the catalog and their attributes associate to the FileID.
void lookupFileByPFN(const std::string &pfn, std::string &fid, std::string &tech) const
Get FID and filetype for a given PFN.
void deletePFN(const std::string &pfn)
Delete PFN from the catalog (delete entire FID entry if it was the last PFN)
void getFIDs(Strings &fids) const
Get all FIDs.
SmartIF< Gaudi::IFileCatalog > m_fc
bool existsPFN(const std::string &pfn) const
Return the status of a PFName.
std::string createFID() const
Create file identifier using UUID mechanism.
void getFirstPFN(const std::string &fid, std::string &pfn, std::string &tech) const
Get the first PFN + filetype for the given FID.
SmartIF< Gaudi::IFileCatalogMgr > m_mgr
Gaudi::IFileCatalog::Strings Strings
Gaudi::IFileCatalog::Files Files
void registerLFN(const std::string &fid, const std::string &lfn) const
Create a Node for a FileID and DOM Node of the LFN with all the attributes.
Gaudi::IFileCatalogMgr::Catalogs Catalogs
void removeCatalog(const std::string &connect)
Add new catalog identified by reference to the existing ones.
void addCatalog(const std::string &connect)
void init()
Parse the DOM tree of the XML catalog.
Catalogs & catalogs()
Remove catalog identified by reference from the existing ones.
void rollback()
Save catalog to file.
void renamePFN(const std::string &pfn, const std::string &newpfn)
Rename PFN.
const std::string & connectInfo() const
Get the connect string.
void registerPFN(const std::string &pfn, const std::string &ftype, std::string &fid)
Register PFN, assign new FID if not given.
void setWriteCatalog(const std::string &connect)
Access to the (first) writable file catalog.
std::string lookupLFN(const std::string &lfn) const
void getLFNs(const std::string &fid, Files &files) const
Get all logical names for a given FID. Return pairs <LFN,FID>
bool readOnly() const
Check if the catalog is read-only.
const Catalogs & catalogs() const
Access catalog container (CONST)
void addReplicaPFN(const std::string &pfn, const std::string &replica_pfn)
adding replica to an existing PFN
bool dirty() const
Check if the catalog should be updated.
std::string lookupPFN(const std::string &pfn) const
Lookup file identifier by physical file name.
void addReplicaFID(const std::string &fid, const std::string &replica_pfn, const std::string &replica_tech="ROOT_All")
adding replica to an existing FID
void lookupFileByLFN(const std::string &lfn, std::string &fid) const
Return the status of a LFName.
void deleteFID(const std::string &FileID)
Return the status of a FileID.
std::vector< std::string > files
file names and file pointers