XRootD
XrdXrootdGPFile.hh
Go to the documentation of this file.
1 #ifndef __XRDXROOTDGPFILE_H__
2 #define __XRDXROOTDGPFILE_H__
3 /******************************************************************************/
4 /* */
5 /* X r d X r o o t d G P F i l e . h h */
6 /* */
7 /* (c) 2019 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC02-76-SFO0515 with the Department of Energy */
11 /* */
12 /* This file is part of the XRootD software suite. */
13 /* */
14 /* XRootD is free software: you can redistribute it and/or modify it under */
15 /* the terms of the GNU Lesser General Public License as published by the */
16 /* Free Software Foundation, either version 3 of the License, or (at your */
17 /* option) any later version. */
18 /* */
19 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22 /* License for more details. */
23 /* */
24 /* You should have received a copy of the GNU Lesser General Public License */
25 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27 /* */
28 /* The copyright holder's institutional names and contributor's names may not */
29 /* be used to endorse or promote products derived from this software without */
30 /* specific prior written permission of the institution or contributor. */
31 /******************************************************************************/
32 
35 
36 class XrdOucEnv;
37 class XrdOucErrInfo;
38 class XrdSecEntity;
39 class XrdSfs;
40 class XrdXrootdGPFAgent;
41 
42 /******************************************************************************/
43 /* C l a s s X r d X r o o t d G P F i l e I n f o */
44 /******************************************************************************/
45 
46 //------------------------------------------------------------------------------
50 //------------------------------------------------------------------------------
51 
53 {
54 public:
55 
56 const char *cksType;
57 const char *cksValue;
58 const char *src;
59 const char *srcCgi;
60 const char *dst;
61 const char *srcCgi;
62 uint16_t pingsec;
63 uint16_t streams;
64 
65 //------------------------------------------------------------------------------
76 //------------------------------------------------------------------------------
77 
78 bool Completed(const char *eMsg=0, int eNum=0);
79 
80 //------------------------------------------------------------------------------
89 //------------------------------------------------------------------------------
90 
91 enum Status {isPending = 0,
92  isCopying = 1,
93  isProving = 2
94  }
95 
96 bool Update(uint64_t xfrsz, Status stat);
97 
98 /******************************************************************************/
99 /* C o n s t r u c t o r & D e s t r u c t o r */
100 /******************************************************************************/
101 
102  XrdXrootdGPFileInfo(XrdXrootdGPFAgent &gpf)
103  : cksType(0), cksValue(0),
104  src(0), srcCgi(0), dst(0), dstCgi(0),
105  pingSec(0), streams(0),
106  gpfAgent(gpf) {}
107 
109 
110 private:
111 
112 XrdXrootdGPFAgent &gpfAgent;
113 };
114 
115 /******************************************************************************/
116 /* c l a s s X r d X r o o t d G P F i l e */
117 /******************************************************************************/
118 
120 {
121 public:
122 
123 //------------------------------------------------------------------------------
132 //-----------------------------------------------------------------------------
133 
134 virtual void getFile(const XrdXrootdGPFileInfo &gargs,
135  const XrdSecEntity *client=0) = 0;
136 
137 //------------------------------------------------------------------------------
146 //-----------------------------------------------------------------------------
147 
148 virtual void putFile(const XrdXrootdGPFileInfo &pargs,
149  const XrdSecEntity *client=0) = 0;
150 
151 //------------------------------------------------------------------------------
153 //------------------------------------------------------------------------------
154 
156 
157 //------------------------------------------------------------------------------
159 //------------------------------------------------------------------------------
160 
161 virtual ~XrdXrootdGPFile() {}
162 };
163 
164 /******************************************************************************/
165 /* X r d X r o o t d g e t G P F i l e */
166 /******************************************************************************/
167 
168 //------------------------------------------------------------------------------
186 //------------------------------------------------------------------------------
187 
188 class XrdSysError;
189 
190 typedef XrdXrootdGPFile *(*XrdOfsgetPrepare_t)(XrdSysError *eDest,
191  const char *confg,
192  const char *parms,
193  XrdSfs *theSfs,
194  XrdOucEnv *envP
195  );
196 
197 #define XrdOfsgetPrepareArguments XrdSysError *eDest,\
198  const char *confg,\
199  const char *parms,\
200  XrdSfs *theSfs,\
201  XrdOucEnv *envP
202 /*
203 extern "C" XrdXrootdGPFile_t *XrdXrootdgetGPFile;
204 */
205 
206 //------------------------------------------------------------------------------
212 //------------------------------------------------------------------------------
213 
219 #endif
static XrdSysError eDest(0,"crypto_")
int stat(const char *path, struct stat *buf)
#define eMsg(x)
enum XrdXrootdGPFileInfo::Status Update(uint64_t xfrsz, Status stat)
const char * srcCgi
Source cgi or nil if none.
uint16_t pingsec
Seconds between ping call to Update()
const char * cksType
Checksum type or nil if none wanted.
uint16_t streams
Number of parallel streams (0 -> default)
XrdXrootdGPFileInfo(XrdXrootdGPFAgent &gpf)
const char * src
Source specification (path or URL)
bool Completed(const char *eMsg=0, int eNum=0)
const char * dst
Destination specification (path or URL)
@ isPending
Copy operation is pending.
@ isProving
Copy operation verifiying checksum.
@ isCopying
Copy operation in progress.
const char * cksValue
Checksum value or nil if none wanted.
virtual void getFile(const XrdXrootdGPFileInfo &gargs, const XrdSecEntity *client=0)=0
virtual void putFile(const XrdXrootdGPFileInfo &pargs, const XrdSecEntity *client=0)=0
virtual ~XrdXrootdGPFile()
Destructor.
XrdXrootdGPFile()
Constructor.
XrdOucEnv * envP
Definition: XrdPss.cc:109