Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:57:46

0001 /***********************************************************************************\
0002 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
0003 *                                                                                   *
0004 * This software is distributed under the terms of the Apache version 2 licence,     *
0005 * copied verbatim in the file "LICENSE".                                            *
0006 *                                                                                   *
0007 * In applying this licence, CERN does not waive the privileges and immunities       *
0008 * granted to it by virtue of its status as an Intergovernmental Organization        *
0009 * or submit itself to any jurisdiction.                                             *
0010 \***********************************************************************************/
0011 #ifndef GAUDIFILECATALOG_IFILECATALOG_H
0012 #define GAUDIFILECATALOG_IFILECATALOG_H
0013 
0014 #include "GaudiKernel/IInterface.h"
0015 #include <Gaudi/PluginService.h>
0016 #include <string>
0017 #include <utility>
0018 #include <vector>
0019 
0020 class IMessageSvc;
0021 
0022 /*
0023  *   Gaudi namespace declaration
0024  */
0025 namespace Gaudi {
0026 
0027   /** @class IFileCatalog IFileCatalog.h GaudiUtils/IFileCatalog.h
0028    *
0029    *  File catalog interface.
0030    *  Resolve file ids, physical and logical file names.
0031    *
0032    *  @author  M.Frank
0033    *  @version 1.0
0034    *  @date    20/10/2007
0035    */
0036   class GAUDI_API IFileCatalog : virtual public IInterface {
0037 
0038   public:
0039     /// InterfaceID
0040     DeclareInterfaceID( IFileCatalog, 2, 0 );
0041 
0042     using Factory = Gaudi::PluginService::Factory<IInterface*( const std::string&, IMessageSvc* )>;
0043 
0044     /// Public type definitions
0045     typedef std::pair<std::string, std::string> NamedItem;
0046     typedef std::vector<NamedItem>              Attributes;
0047     typedef std::vector<NamedItem>              Files;
0048     typedef std::vector<std::string>            Strings;
0049 
0050     /** Catalog interface                                               */
0051     /// Create file identifier using UUID mechanism
0052     virtual std::string createFID() const = 0;
0053     /// Access to connect string
0054     virtual const std::string& connectInfo() const = 0;
0055     /// Parse the DOM tree of the XML catalog
0056     virtual void init() = 0;
0057     /// Save catalog to file
0058     virtual void commit() = 0;
0059     /// Save catalog to file
0060     virtual void rollback() = 0;
0061     /// Check if the catalog is read-only
0062     virtual bool readOnly() const = 0;
0063     /// Check if the catalog should be updated
0064     virtual bool dirty() const = 0;
0065     /// Dump all PFNames of the catalog and their attributes associate to the FileID
0066     virtual void getPFN( const std::string& fid, Files& files ) const = 0;
0067     /// Dump all LFNames of the catalog associate to the FileID
0068     virtual void getLFN( const std::string& fid, Files& files ) const = 0;
0069     /// Dump all file Identifiers
0070     virtual void getFID( Strings& fids ) const = 0;
0071     /// Return the status of a PFName
0072     virtual bool existsPFN( const std::string& pfn ) const = 0;
0073     /// Lookup file identifier by physical file name
0074     virtual std::string lookupPFN( const std::string& lfn ) const = 0;
0075     /// Return the status of a LFName
0076     virtual bool existsLFN( const std::string& lfn ) const = 0;
0077     /// Lookup file identifier by physical file name
0078     virtual std::string lookupLFN( const std::string& lfn ) const = 0;
0079     /// Return the status of a FileID
0080     virtual bool existsFID( const std::string& fid ) const = 0;
0081     /// Delete FileID Node from the catalog
0082     virtual void deleteFID( const std::string& FileID ) const = 0;
0083     /// Create a Node for a FileID and DOM Node of the PFN with all the attributes
0084     virtual void registerPFN( const std::string& fid, const std::string& pfn, const std::string& ftype ) const = 0;
0085     /// Create a Node for a FileID and DOM Node of the LFN with all the attributes
0086     virtual void registerLFN( const std::string& fid, const std::string& lfn ) const = 0;
0087     /// Create a Node for a FileID and DOM Node
0088     virtual void registerFID( const std::string& fid ) const = 0;
0089     /// rename a PFN
0090     virtual void renamePFN( const std::string& pfn, const std::string& new_pfn ) const = 0;
0091     /// remove a PFN
0092     virtual void deletePFN( const std::string& pfn ) const = 0;
0093     /// Dump all MetaData of the catalog for a given file ID
0094     virtual void getMetaData( const std::string& fid, Attributes& attr ) const = 0;
0095     /// Access metadata item
0096     virtual std::string getMetaDataItem( const std::string& fid, const std::string& name ) const = 0;
0097     /// Insert/update metadata item
0098     virtual void setMetaData( const std::string& fid, const std::string& name, const std::string& value ) const = 0;
0099     /// Drop all metadata of one FID
0100     virtual void dropMetaData( const std::string& fid ) const = 0;
0101     /// Drop specified metadata item
0102     virtual void dropMetaData( const std::string& fid, const std::string& attr ) const = 0;
0103   };
0104 } /* End namespace Gaudi             */
0105 #endif /* GAUDIFILECATALOG_IFILECATALOG_H */