xrootd
Loading...
Searching...
No Matches
XrdCmsManager.hh
Go to the documentation of this file.
1#ifndef __CMS_MANAGER__H
2#define __CMS_MANAGER__H
3/******************************************************************************/
4/* */
5/* X r d C m s M a n a g e r . h h */
6/* */
7/* (c) 2007 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 <cstdlib>
34#include <cstring>
35#include <strings.h>
36
38
40#include "XrdCms/XrdCmsTypes.hh"
42
43class XrdLink;
44class XrdCmsManList;
45class XrdCmsManTree;
46class XrdCmsNode;
47class XrdOucTList;
48
49/******************************************************************************/
50/* C l a s s X r d C m s M a n a g e r */
51/******************************************************************************/
52
53// This a single-instance global class
54//
56{
57public:
58friend class XrdCmsDelNode;
59
62
63static const int MTMax = 16; // Maximum number of Managers
64
65XrdCmsNode *Add(XrdLink *lp, int Lvl, bool &xit);
66
67void Delete(XrdCmsNode *nodeP);
68
69void Finished(const char *manP, int mPort);
70
71static void Inform(const char *What, const char *Data, int Dlen);
72static void Inform(const char *What, struct iovec *vP, int vN, int vT=0);
73static void Inform(XrdCms::CmsReqCode rCode, int rMod, const char *Arg=0, int Alen=0);
74static void Inform(XrdCms::CmsRRHdr &Hdr, const char *Arg=0, int Alen=0);
75
76static bool Present() {return MTHi >= 0;};
77
78void Remove(XrdCmsNode *nP, const char *reason=0);
79
80void Rerun(char *newMans);
81
82static void Reset();
83
84static bool Start(const XrdOucTList *mL);
85
86 bool Verify(XrdLink *lP, const char *sid, const char *sname);
87
88 XrdCmsManager(XrdOucTList *mlP, int snum);
89 ~XrdCmsManager() {} // This object should never be deleted
90
91private:
92int Run(XrdOucTList *manP);
93
94// The following are common across all manager instances
95//
98static char MastSID[MTMax];
99static int MTHi;
100
101// The following are specific to a manager instance
102//
107char *theSID;
109short siteID;
111};
112#endif
Definition XrdCmsManList.hh:40
Definition XrdCmsManTree.hh:39
Definition XrdCmsManager.hh:56
static bool Present()
Definition XrdCmsManager.hh:76
XrdCmsNode * Add(XrdLink *lp, int Lvl, bool &xit)
static void Reset()
void Rerun(char *newMans)
XrdOucTList * newManList
Definition XrdCmsManager.hh:103
static bool Start(const XrdOucTList *mL)
static char MastSID[MTMax]
Definition XrdCmsManager.hh:98
void Finished(const char *manP, int mPort)
char * theSID
Definition XrdCmsManager.hh:107
friend class XrdCmsDelNode
Definition XrdCmsManager.hh:58
bool wasRedir
Definition XrdCmsManager.hh:110
static void Inform(const char *What, struct iovec *vP, int vN, int vT=0)
int Run(XrdOucTList *manP)
char * theHost
Definition XrdCmsManager.hh:106
static void Inform(XrdCms::CmsReqCode rCode, int rMod, const char *Arg=0, int Alen=0)
static XrdSysMutex MTMutex
Definition XrdCmsManager.hh:96
char * theSite
Definition XrdCmsManager.hh:105
XrdCmsManTree * ManTree
Definition XrdCmsManager.hh:61
int curManCnt
Definition XrdCmsManager.hh:108
void Delete(XrdCmsNode *nodeP)
XrdCmsManager(XrdOucTList *mlP, int snum)
static XrdCmsNode * MastTab[MTMax]
Definition XrdCmsManager.hh:97
static void Inform(const char *What, const char *Data, int Dlen)
~XrdCmsManager()
Definition XrdCmsManager.hh:89
void Remove(XrdCmsNode *nP, const char *reason=0)
short siteID
Definition XrdCmsManager.hh:109
XrdOucTList * curManList
Definition XrdCmsManager.hh:104
bool Verify(XrdLink *lP, const char *sid, const char *sname)
static const int MTMax
Definition XrdCmsManager.hh:63
static void Inform(XrdCms::CmsRRHdr &Hdr, const char *Arg=0, int Alen=0)
XrdCmsManList * myMans
Definition XrdCmsManager.hh:60
static int MTHi
Definition XrdCmsManager.hh:99
Definition XrdCmsNode.hh:58
Definition XrdOucTList.hh:42
Definition XrdSysPthread.hh:165
CmsReqCode
Definition YProtocol.hh:90
Definition YProtocol.hh:83