xrootd
XrdSsiRRAgent.hh
Go to the documentation of this file.
1 #ifndef __XRDSSIRRAGENT_HH__
2 #define __XRDSSIRRAGENT_HH__
3 /******************************************************************************/
4 /* */
5 /* X r d S s i R R A g e n t . h h */
6 /* */
7 /* (c) 2017 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* Produced by Andrew Hanushevsky for Stanford University under contract */
9 /* DE-AC02-76-SFO0515 with the Department of Energy */
10 /* */
11 /* This file is part of the XRootD software suite. */
12 /* */
13 /* XRootD is free software: you can redistribute it and/or modify it under */
14 /* the terms of the GNU Lesser General Public License as published by the */
15 /* Free Software Foundation, either version 3 of the License, or (at your */
16 /* option) any later version. */
17 /* */
18 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
19 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
20 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
21 /* License for more details. */
22 /* */
23 /* You should have received a copy of the GNU Lesser General Public License */
24 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
25 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
26 /* */
27 /* The copyright holder's institutional names and contributor's names may not */
28 /* be used to endorse or promote products derived from this software without */
29 /* specific prior written permission of the institution or contributor. */
30 /******************************************************************************/
31 
32 #include "XrdSsi/XrdSsiRequest.hh"
34 
35 class XrdSsiMuex;
36 
38 {
39 public:
40 
41 static void Alert(XrdSsiRequest &reqR, XrdSsiRespInfoMsg &aMsg)
42  {reqR.Alert(aMsg);}
43 
44 static void CleanUp(XrdSsiRequest &reqR) {reqR.CleanUp();}
45 
46 static void Dispose(XrdSsiRequest &reqR) {reqR.Dispose();}
47 
48 static XrdSsiErrInfo &ErrInfoRef(XrdSsiRequest *rP) {return rP->errInfo;}
49 
50 static bool isaRetry(XrdSsiRequest *rP, bool reset=false)
51  {if (rP->flags & XrdSsiRequest::isaRetry)
52  {if (reset)
54  return true;
55  }
56  return false;
57  }
58 
59 static void onServer(XrdSsiRequest *rP) {rP->onClient = false;}
60 
61 static XrdSsiRequest *Request(XrdSsiResponder *rP) {return rP->reqP;}
62 
63 static XrdSsiRespInfo *RespP(XrdSsiRequest *rP) {return &(rP->Resp);}
64 
65 static void SetNode(XrdSsiRequest *rP, const char *name)
66  {rP->epNode = name;}
67 
69  {rP->spMutex.Lock();
70  rP->reqP = 0;
71  rP->spMutex.UnLock();
72  }
73 
74 static void SetMutex(XrdSsiRequest *rP, XrdSsiMutex *mP)
75  {rP->rrMutex = mP;}
76 };
77 #endif
void Lock()
Definition: XrdSsiAtomics.hh:115
Definition: XrdSsiAtomics.hh:109
Definition: XrdSsiRespInfo.hh:43
char flags
Definition: XrdSsiRequest.hh:315
static XrdSsiErrInfo & ErrInfoRef(XrdSsiRequest *rP)
Definition: XrdSsiRRAgent.hh:48
Definition: XrdSsiResponder.hh:68
XrdSsiRespInfo Resp
Definition: XrdSsiRequest.hh:308
static void SetMutex(XrdSsiRequest *rP, XrdSsiMutex *mP)
Definition: XrdSsiRRAgent.hh:74
XrdSsiMutex * rrMutex
Definition: XrdSsiRequest.hh:306
Definition: XrdSsiRespInfo.hh:86
static void ResetResponder(XrdSsiResponder *rP)
Definition: XrdSsiRRAgent.hh:68
static bool isaRetry(XrdSsiRequest *rP, bool reset=false)
Definition: XrdSsiRRAgent.hh:50
static XrdSsiRequest * Request(XrdSsiResponder *rP)
Definition: XrdSsiRRAgent.hh:61
static void Dispose(XrdSsiRequest &reqR)
Definition: XrdSsiRRAgent.hh:46
static void Alert(XrdSsiRequest &reqR, XrdSsiRespInfoMsg &aMsg)
Definition: XrdSsiRRAgent.hh:41
XrdSsiRequest * reqP
Definition: XrdSsiResponder.hh:262
static const int isaRetry
Definition: XrdSsiRequest.hh:316
static void SetNode(XrdSsiRequest *rP, const char *name)
Definition: XrdSsiRRAgent.hh:65
virtual void Alert(XrdSsiRespInfoMsg &aMsg)
Send or receive a server generated alert.
Definition: XrdSsiRequest.hh:238
bool onClient
Definition: XrdSsiRequest.hh:314
XrdSsiMutex spMutex
Definition: XrdSsiResponder.hh:261
XrdSsiErrInfo errInfo
Definition: XrdSsiRequest.hh:309
static void CleanUp(XrdSsiRequest &reqR)
Definition: XrdSsiRRAgent.hh:44
Definition: XrdSsiErrInfo.hh:40
Definition: XrdSsiRequest.hh:70
const char * epNode
Definition: XrdSsiRequest.hh:311
virtual void Dispose()
Definition: XrdSsiRequest.hh:303
static void onServer(XrdSsiRequest *rP)
Definition: XrdSsiRRAgent.hh:59
Definition: XrdSsiRRAgent.hh:37
static XrdSsiRespInfo * RespP(XrdSsiRequest *rP)
Definition: XrdSsiRRAgent.hh:63
void UnLock()
Definition: XrdSsiAtomics.hh:117