xrootd
XrdCmsFinder.hh
Go to the documentation of this file.
1 #ifndef __CMS_FINDER__
2 #define __CMS_FINDER__
3 /******************************************************************************/
4 /* */
5 /* X r d C m s F i n d 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 
13 #include "XrdCms/XrdCmsClient.hh"
14 
15 #include "XrdSys/XrdSysPthread.hh"
16 
17 class XrdCmsClientMan;
18 class XrdOss;
19 class XrdOucEnv;
20 class XrdOucErrInfo;
21 class XrdOucTList;
22 struct XrdCmsData;
23 class XrdCmsRRData;
24 struct XrdSfsPrep;
25 class XrdSysLogger;
26 
27 /******************************************************************************/
28 /* R e m o t e F i n d e r */
29 /******************************************************************************/
30 
32 {
33 public:
34  void Added(const char *path, int Pend=0) {}
35 
36  int Configure(const char *cfn, char *Args, XrdOucEnv *EnvInfo);
37 
38  int Forward(XrdOucErrInfo &Resp, const char *cmd,
39  const char *arg1=0, const char *arg2=0,
40  XrdOucEnv *Env1=0, XrdOucEnv *Env2=0);
41 
42  int Locate(XrdOucErrInfo &Resp, const char *path, int flags,
43  XrdOucEnv *Info=0);
44 
46 
47  int Prepare(XrdOucErrInfo &Resp, XrdSfsPrep &pargs,
48  XrdOucEnv *Info=0);
49 
50  void Removed(const char *path) {}
51 
52  void setSS(XrdOss *thess) {}
53 
54  int Space(XrdOucErrInfo &Resp, const char *path, XrdOucEnv *Info=0);
55 
56  XrdCmsFinderRMT(XrdSysLogger *lp, int whoami=0, int Port=0);
58 
59 static const int MaxMan = 15;
60 
61 private:
62 int Decode(char **resp);
63 void Inform(XrdCmsClientMan *xman, struct iovec xmsg[], int xnum);
64 XrdCmsClientMan *SelectManager(XrdOucErrInfo &Resp, const char *path);
65 void SelectManFail(XrdOucErrInfo &Resp);
66 int send2Man(XrdOucErrInfo &, const char *, struct iovec *, int);
68 
74 char *CMSPath;
75 int ConWait;
77 int RepNone;
78 int RepWait;
79 int FwdWait;
81 int isMeta;
82 int isProxy;
84 int myPort;
85 unsigned char SMode;
86 unsigned char sendID;
87 unsigned char savePath;
88 };
89 
90 /******************************************************************************/
91 /* T a r g e t F i n d e r */
92 /******************************************************************************/
93 
94 class XrdOucStream;
95 
97 {
98 public:
99  void Added(const char *path, int Pend=0);
100 
101  int Configure(const char *cfn, char *Args, XrdOucEnv *EnvInfo);
102 
103  int Locate(XrdOucErrInfo &Resp, const char *path, int flags,
104  XrdOucEnv *Info=0) {return 0;}
105 
106  int Prepare(XrdOucErrInfo &Resp, XrdSfsPrep &pargs,
107  XrdOucEnv *Info=0) {return 0;}
108 
109  void Removed(const char *path);
110 
111  int RunAdmin(char *Path);
112 
113  int Space(XrdOucErrInfo &Resp, const char *path, XrdOucEnv *envP=0)
114  {return 0;}
115 
116  void *Start();
117 
118  XrdCmsFinderTRG(XrdSysLogger *, int, int, XrdOss *theSS=0);
120 
121 private:
122 
123 void Hookup();
124 int Process(XrdCmsRRData &Data);
125 
129 int myPort;
130 char *CMSPath;
131 char *Login;
134 int Active;
135 };
136 #endif