interface/glite/wms/wmproxyapi/wmproxy_api.h

Go to the documentation of this file.
00001 // Copyright (c) Members of the EGEE Collaboration. 2004. 
00002 // See http://www.eu-egee.org/partners/ for details on the copyright
00003 // holders.  
00004 
00005 // Licensed under the Apache License, Version 2.0 (the "License"); 
00006 // you may not use this file except in compliance with the License. 
00007 // You may obtain a copy of the License at 
00008 
00009 //     http://www.apache.org/licenses/LICENSE-2.0 
00010 
00011 // Unless required by applicable law or agreed to in writing, software 
00012 // distributed under the License is distributed on an "AS IS" BASIS, 
00013 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
00014 // See the License for the specific language governing permissions and 
00015 // limitations under the License.
00016 
00017 #ifndef  GLITE_WMS_WMPROXYAPICPP_H
00018 #define GLITE_WMS_WMPROXYAPICPP_H
00019 #include <fstream>
00020 #include <iostream>
00021 #include <string>
00022 #include <vector>
00023 
00066 namespace glite {
00067 namespace wms {
00068 namespace wmproxyapi {
00069 
00070 
00071 
00075 struct BaseException {
00077         BaseException():ErrorCode(NULL),Description(NULL),FaultCause(NULL){};
00079         std::string                          methodName  ;
00081         time_t                               Timestamp     ;
00083         std::string*                         ErrorCode   ;
00085         std::string*                         Description ;
00087         std::vector<std::string> *FaultCause   ;
00088 };
00100 BaseException* createWmpException (BaseException *b_ex ,const std::string &method ,  const std::string &description );
00101 
00103 struct AuthenticationException:BaseException{};
00105 struct AuthorizationException:BaseException{};
00107 struct InvalidArgumentException:BaseException{};
00109 struct GetQuotaManagementException:BaseException{};
00111 struct NoSuitableResourcesException:BaseException{};
00113 struct JobUnknownException:BaseException{};
00115 struct OperationNotAllowedException:BaseException{};
00117 struct ServerOverloadedException:BaseException{};
00119 struct ProxyFileException:BaseException{};
00121 struct GrstDelegationException:BaseException{};
00123 struct GenericException:BaseException{};
00124 
00130 enum JdlType {
00132   ORIGINAL,
00137   REGISTERED
00138 };
00140 enum jobtype {
00142         JOBTYPE_NORMAL=1,
00144         JOBTYPE_PARAMETRIC =2,
00146         JOBTYPE_INTERACTIVE=4,
00148         JOBTYPE_MPICH=8,
00150         JOBTYPE_PARTITIONABLE=16,
00152         JOBTYPE_CHECKPOINTABLE =32
00153 };
00154 
00155 
00159 struct NodeStruct {
00161         std::string* nodeName ;
00163         std::vector< NodeStruct* > childrenNodes ;
00164 };
00168 struct JobIdApi {
00170         std::string jobid ;
00172         std::string* nodeName ;
00174         std::string* jobPath ;
00176         std::vector< JobIdApi* > children ;
00177 };
00178 
00183 struct VOProxyInfoStructType {
00184     std::string user ;
00185     std::string userCA;
00186     std::string server;
00187     std::string serverCA;
00188     std::string voName;
00189     std::string URI;
00190     std::string startTime;
00191     std::string endTime ;
00192     std::vector<std::string> attribute;
00193 };
00194 
00200 struct ProxyInfoStructType {
00201     std::string                          subject;
00202     std::string                          issuer;
00203     std::string                          identity;
00204     std::string                          type;
00205     std::string                          strength;
00206     std::string                          startTime;
00207     std::string                          endTime;
00208     std::vector<VOProxyInfoStructType*> vosInfo ;
00209 };
00210 
00211 
00212 struct ProxyReqStruct {
00213     std::string         proxy;
00214     std::string delegationId;
00215 };
00216 
00217 
00218 struct JobStatusStructType {
00219     std::string                          jobid;
00220     std::string                          status;
00221     std::vector<JobStatusStructType*> childrenJob;
00222 };
00231 struct ConfigContext{
00233         ConfigContext( std::string p , std::string s, std::string t);
00235         virtual ~ConfigContext() throw();
00237         std::string proxy_file;
00239         std::string endpoint;
00241         std::string trusted_cert_dir;
00243         int soap_timeout;
00245         bool server_authentication ;
00246 };
00247 
00251 void setServerAuthentication ( ConfigContext *cfs, bool auth );
00252 
00279 JobIdApi jobRegister (const std::string &jdl, const std::string &delegationId, ConfigContext *cfs=NULL);
00280 
00281 
00306 JobIdApi jobRegisterJSDL (std::ifstream &jsdlFile, const std::string &delegationId, ConfigContext *cfs=NULL);
00307 
00308 
00309 
00335 JobIdApi jobSubmit(const std::string &jdl, const std::string &delegationId, ConfigContext *cfs=NULL);
00336 
00337 
00363 JobIdApi jobSubmitJSDL(std::ifstream &jsdlFile, const std::string &delegationId, ConfigContext *cfs=NULL);
00364 
00365 
00388 void jobStart(const std::string &jobid, ConfigContext *cfs=NULL);
00389 
00390 
00410 void jobCancel(const std::string &jobid, ConfigContext *cfs=NULL);
00428 void jobPurge(const std::string &jobid, ConfigContext *cfs=NULL);
00429 
00445 std::vector <std::pair<std::string , long> > jobListMatch (const std::string &jdl, const std::string &delegationId, ConfigContext *cfs=NULL);
00446 
00447 
00463 std::vector <std::pair<std::string , long> > jobListMatchJSDL (std::ifstream &jsdlFile, const std::string &delegationId, ConfigContext *cfs=NULL);
00464 
00465 
00476 std::string getVersion(ConfigContext *cfs=NULL);
00477 
00488 long getMaxInputSandboxSize(ConfigContext *cfs=NULL);
00497 std::vector<std::string> getTransferProtocols(ConfigContext *cfs);
00520 std::vector<std::string>  getSandboxDestURI(const std::string &jobid, ConfigContext *cfs=NULL, const std::string &protocol="" );
00521 
00549  std::vector< std::pair<std::string ,std::vector<std::string > > > getSandboxBulkDestURI(std::string jobid, ConfigContext *cfs=NULL, const std::string &protocol="");
00550 
00551 /*
00552 * Returns the available user space quota on the storage managed by the WM.
00553 * The fault GetQuotaManagementFault is returned if the quota management is not active on the WM.
00554 * @param cfs Non-default configuration context (proxy file, endpoint URL and trusted cert location) ;  if NULL, the object is created with the default parameters
00555 * @return A pair containing the soft and the hard limit quota
00556 * @throws AuthenticationException An authentication problem occurred
00557 * @throws AuthorizationException The user is not authorized to perform this operation
00558 * @throws QuotaManagementException Quota management is not active on the WM
00559 * @throws GenericException A generic problem occurred
00560 * @throws BaseException Any other error occurred
00561 * @see #getTotalQuota
00562 * @see thrown exceptions:  AuthenticationException, AuthorizationException, QuotaManagementException, GenericException, BaseException
00563 **/
00564 std::pair<long, long> getFreeQuota(ConfigContext *cfs=NULL);
00578 std::pair<long, long> getTotalQuota(ConfigContext *cfs=NULL);
00597 std::vector <std::pair<std::string , long> > getOutputFileList (const std::string &jobid, ConfigContext *cfs=NULL, const std::string &protocol="");
00598 
00599 
00600 
00613 std::string getJDL(const std::string &jobid, const JdlType &jdlType, ConfigContext *cfs=NULL);
00614 
00615 
00640 void enableFilePerusal (const std::string &jobid, const std::vector<std::string> &files, ConfigContext *cfs=NULL);
00666 std::vector<std::string> getPerusalFiles (const std::string &jobid, const std::string &file, const bool &allchunks, ConfigContext *cfs=NULL, const std::string &protocol="");
00667 
00668 
00669 
00689 std::string getJobTemplate (int type, const std::string &executable,const std::string &arguments,
00690                         const std::string &requirements,const std::string &rank, ConfigContext *cfs=NULL);
00705 std::string getDAGTemplate(NodeStruct dependencies, const std::string &requirements,const std::string &rank, ConfigContext *cfs=NULL);
00720 std::string getCollectionTemplate(int jobNumber, const std::string &requirements,const std::string &rank, ConfigContext *cfs=NULL);
00738 std::string getIntParametricJobTemplate (std::vector<std::string> attributes , int parameters , int start , int step ,
00739                                 const std::string &requirements,const std::string &rank, ConfigContext *cfs=NULL);
00755 std::string getStringParametricJobTemplate (std::vector<std::string>attributes, std::vector<std::string> parameters,
00756                                 const std::string &requirements,const std::string &rank, ConfigContext *cfs=NULL);
00757 
00774 std::string getProxyReq(const std::string &delegationId, ConfigContext *cfs=NULL);
00787 std::string grst1GetProxyReq(const std::string &delegationId, ConfigContext *cfs=NULL);
00788 std::string grstGetProxyReq(const std::string &delegationId, ConfigContext *cfs=NULL);
00802 ProxyReqStruct getNewProxyReq(ConfigContext *cfs);
00811 std::string getDelegationVersion(ConfigContext *cfs);
00820 std::string getDelegationInterfaceVersion(ConfigContext *cfs);
00821 
00831 int getProxyTerminationTime (const std::string &delegationId, ConfigContext *cfs);
00840 void proxyDestroy (const std::string &delegationId, ConfigContext *cfs);
00849 std::string renewProxyReq (const std::string &delegationId, ConfigContext *cfs);
00865 void putProxy(const std::string &delegationId, const std::string &request, ConfigContext *cfs=NULL);
00880 void grst1PutProxy(const std::string &delegationId, const std::string &request, ConfigContext *cfs=NULL);
00881 void grstPutProxy(const std::string &delegationId, const std::string &request, ConfigContext *cfs=NULL);
00897 ProxyInfoStructType* getDelegatedProxyInfo(const std::string &delegationId, ConfigContext *cfs=NULL);
00915 ProxyInfoStructType* getJobProxyInfo(const std::string &jobId, ConfigContext *cfs=NULL);
00916 
00917 
00918 } // wmproxy namespace
00919 } // wms namespace
00920 } // glite namespace
00921 #endif
00922 //EOF
00923 
00924 
00925 
00926 
00927 
00928 
00929 
00930 
00931 
00932 
00933 
00934 

Generated on Wed May 16 19:13:03 2012 for glite-wms-wmproxy-api-cpp-3.3.3 by  doxygen 1.4.7