TAlien.h

Go to the documentation of this file.
00001 // @(#)root/alien:$Id: TAlien.h 31993 2010-01-12 14:34:41Z rdm $
00002 // Author: Andreas Peters   5/5/2005
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TAlien
00013 #define ROOT_TAlien
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TAlien                                                               //
00019 //                                                                      //
00020 // Class defining interface to TAlien GRID services.                    //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TGrid
00025 #include "TGrid.h"
00026 #endif
00027 
00028 #ifndef ROOT_TList
00029 #include "TList.h"
00030 #endif
00031 
00032 class GapiUI;
00033 class TGridJob;
00034 class TGridJobStatusList;
00035 class TMap;
00036 
00037 
00038 class TAlien : public TGrid {
00039 
00040 public:
00041    enum { kSTDOUT = 0, kSTDERR = 1 , kOUTPUT = 2, kENVIR = 3 };
00042    enum CatalogType { kFailed = -1, kFile = 0, kDirectory, kCollection };
00043 
00044 private:
00045    // Stream content types.
00046    // The streams are originally defined in the CODEC.h of
00047    // the external gapiUI library.
00048 
00049    GapiUI    *fGc;    // the GapiUI object implementing the communication layer
00050    TString    fPwd;   // working directory
00051    TString    fHome;  // home directory with alien:// prefix
00052 
00053    TGridResult         *Command(const char *command, bool interactive = kFALSE,
00054                                 UInt_t stream = kOUTPUT);
00055    virtual TGridResult *Query(const char *path, const char *pattern,
00056                               const char *conditions = "", const char *options = "");
00057 
00058    virtual TGridResult *LocateSites();
00059    virtual TGridResult *OpenDataset(const char *lfn, const char *options = "");
00060 
00061 public:
00062    TAlien(const char *gridurl, const char *uid=0, const char *passwd=0,
00063           const char *options=0);
00064    virtual ~TAlien();
00065 
00066    void Shell();           // start an interactive ALIEN shell
00067 
00068    void Stdout();          // print the stdout of the last executed command
00069    void Stderr();          // print the stderr of the last executed command
00070 
00071    TMap  *GetColumn(UInt_t stream=0, UInt_t column=0);
00072    UInt_t GetNColumns(UInt_t stream);
00073 
00074    const char *GetStreamFieldValue(UInt_t stream, UInt_t column, UInt_t row);
00075    const char *GetStreamFieldKey(UInt_t stream, UInt_t column, UInt_t row);
00076 
00077    TString Escape(const char *input);
00078    virtual TGridJob *Submit(const char *jdl); // submit a grid job
00079    virtual TGridJDL *GetJDLGenerator();       // get a AliEn grid JDL object
00080    virtual TGridCollection* OpenCollection(const char* collectionfile, UInt_t maxentries = kTRUE);
00081    virtual TGridCollection* OpenCollectionQuery(TGridResult * queryresult, Bool_t nogrouping = kFALSE);
00082    virtual TGridJobStatusList* Ps(const char* options, Bool_t verbose = kTRUE);
00083    virtual Bool_t KillById(TString jobid);
00084    virtual Bool_t ResubmitById(TString jobid);
00085 
00086    //--- Catalogue Interface
00087    virtual TGridResult *Ls(const char *ldn="", Option_t *options="", Bool_t verbose=kFALSE);
00088    virtual const char  *Pwd(Bool_t verbose=kFALSE);
00089    virtual const char  *GetHomeDirectory() { return fHome.Data(); }
00090    virtual Bool_t Cd(const char *ldn="", Bool_t verbose=kFALSE);
00091    virtual Int_t Mkdir(const char *ldn="", Option_t *options="", Bool_t verbose=kFALSE);
00092    virtual Bool_t Rmdir(const char *ldn="", Option_t *options="", Bool_t verbose=kFALSE);
00093    virtual Bool_t Register(const char *lfn, const char *turl, Long_t size=-1,
00094                            const char *se=0, const char *guid=0, Bool_t verbose=kFALSE);
00095    virtual Bool_t Rm(const char *lfn, Option_t *option="", Bool_t verbose=kFALSE);
00096    virtual CatalogType Type(const char* lfn, Option_t* option = "", Bool_t verbose=kFALSE);
00097    virtual TGridResult* GetCollection(const char* lfn, Option_t* option = "", Bool_t verbose=kFALSE);
00098 
00099    //--- Software Packages
00100    virtual TGridResult* ListPackages(const char* alienpackagedir="/alice/packages");
00101    ClassDef(TAlien,0)  // Interface to Alien GRID services
00102 };
00103 
00104 #endif

Generated on Tue Jul 5 14:45:27 2011 for ROOT_528-00b_version by  doxygen 1.5.1