xrootd
XrdOfsTPCInfo.hh
Go to the documentation of this file.
1 #ifndef __XRDOFSTPCINFO_HH__
2 #define __XRDOFSTPCINFO_HH__
3 /******************************************************************************/
4 /* */
5 /* X r d O f s T P C I n f o . h h */
6 /* */
7 /* (c) 2012 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 
33 #include <stdlib.h>
34 #include <string.h>
35 
36 #include "XrdOuc/XrdOucCallBack.hh"
37 
38 class XrdOucErrInfo;
39 class XrdSysMutex;
40 
42 {
43 public:
44 
45 int Fail(XrdOucErrInfo *eRR, const char *eMsg, int eCode);
46 
47 int Match(const char *cKey, const char *cOrg,
48  const char *xLfn, const char *xDst);
49 
50 void Reply(int rC, int eC, const char *eMsg, XrdSysMutex *mP=0);
51 
52 const char *Set(const char *cKey, const char *cOrg,
53  const char *xLfn, const char *xDst,
54  const char *xCks=0);
55 
56 int SetCB(XrdOucErrInfo *eRR);
57 
58  XrdOfsTPCInfo(const char *vKey=0, const char *vOrg=0,
59  const char *vLfn=0, const char *vDst=0,
60  const char *vCks=0) : cbP(0),
61  Cks(vCks ? strdup(vCks) :0),
62  Key(vKey ? strdup(vKey) :0),
63  Org(vOrg ? strdup(vOrg) :0),
64  Lfn(vLfn ? strdup(vLfn) :0),
65  Dst(vDst ? strdup(vDst) :0) {}
66 
67  ~XrdOfsTPCInfo() {if (Key) {free(Key); Key = 0;}
68  if (Org) {free(Org); Org = 0;}
69  if (Lfn) {free(Lfn); Lfn = 0;}
70  if (Dst) {free(Dst); Dst = 0;}
71  if (Cks) {free(Cks); Cks = 0;}
72  if (cbP) delete cbP;
73  }
74 
75 XrdOucCallBack *cbP; // Callback object
76 char *Cks; // Checksum information (only at dest)
77 char *Key; // Rendezvous key or src URL
78 char *Org; // Rendezvous origin
79 char *Lfn; // Rendezvous path or dest LFN
80 char *Dst; // Rendezvous dest or dest PFN
81 };
82 #endif