The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
IFileCatalog.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2025 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#pragma once
12
13#include <Gaudi/PluginService.h>
15#include <string>
16#include <utility>
17#include <vector>
18
19class IMessageSvc;
20
21/*
22 * Gaudi namespace declaration
23 */
24namespace Gaudi {
25
35 class GAUDI_API IFileCatalog : virtual public IInterface {
36
37 public:
40
41 using Factory = Gaudi::PluginService::Factory<IInterface*( const std::string&, IMessageSvc* )>;
42
44 typedef std::pair<std::string, std::string> NamedItem;
45 typedef std::vector<NamedItem> Attributes;
46 typedef std::vector<NamedItem> Files;
47 typedef std::vector<std::string> Strings;
48
51 virtual std::string createFID() const = 0;
53 virtual const std::string& connectInfo() const = 0;
55 virtual void init() = 0;
57 virtual void commit() = 0;
59 virtual void rollback() = 0;
61 virtual bool readOnly() const = 0;
63 virtual bool dirty() const = 0;
65 virtual void getPFN( const std::string& fid, Files& files ) const = 0;
67 virtual void getLFN( const std::string& fid, Files& files ) const = 0;
69 virtual void getFID( Strings& fids ) const = 0;
71 virtual bool existsPFN( const std::string& pfn ) const = 0;
73 virtual std::string lookupPFN( const std::string& lfn ) const = 0;
75 virtual bool existsLFN( const std::string& lfn ) const = 0;
77 virtual std::string lookupLFN( const std::string& lfn ) const = 0;
79 virtual bool existsFID( const std::string& fid ) const = 0;
81 virtual void deleteFID( const std::string& FileID ) const = 0;
83 virtual void registerPFN( const std::string& fid, const std::string& pfn, const std::string& ftype ) const = 0;
85 virtual void registerLFN( const std::string& fid, const std::string& lfn ) const = 0;
87 virtual void registerFID( const std::string& fid ) const = 0;
89 virtual void renamePFN( const std::string& pfn, const std::string& new_pfn ) const = 0;
91 virtual void deletePFN( const std::string& pfn ) const = 0;
93 virtual void getMetaData( const std::string& fid, Attributes& attr ) const = 0;
95 virtual std::string getMetaDataItem( const std::string& fid, const std::string& name ) const = 0;
97 virtual void setMetaData( const std::string& fid, const std::string& name, const std::string& value ) const = 0;
99 virtual void dropMetaData( const std::string& fid ) const = 0;
101 virtual void dropMetaData( const std::string& fid, const std::string& attr ) const = 0;
102 };
103} /* End namespace Gaudi */
#define GAUDI_API
Definition Kernel.h:49
File catalog interface.
std::vector< NamedItem > Attributes
virtual bool existsPFN(const std::string &pfn) const =0
Return the status of a PFName.
virtual void renamePFN(const std::string &pfn, const std::string &new_pfn) const =0
rename a PFN
virtual void setMetaData(const std::string &fid, const std::string &name, const std::string &value) const =0
Insert/update metadata item.
DeclareInterfaceID(IFileCatalog, 2, 0)
InterfaceID.
virtual void dropMetaData(const std::string &fid, const std::string &attr) const =0
Drop specified metadata item.
virtual void rollback()=0
Save catalog to file.
virtual bool existsFID(const std::string &fid) const =0
Return the status of a FileID.
virtual void deletePFN(const std::string &pfn) const =0
remove a PFN
virtual bool readOnly() const =0
Check if the catalog is read-only.
virtual void getPFN(const std::string &fid, Files &files) const =0
Dump all PFNames of the catalog and their attributes associate to the FileID.
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::PluginService::Factory< IInterface *(const std::string &, IMessageSvc *)> Factory
virtual std::string lookupLFN(const std::string &lfn) const =0
Lookup file identifier by physical file name.
virtual bool dirty() const =0
Check if the catalog should be updated.
virtual std::string createFID() const =0
Catalog interface.
std::vector< std::string > Strings
std::pair< std::string, std::string > NamedItem
Public type definitions.
virtual void getMetaData(const std::string &fid, Attributes &attr) const =0
Dump all MetaData of the catalog for a given file ID.
virtual void commit()=0
Save catalog to file.
virtual bool existsLFN(const std::string &lfn) const =0
Return the status of a LFName.
virtual void init()=0
Parse the DOM tree of the XML catalog.
virtual void registerFID(const std::string &fid) const =0
Create a Node for a FileID and DOM Node.
virtual void getLFN(const std::string &fid, Files &files) const =0
Dump all LFNames of the catalog associate to the FileID.
virtual void getFID(Strings &fids) const =0
Dump all file Identifiers.
virtual std::string getMetaDataItem(const std::string &fid, const std::string &name) const =0
Access metadata item.
virtual void deleteFID(const std::string &FileID) const =0
Delete FileID Node from the catalog.
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.
virtual void dropMetaData(const std::string &fid) const =0
Drop all metadata of one FID.
std::vector< NamedItem > Files
virtual const std::string & connectInfo() const =0
Access to connect string.
virtual std::string lookupPFN(const std::string &lfn) const =0
Lookup file identifier by physical file name.
Definition of the basic interface.
Definition IInterface.h:225
The IMessage is the interface implemented by the message service.
Definition IMessageSvc.h:34
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1