xrootd
Loading...
Searching...
No Matches
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 <cstdlib>
34#include <cstring>
35
37
38class XrdOucErrInfo;
39class XrdSysMutex;
40
42{
43public:
44
45void Engage() {inWtR = true;} // Must be called w/ a serialization lock!
46
47int Fail(XrdOucErrInfo *eRR, const char *eMsg, int eCode);
48
49void isDest() {isDST = true;}
50
51int Match(const char *cKey, const char *cOrg,
52 const char *xLfn, const char *xDst);
53
54void Reply(int rC, int eC, const char *eMsg, XrdSysMutex *mP=0);
55
56const char *Set(const char *cKey, const char *cOrg,
57 const char *xLfn, const char *xDst,
58 const char *xCks=0);
59
61
62void SetCreds(const char *evar, const char *creds, int crdsz)
63 {Env = evar;
64 Crd = (char *)malloc(crdsz);
65 memcpy(Crd, creds, crdsz);
66 Csz = crdsz;
67 }
68
69void SetRPath(const char *rpath)
70 {if (Rpx) free(Rpx);
71 Rpx = strdup(rpath);
72 }
73
74void SetStreams(char sval) {Str = sval;}
75
76void Success() {isAOK = true;}
77
78 XrdOfsTPCInfo(const char *vKey=0, const char *vOrg=0,
79 const char *vLfn=0, const char *vDst=0,
80 const char *vCks=0, const char *vSpr=0,
81 const char *vTpr=0) : cbP(0),
82 Cks(vCks ? strdup(vCks) :0),
83 Key(vKey ? strdup(vKey) :0),
84 Org(vOrg ? strdup(vOrg) :0),
85 Lfn(vLfn ? strdup(vLfn) :0),
86 Dst(vDst ? strdup(vDst) :0),
87 Spr(vSpr ? strdup(vSpr) :0),
88 Tpr(vTpr ? strdup(vTpr) :0),
89 Rpx(0), Env(0), Crd(0), Csz(0), Str(0),
90 inWtR(false), isDST(false), isAOK(false)
91 {}
92
94
95XrdOucCallBack *cbP; // Callback object
96char *Cks; // Checksum information (only at dest)
97char *Key; // Rendezvous key or src URL
98char *Org; // Rendezvous origin
99char *Lfn; // Rendezvous path or dest LFN
100char *Dst; // Rendezvous dest or dest PFN
101char *Spr; // Source protocol
102char *Tpr; // Target protocol
103char *Rpx; // -> Reproxy path
104const char *Env; // -> creds envar name
105char *Crd; // Credentials to be forwarded dst->src
106int Csz; // Size of credentials
107char Str; // Number of streams to use
108bool inWtR; // Traget in waitresp status, async reply is valid.
109bool isDST; // This info is about the destination file (PFN)
110bool isAOK; // The copy succeeded
111};
112#endif
Definition XrdOfsTPCInfo.hh:42
void SetRPath(const char *rpath)
Definition XrdOfsTPCInfo.hh:69
void isDest()
Definition XrdOfsTPCInfo.hh:49
char * Dst
Definition XrdOfsTPCInfo.hh:100
int Match(const char *cKey, const char *cOrg, const char *xLfn, const char *xDst)
bool isDST
Definition XrdOfsTPCInfo.hh:109
bool isAOK
Definition XrdOfsTPCInfo.hh:110
XrdOucCallBack * cbP
Definition XrdOfsTPCInfo.hh:95
int Csz
Definition XrdOfsTPCInfo.hh:106
char * Cks
Definition XrdOfsTPCInfo.hh:96
char * Tpr
Definition XrdOfsTPCInfo.hh:102
char * Lfn
Definition XrdOfsTPCInfo.hh:99
char * Rpx
Definition XrdOfsTPCInfo.hh:103
XrdOfsTPCInfo(const char *vKey=0, const char *vOrg=0, const char *vLfn=0, const char *vDst=0, const char *vCks=0, const char *vSpr=0, const char *vTpr=0)
Definition XrdOfsTPCInfo.hh:78
char * Crd
Definition XrdOfsTPCInfo.hh:105
void SetStreams(char sval)
Definition XrdOfsTPCInfo.hh:74
int SetCB(XrdOucErrInfo *eRR)
char * Org
Definition XrdOfsTPCInfo.hh:98
void SetCreds(const char *evar, const char *creds, int crdsz)
Definition XrdOfsTPCInfo.hh:62
char * Spr
Definition XrdOfsTPCInfo.hh:101
const char * Env
Definition XrdOfsTPCInfo.hh:104
const char * Set(const char *cKey, const char *cOrg, const char *xLfn, const char *xDst, const char *xCks=0)
char Str
Definition XrdOfsTPCInfo.hh:107
char * Key
Definition XrdOfsTPCInfo.hh:97
bool inWtR
Definition XrdOfsTPCInfo.hh:108
void Success()
Definition XrdOfsTPCInfo.hh:76
void Engage()
Definition XrdOfsTPCInfo.hh:45
void Reply(int rC, int eC, const char *eMsg, XrdSysMutex *mP=0)
int Fail(XrdOucErrInfo *eRR, const char *eMsg, int eCode)
Definition XrdOucCallBack.hh:47
Definition XrdOucErrInfo.hh:101
Definition XrdSysPthread.hh:165