|
xrootd
|
00001 #ifndef _CMS_CLIENTCONFIG_H 00002 #define _CMS_CLIENTCONFIG_H 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d C m s C l i e n t C o n f i g . h h */ 00006 /* */ 00007 /* (c) 2007 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC02-76-SFO0515 with the Department of Energy */ 00011 /* */ 00012 /* This file is part of the XRootD software suite. */ 00013 /* */ 00014 /* XRootD is free software: you can redistribute it and/or modify it under */ 00015 /* the terms of the GNU Lesser General Public License as published by the */ 00016 /* Free Software Foundation, either version 3 of the License, or (at your */ 00017 /* option) any later version. */ 00018 /* */ 00019 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00020 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00021 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00022 /* License for more details. */ 00023 /* */ 00024 /* You should have received a copy of the GNU Lesser General Public License */ 00025 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00026 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00027 /* */ 00028 /* The copyright holder's institutional names and contributor's names may not */ 00029 /* be used to endorse or promote products derived from this software without */ 00030 /* specific prior written permission of the institution or contributor. */ 00031 /******************************************************************************/ 00032 00033 #include "XrdOuc/XrdOucTList.hh" 00034 #include "XrdOuc/XrdOuca2x.hh" 00035 00036 class XrdOucStream; 00037 class XrdSysError; 00038 00039 #define ODC_FAILOVER 'f' 00040 #define ODC_ROUNDROB 'r' 00041 00042 class XrdCmsClientConfig 00043 { 00044 public: 00045 00046 enum configHow {configMeta = 1, configNorm = 2, configProxy = 4}; 00047 enum configWhat {configMan = 1, configSuper = 2, configServer = 4}; 00048 00049 int Configure(const char *cfn, configWhat What, configHow How); 00050 00051 int ConWait; // Seconds to wait for a manager connection 00052 int RepWait; // Seconds to wait for manager replies 00053 int RepWaitMS; // RepWait*1000 for poll() 00054 int RepDelay; // Seconds to delay before retrying manager 00055 int RepNone; // Max number of consecutive non-responses 00056 int PrepWait; // Millisecond wait between prepare requests 00057 int FwdWait; // Millisecond wait between foward requests 00058 int haveMeta; // Have a meta manager (only if we are a manager) 00059 00060 char *CMSPath; // Path to the local cmsd for target nodes 00061 char *myHost; 00062 const char *myName; 00063 00064 XrdOucTList *ManList; // List of managers for remote redirection 00065 XrdOucTList *PanList; // List of managers for proxy redirection 00066 unsigned char SMode; // Manager selection mode 00067 unsigned char SModeP; // Manager selection mode (proxy) 00068 00069 enum {FailOver = 'f', RoundRob = 'r'}; 00070 00071 XrdCmsClientConfig() : ConWait(10), RepWait(3), RepWaitMS(3000), 00072 RepDelay(5), RepNone(8), PrepWait(33), 00073 FwdWait(0), haveMeta(0), CMSPath(0), 00074 myHost(0), myName(0), 00075 ManList(0), PanList(0), 00076 SMode(FailOver), SModeP(FailOver), 00077 isMeta(0), isMan(0) {} 00078 ~XrdCmsClientConfig(); 00079 00080 private: 00081 int isMeta; // We are a meta manager 00082 int isMan; // We are a manager 00083 00084 int ConfigProc(const char *cfn); 00085 int ConfigXeq(char *var, XrdOucStream &Config); 00086 int xapath(XrdOucStream &Config); 00087 int xconw(XrdOucStream &Config); 00088 int xmang(XrdOucStream &Config); 00089 int xreqs(XrdOucStream &Config); 00090 int xtrac(XrdOucStream &Config); 00091 }; 00092 #endif
1.7.6.1