Loading...
Searching...
No Matches
XrdOfsTPCInfo Class Reference

`#include <XrdOfsTPCInfo.hh>`

Collaboration diagram for XrdOfsTPCInfo:

## Public Member Functions

| 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)
| ~XrdOfsTPCInfo ()
void | Engage ()
int | Fail (XrdOucErrInfo *eRR, const char *eMsg, int eCode)
void | isDest ()
int | Match (const char *cKey, const char *cOrg, const char *xLfn, const char *xDst)
void | Reply (int rC, int eC, const char *eMsg, XrdSysMutex *mP=0)
const char * | Set (const char *cKey, const char *cOrg, const char *xLfn, const char *xDst, const char *xCks=0)
int | SetCB (XrdOucErrInfo *eRR)
void | SetCreds (const char *evar, const char *creds, int crdsz)
void | SetRPath (const char *rpath)
void | SetStreams (char sval)
void | Success ()

## Public Attributes

XrdOucCallBack * | cbP
char * | Cks
char * | Crd
int | Csz
char * | Dst
const char * | Env
bool | inWtR
bool | isAOK
bool | isDST
char * | Key
char * | Lfn
char * | Org
char * | Rpx
char * | Spr
char | Str
char * | Tpr

## Detailed Description

Definition at line 41 of file XrdOfsTPCInfo.hh.

## Constructor & Destructor Documentation

## XrdOfsTPCInfo()

XrdOfsTPCInfo::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 )

inline

Definition at line 78 of file XrdOfsTPCInfo.hh.

: cbP(0),
Cks(vCks ? strdup(vCks) :0),
Key(vKey ? strdup(vKey) :0),
Org(vOrg ? strdup(vOrg) :0),
Lfn(vLfn ? strdup(vLfn) :0),
Dst(vDst ? strdup(vDst) :0),
Spr(vSpr ? strdup(vSpr) :0),
Tpr(vTpr ? strdup(vTpr) :0),
Rpx(0), Env(0), Crd(0), Csz(0), Str(0),
inWtR(false), isDST(false), isAOK(false)
{}
XrdOfsTPCInfo::Dst
char * Dst
Definition XrdOfsTPCInfo.hh:100
XrdOfsTPCInfo::isDST
bool isDST
Definition XrdOfsTPCInfo.hh:109
XrdOfsTPCInfo::isAOK
bool isAOK
Definition XrdOfsTPCInfo.hh:110
XrdOfsTPCInfo::cbP
XrdOucCallBack * cbP
Definition XrdOfsTPCInfo.hh:95
XrdOfsTPCInfo::Csz
int Csz
Definition XrdOfsTPCInfo.hh:106
XrdOfsTPCInfo::Cks
char * Cks
Definition XrdOfsTPCInfo.hh:96
XrdOfsTPCInfo::Tpr
char * Tpr
Definition XrdOfsTPCInfo.hh:102
XrdOfsTPCInfo::Lfn
char * Lfn
Definition XrdOfsTPCInfo.hh:99
XrdOfsTPCInfo::Rpx
char * Rpx
Definition XrdOfsTPCInfo.hh:103
XrdOfsTPCInfo::Crd
char * Crd
Definition XrdOfsTPCInfo.hh:105
XrdOfsTPCInfo::Org
char * Org
Definition XrdOfsTPCInfo.hh:98
XrdOfsTPCInfo::Spr
char * Spr
Definition XrdOfsTPCInfo.hh:101
XrdOfsTPCInfo::Env
const char * Env
Definition XrdOfsTPCInfo.hh:104
XrdOfsTPCInfo::Str
char Str
Definition XrdOfsTPCInfo.hh:107
XrdOfsTPCInfo::Key
char * Key
Definition XrdOfsTPCInfo.hh:97
XrdOfsTPCInfo::inWtR
bool inWtR
Definition XrdOfsTPCInfo.hh:108

References cbP, Cks, Crd, Csz, Dst, Env, inWtR, isAOK, isDST, Key, Lfn, Org, Rpx, Spr, Str, and Tpr.

## ~XrdOfsTPCInfo()

XrdOfsTPCInfo::~XrdOfsTPCInfo | ( |  | ) |

Definition at line 61 of file XrdOfsTPCInfo.cc.

{
// Check if we should remove the file
//
if (isDST && !isAOK && XrdOfsTPCParms::Cfg.autoRM && Lfn)
XrdOfsOss->Unlink(Lfn);
// Delete all appendages
//
if (Key) {free(Key); Key = 0;}
if (Org) {free(Org); Org = 0;}
if (Lfn) {free(Lfn); Lfn = 0;}
if (Dst) {free(Dst); Dst = 0;}
if (Spr) {free(Spr); Spr = 0;}
if (Tpr) {free(Tpr); Tpr = 0;}
if (Cks) {free(Cks); Cks = 0;}
if (Rpx) {free(Rpx); Rpx = 0;}
if (Crd) {free(Crd); Crd = 0; Csz = 0;}
if (cbP) delete cbP;
}
XrdOfsOss
XrdOss * XrdOfsOss
Definition XrdOfs.cc:163
XrdOss::Unlink
virtual int Unlink(const char *path, int Opts=0, XrdOucEnv *envP=0)=0
XrdOfsTPCParms::Cfg
XrdOfsTPCConfig Cfg
Definition XrdOfsTPC.cc:85

References cbP, XrdOfsTPCParms::Cfg, Cks, Crd, Csz, Dst, isAOK, isDST, Key, Lfn, Org, Rpx, Spr, Tpr, and XrdOfsOss.

## Member Function Documentation

## Engage()

void XrdOfsTPCInfo::Engage | ( |  | ) |

inline

Definition at line 45 of file XrdOfsTPCInfo.hh.

{inWtR = true;} // Must be called w/ a serialization lock!

References inWtR.

## Fail()

int XrdOfsTPCInfo::Fail | ( | XrdOucErrInfo * | eRR,
|  | const char * | eMsg,
|  | int | eCode )

Definition at line 86 of file XrdOfsTPCInfo.cc.

{
char Buff[2048];
// Format the error message
//
snprintf(Buff, sizeof(Buff), "Unable to copy %s; %s", Lfn, eMsg);
// Print it out if debugging is enabled
//
#ifndef NODEBUG
OfsEroute.Emsg("TPC", Org, Buff);
#endif
// Place the error message in the error object and return
//
if (eRR) eRR->setErrInfo(eCode, Buff);
OfsStats.Add(OfsStats.Data.numTPCerrs);
return SFS_ERROR;
}
OfsEroute
XrdSysError OfsEroute(0)
OfsStats
XrdOfsStats OfsStats
Definition XrdOfs.cc:113
eMsg
#define eMsg(x)
Definition XrdSecsssAdmin.cc:53
SFS_ERROR
#define SFS_ERROR
Definition XrdSfsInterface.hh:109
XrdOfsStats::StatsData::numTPCerrs
int numTPCerrs
Definition XrdOfsStats.hh:56
XrdOfsStats::Data
struct XrdOfsStats::StatsData Data
XrdOfsStats::Add
void Add(int &Cntr)
Definition XrdOfsStats.hh:62
XrdOucErrInfo::setErrInfo
int setErrInfo(int code, const char *emsg)
Definition XrdOucErrInfo.hh:147
XrdSysError::Emsg
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition XrdSysError.cc:95

References eMsg, Lfn, OfsEroute, OfsStats, Org, XrdOucErrInfo::setErrInfo(), and SFS_ERROR.

Referenced by SetCB().

Here is the call graph for this function:
Here is the caller graph for this function:

## isDest()

void XrdOfsTPCInfo::isDest | ( |  | ) |

inline

Definition at line 49 of file XrdOfsTPCInfo.hh.

{isDST = true;}

References isDST.

Referenced by XrdOfsTPC::Validate().

Here is the caller graph for this function:

## Match()

int XrdOfsTPCInfo::Match | ( | const char * | cKey,
|  | const char * | cOrg,
|  | const char * | xLfn,
|  | const char * | xDst )

Definition at line 111 of file XrdOfsTPCInfo.cc.

{
if (cKey) {if (!Key || strcmp(Key, cKey)) return 0;}
else if (Key) return 0;
if (cOrg) {if (!Org || strcmp(Org, cOrg)) return 0;}
else if (Org) return 0;
if (xLfn) {if (!Lfn || strcmp(Lfn, xLfn)) return 0;}
else if (Lfn) return 0;
if (xDst) {if (!Dst || strcmp(Dst, xDst)) return 0;}
else if (Dst) return 0;
return 1;
}

References Dst, Key, Lfn, and Org.

## Reply()

void XrdOfsTPCInfo::Reply | ( | int | rC,
|  | int | eC,
|  | const char * | eMsg,
|  | XrdSysMutex * | mP = 0 )

Definition at line 133 of file XrdOfsTPCInfo.cc.

{
XrdOucCallBack *myCB = cbP;
// Clear pointer to call back prior to unlocking any locks
//
cbP = 0;
// Make sure a reply is valid here (i.e. client is in waitresop). If not,
// then we need to scuttle the whole shebang (must be done with a lock).
//
if (inWtR)
{inWtR = false;
if (mP) mP->UnLock();
if (myCB) myCB->Reply(rC, eC, eMsg, Lfn);
} else if (mP) mP->UnLock();
delete myCB;
}
XrdOucCallBack::Reply
int Reply(int retVal, int eValue, const char *eText, const char *Path=0)
Definition XrdOucCallBack.cc:81
XrdSysMutex::UnLock
void UnLock()
Definition XrdSysPthread.hh:224

References cbP, eMsg, inWtR, Lfn, XrdOucCallBack::Reply(), and XrdSysMutex::UnLock().

Referenced by XrdOfsTPCJob::Done().

Here is the call graph for this function:
Here is the caller graph for this function:

## Set()

const char * XrdOfsTPCInfo::Set | ( | const char * | cKey,
|  | const char * | cOrg,
|  | const char * | xLfn,
|  | const char * | xDst,
|  | const char * | xCks = 0 )

Definition at line 156 of file XrdOfsTPCInfo.cc.

{
const char *etext;
// Set the key
//
if (Key) free(Key);
Key = (cKey ? strdup(cKey) : 0);
// Set the origin
//
if (Org) free(Org);
Org = (cOrg ? strdup(cOrg) : 0);
// Set the lfn
//
if (Lfn) free(Lfn);
Lfn = (xLfn ? strdup(xLfn) : 0);
// Set optional dst
//
if (Dst) {free(Dst); Dst = 0;}
if (xDst)
{XrdNetAddr dAddr;
if (!(etext = dAddr.Set(xDst,0)))
Dst = strdup(dAddr.Name("0.0.0.0",&etext));
if (etext) return etext;
}
// Set the cks
//
if (Cks) free(Cks);
Cks = (xCks ? strdup(xCks) : 0);
// All done
//
return 0;
}
XrdNetAddrInfo::Name
const char * Name(const char *eName=0, const char **eText=0)
Definition XrdNetAddrInfo.cc:309
XrdNetAddr::Set
const char * Set(const char *hSpec, int pNum=PortInSpec)
Definition XrdNetAddr.cc:216

References Cks, Dst, Key, Lfn, XrdNetAddrInfo::Name(), Org, and XrdNetAddr::Set().

Here is the call graph for this function:

## SetCB()

int XrdOfsTPCInfo::SetCB | ( | XrdOucErrInfo * | eRR | ) |

Definition at line 201 of file XrdOfsTPCInfo.cc.

{
if (cbP) delete cbP;
cbP = new XrdOucCallBack();
if ((cbP->Init(eRR))) return 0;
delete cbP; cbP = 0;
return Fail(eRR, "tpc callback logic error", EPROTO);
}
XrdOfsTPCInfo::Fail
int Fail(XrdOucErrInfo *eRR, const char *eMsg, int eCode)
Definition XrdOfsTPCInfo.cc:86

References cbP, and Fail().

Here is the call graph for this function:

## SetCreds()

void XrdOfsTPCInfo::SetCreds | ( | const char * | evar,
|  | const char * | creds,
|  | int | crdsz )

inline

Definition at line 62 of file XrdOfsTPCInfo.hh.

{Env = evar;
Crd = (char *)malloc(crdsz);
memcpy(Crd, creds, crdsz);
Csz = crdsz;
}

References Crd, Csz, and Env.

Referenced by XrdOfsTPC::Validate().

Here is the caller graph for this function:

## SetRPath()

void XrdOfsTPCInfo::SetRPath | ( | const char * | rpath | ) |

inline

Definition at line 69 of file XrdOfsTPCInfo.hh.

{if (Rpx) free(Rpx);
Rpx = strdup(rpath);
}

References Rpx.

Referenced by XrdOfsTPC::Validate().

Here is the caller graph for this function:

## SetStreams()

void XrdOfsTPCInfo::SetStreams | ( | char | sval | ) |

inline

Definition at line 74 of file XrdOfsTPCInfo.hh.

{Str = sval;}

References Str.

Referenced by XrdOfsTPC::Validate().

Here is the caller graph for this function:

## Success()

void XrdOfsTPCInfo::Success | ( |  | ) |

inline

Definition at line 76 of file XrdOfsTPCInfo.hh.

{isAOK = true;}

References isAOK.

## Member Data Documentation

## cbP

XrdOucCallBack* XrdOfsTPCInfo::cbP

Definition at line 95 of file XrdOfsTPCInfo.hh.

Referenced by XrdOfsTPCInfo(), ~XrdOfsTPCInfo(), XrdOfsTPCJob::Done(), Reply(), and SetCB().

## Cks

char* XrdOfsTPCInfo::Cks

Definition at line 96 of file XrdOfsTPCInfo.hh.

Referenced by XrdOfsTPCInfo(), ~XrdOfsTPCInfo(), and Set().

## Crd

char* XrdOfsTPCInfo::Crd

Definition at line 105 of file XrdOfsTPCInfo.hh.

Referenced by XrdOfsTPCInfo(), ~XrdOfsTPCInfo(), and SetCreds().

## Csz

int XrdOfsTPCInfo::Csz

Definition at line 106 of file XrdOfsTPCInfo.hh.

Referenced by XrdOfsTPCInfo(), ~XrdOfsTPCInfo(), and SetCreds().

## Dst

char* XrdOfsTPCInfo::Dst

Definition at line 100 of file XrdOfsTPCInfo.hh.

Referenced by XrdOfsTPCInfo(), ~XrdOfsTPCInfo(), Match(), and Set().

## Env

const char* XrdOfsTPCInfo::Env

Definition at line 104 of file XrdOfsTPCInfo.hh.

Referenced by XrdOfsTPCInfo(), and SetCreds().

## inWtR

bool XrdOfsTPCInfo::inWtR

Definition at line 108 of file XrdOfsTPCInfo.hh.

Referenced by XrdOfsTPCInfo(), Engage(), and Reply().

## isAOK

bool XrdOfsTPCInfo::isAOK

Definition at line 110 of file XrdOfsTPCInfo.hh.

Referenced by XrdOfsTPCInfo(), ~XrdOfsTPCInfo(), and Success().

## isDST

bool XrdOfsTPCInfo::isDST

Definition at line 109 of file XrdOfsTPCInfo.hh.

Referenced by XrdOfsTPCInfo(), ~XrdOfsTPCInfo(), and isDest().

## Key

char* XrdOfsTPCInfo::Key

Definition at line 97 of file XrdOfsTPCInfo.hh.

Referenced by XrdOfsTPCInfo(), ~XrdOfsTPCInfo(), Match(), and Set().

## Lfn

char* XrdOfsTPCInfo::Lfn

Definition at line 99 of file XrdOfsTPCInfo.hh.

Referenced by XrdOfsTPCInfo(), ~XrdOfsTPCInfo(), Fail(), Match(), Reply(), and Set().

## Org

char* XrdOfsTPCInfo::Org

Definition at line 98 of file XrdOfsTPCInfo.hh.

Referenced by XrdOfsTPCInfo(), ~XrdOfsTPCInfo(), Fail(), Match(), and Set().

## Rpx

char* XrdOfsTPCInfo::Rpx

Definition at line 103 of file XrdOfsTPCInfo.hh.

Referenced by XrdOfsTPCInfo(), ~XrdOfsTPCInfo(), and SetRPath().

## Spr

char* XrdOfsTPCInfo::Spr

Definition at line 101 of file XrdOfsTPCInfo.hh.

Referenced by XrdOfsTPCInfo(), and ~XrdOfsTPCInfo().

## Str

char XrdOfsTPCInfo::Str

Definition at line 107 of file XrdOfsTPCInfo.hh.

Referenced by XrdOfsTPCInfo(), and SetStreams().

## Tpr

char* XrdOfsTPCInfo::Tpr

Definition at line 102 of file XrdOfsTPCInfo.hh.

Referenced by XrdOfsTPCInfo(), and ~XrdOfsTPCInfo().

The documentation for this class was generated from the following files:

- XrdOfsTPCInfo.hh
- XrdOfsTPCInfo.cc