Debian Codegraph @

src/fileops/azure_meta_ops.hpp

raw
1 /*
2 * This File is part of Davix, The IO library for HTTP based protocols
3 * Copyright (C) CERN 2013
4 * Author: Adrien Devresse <[email protected]>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 */
21
22 #ifndef DAVMETA_HPP
23 #define DAVMETA_HPP
24
25 #include <davixcontext.hpp>
26 #include <params/davixrequestparams.hpp>
27 #include <file/davfile.hpp>
28 #include <fileops/httpiochain.hpp>
29
30 namespace Davix{
31
32 struct DirHandle;
33
34 ///
35 /// \brief The HttpMetaOps class
36 ///
37 /// The HttpMetaOps handle all meta-data operations related to HTTP/Webdav
38 class HttpMetaOps : public HttpIOChain{
39 public:
40 HttpMetaOps();
41 virtual ~HttpMetaOps();
42
43 // calculate hecksum
44 virtual void checksum(IOChainContext & iocontext, std::string & checksm, const std::string & chk_algo);
45
46 // delete resource
47 virtual void deleteResource(IOChainContext & iocontext);
48
49 // make collection
50 virtual void makeCollection(IOChainContext & iocontext);
51
52 // move/rename resource
53 virtual void move(IOChainContext & iocontext, const std::string & target_url);
54
55 // get statInfo
56 virtual StatInfo & statInfo(IOChainContext & iocontext, StatInfo & st_info);
57
58 virtual bool nextSubItem(IOChainContext &iocontext, std::string &entry_name, StatInfo &info);
59
60 private:
61
62 std::unique_ptr<DirHandle> directoryItem;
63 };
64
65
66 /// The HttpMetaOps handle all meta-data operations related to Aws S3
67 class S3MetaOps : public HttpIOChain{
68 public:
69 S3MetaOps();
70 virtual ~S3MetaOps();
71
72 // S3 + HTTP checksum computation
73 virtual void checksum(IOChainContext & iocontext, std::string & checksm, const std::string & chk_algo);
74
75 // get statInfo
76 virtual StatInfo & statInfo(IOChainContext & iocontext, StatInfo & st_info);
77
78 // make collection
79 virtual void makeCollection(IOChainContext & iocontext);
80
81 // listing
82 virtual bool nextSubItem(IOChainContext &iocontext, std::string &entry_name, StatInfo &info);
83
84 private:
85 std::unique_ptr<DirHandle> directoryItem;
86
87 };
88
89
90
91 /*
92 retrieve a webdav propfind stat request to the given url
93 @param req : http request where to executethe query
94 @return vector of characters of the query content
95 */
96 std::vector<char> req_webdav_propfind(HttpRequest* req, DavixError** err);
97
98
99
100 } // Davix
101
102
103
104
105 #endif // DAVMETA_HPP