xrootd
XrdSsiCms.hh
Go to the documentation of this file.
1 #ifndef __XRDSSICMS_H__
2 #define __XRDSSICMS_H__
3 /******************************************************************************/
4 /* */
5 /* X r d S s i C m s . h h */
6 /* */
7 /* (c) 2014 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC02-76-SFO0515 with the Department of Energy */
11 /* */
12 /* This file is part of the XRootD software suite. */
13 /* */
14 /* XRootD is free software: you can redistribute it and/or modify it under */
15 /* the terms of the GNU Lesser General Public License as published by the */
16 /* Free Software Foundation, either version 3 of the License, or (at your */
17 /* option) any later version. */
18 /* */
19 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22 /* License for more details. */
23 /* */
24 /* You should have received a copy of the GNU Lesser General Public License */
25 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27 /* */
28 /* The copyright holder's institutional names and contributor's names may not */
29 /* be used to endorse or promote products derived from this software without */
30 /* specific prior written permission of the institution or contributor. */
31 /******************************************************************************/
32 
33 #include "XrdCms/XrdCmsClient.hh"
34 #include "XrdSsi/XrdSsiCluster.hh"
35 
36 
37 class XrdSsiCms : public XrdSsiCluster
38 {
39 public:
40 
41  void Added(const char *name, bool pend=false);
42 
43  bool DataContext() {return true;}
44 
45 const char *
46 const * Managers(int &mNum) {mNum = manNum; return manList;}
47 
48  void Removed(const char *name);
49 
50  void Resume (bool perm=true)
51  {if (theCms) theCms->Resume(perm);}
52 
53  void Suspend(bool perm=true)
54  {if (theCms) theCms->Suspend(perm);}
55 
56  int Resource(int n)
57  {if (theCms) return theCms->Resource(n);
58  return 0;
59  }
60 
61  int Reserve (int n=1)
62  {if (theCms) return theCms->Reserve(n);
63  return 0;
64  }
65 
66  int Release (int n=1)
67  {if (theCms) return theCms->Release(n);
68  return 0;
69  }
70 
71  void Utilization(unsigned int util, bool alert=false)
72  {if (theCms) return theCms->Utilization(util, alert);}
73 
74  XrdSsiCms() : theCms(0), manList(0), manNum(0) {}
75 
76  XrdSsiCms(XrdCmsClient *cmsP);
77 
78 virtual ~XrdSsiCms();
79 
80 private:
81 
83 char **manList;
84 int manNum;
85 };
86 #endif
virtual int Release(int n=1)
Definition: XrdCmsClient.hh:316
int manNum
Definition: XrdSsiCms.hh:84
int Release(int n=1)
Definition: XrdSsiCms.hh:66
void Suspend(bool perm=true)
Definition: XrdSsiCms.hh:53
virtual void Utilization(unsigned int util, bool alert=false)
Definition: XrdCmsClient.hh:343
XrdSsiCms()
Definition: XrdSsiCms.hh:74
int Reserve(int n=1)
Definition: XrdSsiCms.hh:61
void Added(const char *name, bool pend=false)
Definition: XrdCmsClient.hh:115
virtual int Reserve(int n=1)
Definition: XrdCmsClient.hh:303
virtual ~XrdSsiCms()
int Resource(int n)
Definition: XrdSsiCms.hh:56
virtual int Resource(int n)
Definition: XrdCmsClient.hh:291
void Resume(bool perm=true)
Definition: XrdSsiCms.hh:50
char ** manList
Definition: XrdSsiCms.hh:83
const char *const * Managers(int &mNum)
Definition: XrdSsiCms.hh:46
Definition: XrdSsiCms.hh:37
virtual void Suspend(int Perm=1)
Definition: XrdCmsClient.hh:276
bool DataContext()
Definition: XrdSsiCms.hh:43
void Utilization(unsigned int util, bool alert=false)
Definition: XrdSsiCms.hh:71
XrdCmsClient * theCms
Definition: XrdSsiCms.hh:82
void Removed(const char *name)
Definition: XrdSsiCluster.hh:40
virtual void Resume(int Perm=1)
Definition: XrdCmsClient.hh:267