XMLMetaDataCatalog.h 1.99 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/

#ifndef POOL_XMLMETADATACATALOG_H
#define POOL_XMLMETADATACATALOG_H
#include "FileCatalog/FCMetaImpl.h"
#include "FileCatalog/FCBuf.h"

#ifdef HAVE_GAUDI_PLUGINSVC
#include "Gaudi/PluginService.h"
#endif

namespace pool {
class FCImpl;
class MetaDataEntry;
class PoolXMLFileCatalog;
class XMLFileCatalog;
class XMLMetaDataCatalog: public FCMetaImpl{
 public:
#ifdef HAVE_GAUDI_PLUGINSVC
typedef Gaudi::PluginService::Factory1<FCMetaImpl*, FCImpl*> Factory;
#endif

  /// Defsult Constructor
  XMLMetaDataCatalog( FCImpl* fc );
  /// Virtual Destructor
  virtual ~XMLMetaDataCatalog();
  
  virtual void insertMetaData(MetaDataEntry& mentry) const;
  
  /**create meta data definition in the catalog
     @param schemadef [IN] schema definition.
  */
  virtual void createMetaDataSpec(MetaDataEntry& schemadef) const;
  
  /**update meta data definition in the catalog
     @param schemadef [IN] schema definition to add
  */
  virtual void updateMetaDataSpec(MetaDataEntry& newschemadef,
				  const FileCatalog::MetaUpdateMode metamode) const;
  
  /**get the metadata schema of the catalog
     @param spec [OUT] catalog meta data schema
  */
  virtual void getMetaDataSpec(MetaDataEntry& spec) const;
  
  /**drop the meta data definition from the catalog
   */
  virtual void dropMetaDataSpec() const;
  
  virtual void deleteMetaData(const FileCatalog::FileID& guid) const;
  
  
  virtual bool retrievePFN(const std::string& query, 
			   FCBuf<PFNEntry>& buf, 
			   const size_t& start );

  virtual bool retrieveLFN(const std::string& query, 
			   FCBuf<LFNEntry>& buf, 
			   const size_t& start );

  virtual bool retrieveMetaData(const std::string& query, 
				FCBuf<MetaDataEntry>& buf, 
				const size_t& start );
  virtual bool retrieveGuid(const std::string& query, 
			    FCBuf<FileCatalog::FileID>& buf, 
			    const size_t& start );

 private:
  mutable XMLFileCatalog* x_fc;
  mutable PoolXMLFileCatalog* XMLcon;
  

};
}
#endif