xrootd
XrdSsiServReal.hh
Go to the documentation of this file.
1 #ifndef __XRDSSISERVREAL_HH__
2 #define __XRDSSISERVREAL_HH__
3 /******************************************************************************/
4 /* */
5 /* X r d S s i S e r v 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 <map>
33 #include <string>
34 
35 #include "XrdSsi/XrdSsiService.hh"
36 #include "XrdSys/XrdSysPthread.hh"
37 
38 class XrdSsiResource;
39 class XrdSsiSessReal;
40 
42 {
43 public:
44 
46 
47 void Recycle(XrdSsiSessReal *sObj, bool reuse);
48 
49 bool Stop(bool immed=false);
50 
51 void StopReuse(const char *resKey);
52 
53  XrdSsiServReal(const char *contact, int hObj)
54  : manNode(strdup(contact)), freeSes(0),
55  freeCnt(0), freeMax(hObj), actvSes(0),
56  doStop(false) {}
57 
59 private:
60 
61 XrdSsiSessReal *Alloc(const char *sName, int uent, bool hold);
62 bool GenURL(XrdSsiResource *rP, char *buff, int blen, int uEnt);
63 bool ResReuse(XrdSsiRequest &reqRef, XrdSsiResource &resRef,
64  std::string &resKey);
65 
66 std::map<std::string, XrdSsiSessReal *> resCache;
68 
69 char *manNode;
72 int freeCnt;
73 int freeMax;
74 int actvSes;
75 bool doStop;
76 };
77 #endif
XrdSsiServReal::rcMutex
XrdSysMutex rcMutex
Definition: XrdSsiServReal.hh:67
XrdSsiServReal::actvSes
int actvSes
Definition: XrdSsiServReal.hh:74
XrdSysMutex
Definition: XrdSysPthread.hh:165
XrdSysPthread.hh
XrdSsiServReal::freeMax
int freeMax
Definition: XrdSsiServReal.hh:73
XrdSsiServReal::XrdSsiServReal
XrdSsiServReal(const char *contact, int hObj)
Definition: XrdSsiServReal.hh:53
XrdSsiServReal::ProcessRequest
void ProcessRequest(XrdSsiRequest &reqRef, XrdSsiResource &resRef)
Process a request; client-side or server-side.
XrdSsiServReal::myMutex
XrdSysMutex myMutex
Definition: XrdSsiServReal.hh:70
XrdSsiRequest
Definition: XrdSsiRequest.hh:71
XrdSsiServReal::resCache
std::map< std::string, XrdSsiSessReal * > resCache
Definition: XrdSsiServReal.hh:66
XrdSsiServReal::Stop
bool Stop(bool immed=false)
Stop the client-side service. This is never called server-side.
XrdSsiSessReal
Definition: XrdSsiSessReal.hh:45
XrdSsiServReal::Alloc
XrdSsiSessReal * Alloc(const char *sName, int uent, bool hold)
XrdSsiServReal::doStop
bool doStop
Definition: XrdSsiServReal.hh:75
XrdSsiService.hh
XrdSsiServReal::StopReuse
void StopReuse(const char *resKey)
XrdSsiServReal
Definition: XrdSsiServReal.hh:42
XrdSsiServReal::ResReuse
bool ResReuse(XrdSsiRequest &reqRef, XrdSsiResource &resRef, std::string &resKey)
XrdSsiResource
Definition: XrdSsiResource.hh:43
XrdSsiServReal::freeCnt
int freeCnt
Definition: XrdSsiServReal.hh:72
XrdSsiService
Definition: XrdSsiService.hh:55
XrdSsiServReal::Recycle
void Recycle(XrdSsiSessReal *sObj, bool reuse)
XrdSsiServReal::manNode
char * manNode
Definition: XrdSsiServReal.hh:69
XrdSsiServReal::~XrdSsiServReal
~XrdSsiServReal()
XrdSsiServReal::freeSes
XrdSsiSessReal * freeSes
Definition: XrdSsiServReal.hh:71
XrdSsiServReal::GenURL
bool GenURL(XrdSsiResource *rP, char *buff, int blen, int uEnt)