• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

XrdOlbXmiReq.hh

Go to the documentation of this file.
00001 #ifndef _XRDOLBXMIREQ_H_
00002 #define _XRDOLBXMIREQ_H_
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*                       X r d O l b X m i R e q . h h                        */
00006 /*                                                                            */
00007 /* (c) 2006 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 
00013 #include "XrdOlb/XrdOlbReq.hh"
00014 #include "XrdOlb/XrdOlbXmi.hh"
00015 #include "XrdSys/XrdSysPthread.hh"
00016   
00017 class XrdOlbXmiReq : XrdOlbXmi
00018 {
00019 public:
00020 
00021        enum ReqType {do_chmod, do_mkdir, do_mkpath,do_mv,
00022                      do_prep,  do_rm,    do_rmdir, do_stage, do_stat};
00023 
00024        int  Chmod (      XrdOlbReq      *Request,
00025                    const char           *path,
00026                          mode_t          mode)
00027                   {return Qit(Request, do_chmod, path, (int)mode);}
00028 
00029        int  Mkdir (      XrdOlbReq      *Request,
00030                    const char           *path,
00031                          mode_t          mode)
00032                   {return Qit(Request, do_mkdir, path, (int)mode);}
00033 
00034        int  Mkpath(      XrdOlbReq      *Request,
00035                    const char           *path,
00036                          mode_t          mode)
00037                   {return Qit(Request, do_mkpath, path, (int)mode);}
00038 
00039        int  Prep  (const char           *ReqID,
00040                    const char           *path,
00041                          int             opts);
00042 
00043        int  Rename(      XrdOlbReq      *Request,
00044                    const char           *oldpath,
00045                    const char           *newpath);
00046 
00047        int  Remdir(      XrdOlbReq      *Request,
00048                    const char           *path)
00049                   {return Qit(Request, do_rmdir, path, 0);}
00050 
00051        int  Remove(      XrdOlbReq      *Request,
00052                    const char           *path)
00053                   {return Qit(Request, do_rm, path, 0);}
00054 
00055        int  Select(      XrdOlbReq      *Request,
00056                    const char           *path,
00057                          int             opts)
00058                   {return Qit(Request, do_stage, path, opts);}
00059 
00060        int  Stat  (      XrdOlbReq      *Request,
00061                    const char           *path)
00062                   {return Qit(Request, do_stat, path, 0);}
00063 
00064 static void processPrpQ();
00065 
00066 static void processReqQ();
00067 
00068 static void processStgQ();
00069 
00070             XrdOlbXmiReq(XrdOlbXmi *xp);
00071 
00072             XrdOlbXmiReq(XrdOlbReq *reqp, ReqType rqtype, 
00073                       const char *path, int parms);
00074 
00075 virtual    ~XrdOlbXmiReq();
00076 
00077 private:
00078 void Start();
00079 int  Qit(XrdOlbReq *rp, ReqType, const char *path, int parms);
00080 
00081 static XrdOlbXmi      *XmiP;
00082 static XrdSysMutex     prpMutex;
00083 static XrdSysSemaphore prpReady;
00084 static XrdOlbXmiReq   *prpFirst;
00085 static XrdOlbXmiReq   *prpLast;
00086 static XrdSysMutex     reqMutex;
00087 static XrdSysSemaphore reqReady;
00088 static XrdOlbXmiReq   *reqFirst;
00089 static XrdOlbXmiReq   *reqLast;
00090 static XrdSysMutex     stgMutex;
00091 static XrdSysSemaphore stgReady;
00092 static XrdOlbXmiReq   *stgFirst;
00093 static XrdOlbXmiReq   *stgLast;
00094        XrdOlbXmiReq   *Next;
00095        XrdOlbReq      *ReqP;
00096        char           *Path;
00097        int             Parms;
00098        ReqType         Rtype;
00099 };
00100 #endif

Generated on Wed Sep 1 2010 for xrootd by  doxygen 1.7.1