ROOT  6.06/09
Reference Guide
XrdProofdAdmin.h
Go to the documentation of this file.
1 // @(#)root/proofd:$Id$
2 // Author: G. Ganis Feb 2008
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_XrdProofdAdmin
13 #define ROOT_XrdProofdAdmin
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // XrdProofdAdmin //
18 // //
19 // Author: G. Ganis, CERN, 2008 //
20 // //
21 // Envelop class for admin services. //
22 // Loaded as service by XrdProofdManager. //
23 // //
24 //////////////////////////////////////////////////////////////////////////
25 #include <sys/types.h>
26 #include <sys/stat.h>
27 #include <unistd.h>
28 
29 #include <list>
30 #include "XrdOuc/XrdOucHash.hh"
31 #include "XrdOuc/XrdOucString.hh"
32 
33 #include "XrdProofdConfig.h"
34 
35 class XrdProtocol_Config;
36 class XrdSysError;
37 class XrdProofdManager;
38 class XrdProofdProtocol;
39 class XrdProofdResponse;
41 public:
42  XrdOucString fCmd;
43  XrdOucString fFmt;
44  bool fCanPut;
45  XpdAdminCpCmd(const char *cmd, const char *fmt, bool put) :
46  fCmd(cmd), fFmt(fmt), fCanPut(put) { }
47 };
48 
50 
52  std::list<XrdOucString> fExportPaths;
53  XrdOucHash<XpdAdminCpCmd> fAllowedCpCmds; // List of copy commands
54  XrdOucString fCpCmds; // String with the allowed copy commands
55 
56  void RegisterDirectives();
57  int DoDirectiveExportPath(char *, XrdOucStream *, bool);
58  int DoDirectiveCpCmd(char *, XrdOucStream *, bool);
59 
60  int CheckForbiddenChars(const char *s);
61  int CheckPath(bool superuser, const char *sbdir, XrdOucString &fullpath,
62  int check, bool &sandbox, struct stat *st, XrdOucString &emsg);
64  int action, const char *cmd, XrdOucString &emsg);
65  int Send(XrdProofdResponse *r, const char *msg);
66 
67 public:
68  XrdProofdAdmin(XrdProofdManager *mgr, XrdProtocol_Config *pi, XrdSysError *e);
69  virtual ~XrdProofdAdmin() { }
70 
71  int Config(bool rcf = 0);
73  char *val, XrdOucStream *cfg, bool rcf);
74 
75  int Process(XrdProofdProtocol *p, int type);
76 
90  int Exec(XrdProofdProtocol *p);
91  int GetFile(XrdProofdProtocol *p);
92  int PutFile(XrdProofdProtocol *p);
93  int CpFile(XrdProofdProtocol *p);
94 };
95 
96 #endif
XpdAdminCpCmd(const char *cmd, const char *fmt, bool put)
int QueryLogPaths(XrdProofdProtocol *p)
Handle request for log paths.
int GetFile(XrdProofdProtocol *p)
Handle request for sending a file.
XrdOucString fFmt
XrdOucString fCpCmds
int ReleaseWorker(XrdProofdProtocol *p)
Handle request for releasing a worker.
int Exec(XrdProofdProtocol *p)
Handle request of cleaning parts of the sandbox.
int QuerySessions(XrdProofdProtocol *p)
Handle request for list of sessions.
int ExecCmd(XrdProofdProtocol *p, XrdProofdResponse *r, int action, const char *cmd, XrdOucString &emsg)
Low-level execution handler.
int CheckPath(bool superuser, const char *sbdir, XrdOucString &fullpath, int check, bool &sandbox, struct stat *st, XrdOucString &emsg)
Handle request for sending a file.
const double pi
int Process(XrdProofdProtocol *p, int type)
Process admin request.
int QueryMssUrl(XrdProofdProtocol *p)
Handle request for the URL to the MSS attached to the cluster.
int DoDirective(XrdProofdDirective *d, char *val, XrdOucStream *cfg, bool rcf)
Update the priorities of the active sessions.
int SetSessionTag(XrdProofdProtocol *p)
Handle request for setting the session tag.
int CheckForbiddenChars(const char *s)
Check is 's' contains any of the forbidden chars '(){};' Return 0 if OK (no forbidden chars)...
virtual ~XrdProofdAdmin()
int Send(XrdProofdResponse *r, const char *msg)
int QueryROOTVersions(XrdProofdProtocol *p)
Handle request for list of ROOT versions.
int QueryWorkers(XrdProofdProtocol *p)
Handle request for getting the list of potential workers.
int PutFile(XrdProofdProtocol *p)
Handle request for recieving a file.
std::list< XrdOucString > fExportPaths
ROOT::R::TRInterface & r
Definition: Object.C:4
int DoDirectiveExportPath(char *, XrdOucStream *, bool)
Process 'exportpath' directives eg: xpd.exportpath /tmp/data /data2/data.
#define XrdSysError
Definition: XpdSysError.h:8
int SetGroupProperties(XrdProofdProtocol *p)
Handle request for setting group properties.
XrdProofdAdmin(XrdProofdManager *mgr, XrdProtocol_Config *pi, XrdSysError *e)
Constructor.
XrdOucHash< XpdAdminCpCmd > fAllowedCpCmds
int CpFile(XrdProofdProtocol *p)
Handle request for copy files from / to the sandbox.
void RegisterDirectives()
Register directives for configuration.
int type
Definition: TGX11.cxx:120
int SetSessionAlias(XrdProofdProtocol *p)
Handle request for setting the session alias.
XrdProofdManager * fMgr
int Config(bool rcf=0)
Run configuration and parse the entered config directives.
int CleanupSessions(XrdProofdProtocol *p)
Handle request of.
int SetROOTVersion(XrdProofdProtocol *p)
Handle request for changing the default ROOT version.
int GetWorkers(XrdProofdProtocol *p)
Handle request for getting the best set of workers.
int SendMsgToUser(XrdProofdProtocol *p)
Handle request for sending a message to a user.
XrdOucString fCmd
int DoDirectiveCpCmd(char *, XrdOucStream *, bool)
Process 'cpcmd' directives eg: xpd.cpcmd alien aliencp fmt:"%s %s" put:0.