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  XrdSsiCms() : theCms(0), manList(0), manNum(0) {}
72 
73  XrdSsiCms(XrdCmsClient *cmsP);
74 
75 virtual ~XrdSsiCms();
76 
77 private:
78 
80 char **manList;
81 int manNum;
82 };
83 #endif
XrdSsiCms::~XrdSsiCms
virtual ~XrdSsiCms()
XrdSsiCms::Resource
int Resource(int n)
Definition: XrdSsiCms.hh:56
XrdCmsClient::Resume
virtual void Resume(int Perm=1)
Definition: XrdCmsClient.hh:267
XrdCmsClient
Definition: XrdCmsClient.hh:115
XrdCmsClient::Resource
virtual int Resource(int n)
Definition: XrdCmsClient.hh:291
XrdSsiCms::XrdSsiCms
XrdSsiCms()
Definition: XrdSsiCms.hh:71
XrdSsiCms
Definition: XrdSsiCms.hh:37
XrdCmsClient.hh
XrdSsiCluster
Definition: XrdSsiCluster.hh:40
XrdSsiCms::Release
int Release(int n=1)
Definition: XrdSsiCms.hh:66
XrdSsiCms::Resume
void Resume(bool perm=true)
Definition: XrdSsiCms.hh:50
XrdSsiCms::manList
char ** manList
Definition: XrdSsiCms.hh:80
XrdSsiCluster.hh
XrdCmsClient::Reserve
virtual int Reserve(int n=1)
Definition: XrdCmsClient.hh:303
XrdCmsClient::Release
virtual int Release(int n=1)
Definition: XrdCmsClient.hh:316
XrdSsiCms::Added
void Added(const char *name, bool pend=false)
XrdSsiCms::Reserve
int Reserve(int n=1)
Definition: XrdSsiCms.hh:61
XrdSsiCms::manNum
int manNum
Definition: XrdSsiCms.hh:81
XrdSsiCms::Suspend
void Suspend(bool perm=true)
Definition: XrdSsiCms.hh:53
XrdSsiCms::theCms
XrdCmsClient * theCms
Definition: XrdSsiCms.hh:79
XrdSsiCms::Managers
const char *const * Managers(int &mNum)
Definition: XrdSsiCms.hh:46
XrdCmsClient::Suspend
virtual void Suspend(int Perm=1)
Definition: XrdCmsClient.hh:276
XrdSsiCms::DataContext
bool DataContext()
Definition: XrdSsiCms.hh:43
XrdSsiCms::Removed
void Removed(const char *name)