Back to index

nordugrid-arc-nox  1.1.0~rc6
arex_client.h
Go to the documentation of this file.
00001 // arex_client.h
00002 // A very simple client class for the A-REX service.
00003 
00004 #ifndef __COMPILER_AREX_CLIENT__
00005 #define __COMPILER_AREX_CLIENT__
00006 
00007 #include <stdlib.h>
00008 #include <string>
00009 #include <iostream>
00010 #include <stdexcept>
00011 #include <arc/ArcConfig.h>
00012 #include <arc/Logger.h>
00013 #include <arc/XMLNode.h>
00014 #include <arc/message/MCCLoader.h>
00015 #include <arc/message/SOAPEnvelope.h>
00016 #include <arc/message/PayloadSOAP.h>
00017 #include <arc/client/ClientInterface.h>
00018 #include <arc/URL.h>
00019 
00020 namespace Arc {
00021 
00023 
00026   class Compiler_AREXClientError : public std::runtime_error {
00027   public:
00028 
00030 
00033     Compiler_AREXClientError(const std::string& what="");
00034   };
00035 
00036 
00037   class Compiler_AREXFile {
00038   public:
00039     std::string remote;
00040     std::string local;
00041     Compiler_AREXFile(void) { };
00042     Compiler_AREXFile(const std::string& remote_,const std::string& local_):
00043              remote(remote_),local(local_) { };
00044   };
00045 
00046   typedef std::list<Compiler_AREXFile> Compiler_AREXFileList;
00047 
00049 
00056   class Compiler_AREXClient {
00057   public:
00058 
00060 
00073     Compiler_AREXClient(std::string configFile="") throw(Compiler_AREXClientError);
00074     Compiler_AREXClient(const Arc::URL& url,const Arc::MCCConfig& cfg) throw(Compiler_AREXClientError);
00075 
00077 
00080     ~Compiler_AREXClient();
00081     
00083 
00090     std::string submit(std::istream& jsdl_file,Compiler_AREXFileList& file_list,bool delegate = false) throw(Compiler_AREXClientError);
00091 
00093 
00099     std::string stat(const std::string& jobid) throw(Compiler_AREXClientError);
00100 
00102 
00107     void kill(const std::string& jobid) throw(Compiler_AREXClientError);
00108     
00110 
00116     void clean(const std::string& jobid) throw(Compiler_AREXClientError);
00117     
00119 
00123     std::string sstat(void) throw(Compiler_AREXClientError);
00124 
00125     ClientSOAP* SOAP(void) { return client; };
00126 
00127   private:
00128 
00130 
00133     Arc::Config* client_config;
00134 
00136 
00139     Arc::MCCLoader* client_loader;
00140 
00141     Arc::ClientSOAP* client;
00142 
00144 
00147     Arc::MCC* client_entry;
00148 
00150 
00152     Arc::NS arex_ns;
00153 
00155 
00158     static Arc::Logger logger;
00159   };
00160 
00161 }
00162 
00163 #endif