Loading...
Searching...
No Matches
XrdCmsResp Class Reference

`#include <XrdCmsResp.hh>`

Inheritance diagram for XrdCmsResp:
Collaboration diagram for XrdCmsResp:

## Public Member Functions

| XrdCmsResp ()
| ~XrdCmsResp ()
void | Done (int &Result, XrdOucErrInfo *eInfo, const char *Path=0)
int | ID ()
void | Reply (const char *Man, XrdCms::CmsRRHdr &rrhdr, XrdOucBuffer *netbuff)
int | Same (unsigned long long arg1, unsigned long long arg2)
Public Member Functions inherited from XrdOucEICB
| XrdOucEICB ()
| Constructor and destructor.
virtual | ~XrdOucEICB ()
Public Member Functions inherited from XrdOucErrInfo
| XrdOucErrInfo (const char *user, int MonID, int uc=0)
| XrdOucErrInfo (const char *user, XrdOucEnv *envp, int uc=0)
| XrdOucErrInfo (const char *user=0, XrdOucEICB *cb=0, unsigned long long ca=0, int mid=0, int uc=0)
virtual | ~XrdOucErrInfo ()
| Destructor.
void | clear ()
| Reset data and error information to null. Any appenadges are released.
bool | extData ()
XrdOucEnv * | getEnv ()
unsigned long long | getErrArg ()
XrdOucEICB * | getErrCB ()
XrdOucEICB * | getErrCB (unsigned long long &ap)
const char * | getErrData ()
int | getErrInfo ()
int | getErrMid ()
const char * | getErrText ()
const char * | getErrText (int &ecode)
int | getErrTextLen ()
const char * | getErrUser ()
char * | getMsgBuff (int &mblen)
int | getUCap ()
XrdOucErrInfo & | operator= (const XrdOucErrInfo &rhs)
| Assignment operator.
void | Reset ()
| Reset object to no message state. Call this method to release appendages.
XrdOucEnv * | setEnv (XrdOucEnv *newEnv)
void | setErrArg (unsigned long long cbarg=0)
void | setErrCB (XrdOucEICB *cb, unsigned long long cbarg=0)
int | setErrCode (int code)
void | setErrData (const char *Data, int Offs=0)
int | setErrInfo (int code, const char *emsg)
int | setErrInfo (int code, const char *txtlist[], int n)
int | setErrInfo (int code, XrdOucBuffer *buffP)
void | setErrMid (int mid)
| Set the monitoring identifier.
void | setErrUser (const char *user)
void | setUCap (int ucval)
| Set user capabilties.

## Static Public Member Functions

static XrdCmsResp * | Alloc (XrdOucErrInfo *erp, int msgid)
static void | Reply ()
static void | setDelay (int repdly)

## Friends

class | XrdCmsRespQ

## Additional Inherited Members

Protected Attributes inherited from XrdOucErrInfo
union { |
unsigned long long | ErrCBarg
XrdOucEnv * | ErrEnv
}; |
XrdOucBuffer * | dataBuff
short | dOff
XrdOucEICB * | ErrCB
XrdOucEI | ErrInfo
int | mID
short | reserved

## Detailed Description

Definition at line 69 of file XrdCmsResp.hh.

## Constructor & Destructor Documentation

## XrdCmsResp()

XrdCmsResp::XrdCmsResp | ( |  | ) |

inline

Definition at line 91 of file XrdCmsResp.hh.

: XrdOucErrInfo(UserID) {next = 0; myBuff = 0;}
XrdOucErrInfo::XrdOucErrInfo
XrdOucErrInfo(const char *user=0, XrdOucEICB *cb=0, unsigned long long ca=0, int mid=0, int uc=0)
Definition XrdOucErrInfo.hh:422

References XrdOucErrInfo::XrdOucErrInfo().

Referenced by Alloc(), Reply(), and XrdCmsRespQ.

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

## ~XrdCmsResp()

XrdCmsResp::~XrdCmsResp | ( |  | ) |

inline

Definition at line 92 of file XrdCmsResp.hh.

{}

## Member Function Documentation

## Alloc()

XrdCmsResp * XrdCmsResp::Alloc | ( | XrdOucErrInfo * | erp,
|  | int | msgid )

static

Definition at line 64 of file XrdCmsResp.cc.

{
XrdCmsResp *rp;
// Allocate a response object. We must be assured that the semaphore count
// is zero. This will be true for freshly allocated objects. For reused
// objects we will need to run down the count to zero as multiple calls
// to sem_init may produced undefined behaviour.
//
myMutex.Lock();
if (nextFree)
{rp = nextFree;
nextFree = rp->next;
numFree--;
rp->SyncCB.Init();
}
else if (!(rp = new XrdCmsResp()))
{myMutex.UnLock();
return (XrdCmsResp *)0;
}
myMutex.UnLock();
// Initialize it. We also replace the callback object pointer with a pointer
// to the synchronization semaphore as we have taken over the object and must
// provide a callback synchronization path for the caller. The OucEI object
// must be setup with pointers to stable areas and we will relocate any data
// to allow for a message to be sent back without overwriting the data (usually
// the path related to this request). We do this manually as the assignment
// operator does a bit more and a bit less than what we really need to do here.
//
strlcpy(rp->UserID, erp->getErrUser(), sizeof(rp->UserID));
rp->setErrUser(rp->UserID);
rp->setErrData(erp->getErrData(), XrdOucEI::Path_Offset);
rp->setErrInfo(0, "");
rp->setErrMid(erp->getErrMid());
rp->ErrCB = erp->getErrCB(rp->ErrCBarg);
erp->setErrCB((XrdOucEICB *)&rp->SyncCB);
rp->myID = msgid;
rp->next = 0;
// Return the response object
//
return rp;
}
strlcpy
size_t strlcpy(char *dst, const char *src, size_t sz)
Definition XrdSysPlatform.cc:60
XrdCmsRespCB::Init
void Init()
Definition XrdCmsResp.hh:49
XrdCmsResp::XrdCmsResp
XrdCmsResp()
Definition XrdCmsResp.hh:91
XrdOucEICB::XrdOucEICB
XrdOucEICB()
Constructor and destructor.
Definition XrdOucErrInfo.hh:522
XrdOucErrInfo::getErrUser
const char * getErrUser()
Definition XrdOucErrInfo.hh:297
XrdOucErrInfo::getErrCB
XrdOucEICB * getErrCB()
Definition XrdOucErrInfo.hh:224
XrdOucErrInfo::setErrCB
void setErrCB(XrdOucEICB *cb, unsigned long long cbarg=0)
Definition XrdOucErrInfo.hh:125
XrdOucErrInfo::setErrUser
void setErrUser(const char *user)
Definition XrdOucErrInfo.hh:195
XrdOucErrInfo::getErrData
const char * getErrData()
Definition XrdOucErrInfo.hh:333
XrdOucErrInfo::setErrMid
void setErrMid(int mid)
Set the monitoring identifier.
Definition XrdOucErrInfo.hh:362
XrdOucErrInfo::setErrInfo
int setErrInfo(int code, const char *emsg)
Definition XrdOucErrInfo.hh:147
XrdOucErrInfo::getErrMid
int getErrMid()
Definition XrdOucErrInfo.hh:356
XrdOucErrInfo::ErrCB
XrdOucEICB * ErrCB
Definition XrdOucErrInfo.hh:460
XrdOucErrInfo::setErrData
void setErrData(const char *Data, int Offs=0)
Definition XrdOucErrInfo.hh:342
XrdOucEI::Path_Offset
static const int Path_Offset
Definition XrdOucErrInfo.hh:52

References XrdCmsResp(), XrdOucEICB::XrdOucEICB(), XrdOucErrInfo::XrdOucErrInfo(), XrdOucErrInfo::ErrCB, XrdOucErrInfo::getErrCB(), XrdOucErrInfo::getErrData(), XrdOucErrInfo::getErrMid(), XrdOucErrInfo::getErrUser(), XrdCmsRespCB::Init(), XrdOucEI::Path_Offset, XrdOucErrInfo::setErrCB(), XrdOucErrInfo::setErrData(), XrdOucErrInfo::setErrInfo(), XrdOucErrInfo::setErrMid(), XrdOucErrInfo::setErrUser(), and strlcpy().

Referenced by XrdCmsClientMan::delayResp().

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

## Done()

void XrdCmsResp::Done | ( | int & | Result,
|  | XrdOucErrInfo * | eInfo,
|  | const char * | Path = 0 )

inline virtual

Invoke a callback after an operation completes.

Parameters

  Result | - the original function's result (may be changed).

  eInfo

  - Associated error information. The eInfo object may not be modified until it's own callback Done() method is called, if supplied. If the callback function in eInfo is zero, then the eInfo object is deleted by the invoked callback. Otherwise, that method must be invoked by this callback function after the actual callback message is sent. This allows the callback requestor to do post-processing and be asynchronous being assured that the callback completed.

  Path | - Optionally, the path related to thid request. It is used for tracing and detailed monitoring purposes.

Implements XrdOucEICB.

Definition at line 76 of file XrdCmsResp.hh.

{Recycle();}

References XrdOucErrInfo::XrdOucErrInfo(), and Path.

Here is the call graph for this function:

## ID()

int XrdCmsResp::ID | ( |  | ) |

inline

Definition at line 79 of file XrdCmsResp.hh.

{return myID;}

## Reply() [1/2]

void XrdCmsResp::Reply | ( |  | ) |

static

Definition at line 164 of file XrdCmsResp.cc.

{
XrdCmsResp *rp;
// Endless look looking for something to reply to
//
while(1)
{isReady.Wait();
rdyMutex.Lock();
if ((rp = First))
{if (!(First = rp->next)) Last = 0;
rdyMutex.UnLock();
rp->ReplyXeq();
} else rdyMutex.UnLock();
}
}

References XrdCmsResp().

Referenced by XrdCmsStartResp().

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

## Reply() [2/2]

void XrdCmsResp::Reply | ( | const char * | Man,
|  | XrdCms::CmsRRHdr & | rrhdr,
|  | XrdOucBuffer * | netbuff )

Definition at line 138 of file XrdCmsResp.cc.

{
// Copy the data we need to have
//
myRRHdr = rrhdr;
myBuff = netbuff;
next = 0;
strlcpy(theMan, manp, sizeof(theMan));
// Now queue this object
//
rdyMutex.Lock();
if (Last) {Last->next = this; Last = this;}
else Last=First = this;
rdyMutex.UnLock();
// Now indicate we have something to process
//
isReady.Post();
}

References strlcpy().

Here is the call graph for this function:

## Same()

int XrdCmsResp::Same | ( | unsigned long long | arg1,
|  | unsigned long long | arg2 )

inline virtual

Determine if two callback arguments refer to the same client.

Parameters

  arg1 | - The first callback argument.
  arg2 | - The second callback argument.

Returns
  !0 - The arguments refer to the same client.
  =0 - The arguments refer to the different clients.

Implements XrdOucEICB.

Definition at line 86 of file XrdCmsResp.hh.

{return 0;}

## setDelay()

void XrdCmsResp::setDelay | ( | int | repdly | ) |

inline static

Definition at line 89 of file XrdCmsResp.hh.

{RepDelay = repdly;}

## Friends And Related Symbol Documentation

## XrdCmsRespQ

friend class XrdCmsRespQ

friend

Definition at line 72 of file XrdCmsResp.hh.

References XrdCmsResp(), XrdOucErrInfo::XrdOucErrInfo(), and XrdCmsRespQ.

Referenced by XrdCmsRespQ.

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

- XrdCmsResp.hh
- XrdCmsResp.cc