xrootd
Loading...
Searching...
No Matches
XrdSsiSessReal.hh
Go to the documentation of this file.
1#ifndef __XRDSSISESSREAL_HH__
2#define __XRDSSISESSREAL_HH__
3/******************************************************************************/
4/* */
5/* X r d S s i S e s s R e a l . h h */
6/* */
7/* (c) 2013 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 <cstring>
33
34#include "XrdCl/XrdClFile.hh"
35
37#include "XrdSsi/XrdSsiEvent.hh"
38
40
41class XrdSsiServReal;
42class XrdSsiTaskReal;
43
45{
46public:
47
49
50const char *GetKey() {return resKey;}
51
52uint32_t GetSID() {return sessID;}
53
55 const char *sName,
56 int uent,
57 bool hold,
58 bool newSID=false);
59
60 void Lock() {sessMutex.Lock();}
61
63
64 bool Provision(XrdSsiRequest *reqP, const char *epURL);
65
66 bool Run(XrdSsiRequest *reqP);
67
68 void SetKey(const char *key)
69 {if (resKey) free(resKey);
70 resKey = (key ? strdup(key) : 0);
71 }
72
74
75 void UnHold(bool cleanup=true);
76
78
80
82 XrdCl::AnyObject **respP);
83
84 void XeqEvFin() {}
85
87 const char *sName,
88 int uent,
89 bool hold=false)
90 : sessMutex(XrdSsiMutex::Recursive),
91 resKey(0), sessName(0), sessNode(0)
92 {InitSession(servP, sName, uent, hold, true);}
93
95
97
98private:
101void Shutdown(XrdCl::XRootDStatus &epStatus, bool onClose);
102
108char *resKey;
111uint32_t sessID;
112uint32_t nextTID;
113uint32_t alocLeft;
114int16_t uEnt; // User index for scaling
118};
119#endif
Definition XrdClAnyObject.hh:33
A file.
Definition XrdClFile.hh:46
Request status.
Definition XrdClXRootDResponses.hh:219
Definition XrdSsiEvent.hh:37
Definition XrdSsiAtomics.hh:110
void UnLock()
Definition XrdSsiAtomics.hh:117
void Lock()
Definition XrdSsiAtomics.hh:115
Definition XrdSsiRequest.hh:71
Definition XrdSsiServReal.hh:42
Definition XrdSsiSessReal.hh:45
bool Unprovision()
uint32_t GetSID()
Definition XrdSsiSessReal.hh:52
const char * GetKey()
Definition XrdSsiSessReal.hh:50
XrdSsiTaskReal * freeTask
Definition XrdSsiSessReal.hh:106
void InitSession(XrdSsiServReal *servP, const char *sName, int uent, bool hold, bool newSID=false)
uint32_t sessID
Definition XrdSsiSessReal.hh:111
bool isHeld
Definition XrdSsiSessReal.hh:115
XrdSsiMutex sessMutex
Definition XrdSsiSessReal.hh:103
char * resKey
Definition XrdSsiSessReal.hh:108
void Lock()
Definition XrdSsiSessReal.hh:60
void SetKey(const char *key)
Definition XrdSsiSessReal.hh:68
bool inOpen
Definition XrdSsiSessReal.hh:116
bool Provision(XrdSsiRequest *reqP, const char *epURL)
void UnLock()
Definition XrdSsiSessReal.hh:77
XrdSsiRequest * requestP
Definition XrdSsiSessReal.hh:107
char * sessNode
Definition XrdSsiSessReal.hh:110
bool Run(XrdSsiRequest *reqP)
XrdSsiMutex * MutexP()
Definition XrdSsiSessReal.hh:62
int XeqEvent(XrdCl::XRootDStatus *status, XrdCl::AnyObject **respP)
uint32_t alocLeft
Definition XrdSsiSessReal.hh:113
XrdSsiTaskReal * NewTask(XrdSsiRequest *reqP)
char * sessName
Definition XrdSsiSessReal.hh:109
void XeqEvFin()
Definition XrdSsiSessReal.hh:84
void Shutdown(XrdCl::XRootDStatus &epStatus, bool onClose)
XrdCl::File epFile
Definition XrdSsiSessReal.hh:96
int16_t uEnt
Definition XrdSsiSessReal.hh:114
XrdSsiSessReal * nextSess
Definition XrdSsiSessReal.hh:48
void UnHold(bool cleanup=true)
bool noReuse
Definition XrdSsiSessReal.hh:117
XrdSsiTaskReal * attBase
Definition XrdSsiSessReal.hh:105
void RelTask(XrdSsiTaskReal *tP)
XrdSsiServReal * myService
Definition XrdSsiSessReal.hh:104
void TaskFinished(XrdSsiTaskReal *tP)
XrdSsiSessReal(XrdSsiServReal *servP, const char *sName, int uent, bool hold=false)
Definition XrdSsiSessReal.hh:86
uint32_t nextTID
Definition XrdSsiSessReal.hh:112
Definition XrdSsiTaskReal.hh:45