xrootd
XrdFrcProxy.hh
Go to the documentation of this file.
00001 #ifndef __XRDFRCPROXY__
00002 #define __XRDFRCPROXY__
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*                        X r d F r c P r o x y . h h                         */
00006 /*                                                                            */
00007 /* (c) 2010 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 "XrdFrc/XrdFrcRequest.hh"
00034 
00035 class XrdFrcReqAgent;
00036 class XrdOucStream;
00037 class XrdSysLogger;
00038   
00039 class XrdFrcProxy
00040 {
00041 public:
00042 
00043 int   Add(char Opc, const char *Lfn, const char *Opq, const char *Usr,
00044                     const char *Rid, const char *Nop, const char *Pop,
00045           int Prty=1);
00046 
00047 int   Del(char Opc, const char *Rid);
00048 
00049 static const int opGet =  1;
00050 static const int opPut =  2;
00051 static const int opMig =  4;
00052 static const int opStg =  8;
00053 static const int opAll = 15;
00054 
00055 class Queues
00056       {friend class XrdFrcProxy;
00057        int   Offset;
00058        char  Prty;
00059        char  QList;
00060        char  QNow;
00061        char  Active;
00062        public:
00063        Queues(int opX) : Offset(0), Prty(0), QList(opX), QNow(0), Active(0) {}
00064       ~Queues() {}
00065       };
00066 
00067 int   List(Queues &State, char *Buff, int Bsz);
00068 
00069 int   List(int qType, int qPrty, XrdFrcRequest::Item *Items, int Num);
00070 
00071 int   Init(int opX, const char *aPath, int aMode, const char *qPath=0);
00072 
00073       XrdFrcProxy(XrdSysLogger *lP, const char *iName, int Debug=0);
00074      ~XrdFrcProxy() {}
00075 
00076 private:
00077 
00078 int Init2(const char *cfgFN);
00079 int qChk(XrdOucStream &cFile);
00080 
00081 struct o2qMap {const char *qName; int qType; int oType;};
00082 
00083 static o2qMap   oqMap[];
00084 static int      oqNum;
00085 
00086 XrdFrcReqAgent *Agent[XrdFrcRequest::numQ];
00087 const char     *insName;
00088 char           *intName;
00089 char           *QPath;
00090 };
00091 #endif