Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
XrdProofdSandbox.h
Go to the documentation of this file.
1 // @(#)root/proofd:$Id$
2 // Author: G. Ganis Jan 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_XrdProofdSandbox
13 #define ROOT_XrdProofdSandbox
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // XrdProofdSandbox //
18 // //
19 // Authors: G. Ganis, CERN, 2008 //
20 // //
21 // Create and manage a Unix sandbox. //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #include <list>
26 
27 #include "XrdProofdAux.h"
28 #include "XrdOuc/XrdOucString.hh"
29 
30 class XrdProofdSandbox {
31 
32 private:
33 
34  bool fChangeOwn;
35  XrdOucString fDir;
36  XrdOucString fErrMsg;
37  bool fValid;
38  XrdProofUI fUI;
39 
40 
41  static int fgMaxOldSessions;
42  static XrdOucString fgWorkdir;
43  static XrdProofUI fgUI;
44 
45 public:
46  XrdProofdSandbox(XrdProofUI ui, bool full, bool changeown);
47 
48  const char *Dir() const { return fDir.c_str(); }
49 
50  int GuessTag(XrdOucString &tag, int ridx = 1);
51 
52  const char *ErrMsg() const { return fErrMsg.c_str(); }
53  bool IsValid() const { return fValid; }
54 
55  // Active sessions file management
56  int AddSession(const char *tag);
57  int RemoveSession(const char *tag);
58 
59  //Parse the session dirs
60  int GetSessionDirs(int opt, std::list<XrdOucString *> *sdirs,
61  XrdOucString *tag = 0);
62  int TrimSessionDirs();
63 
64  // The manager uses these to set configurable members
65  static void SetMaxOldSessions(int mxses) { fgMaxOldSessions = mxses; }
66  static void SetWorkdir(const char *wdir) { fgWorkdir = wdir; }
67 };
68 #endif