Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

descriptor/src/Task.h

00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: GPL 2.0
00004  *
00005  * K-10 Distributed Processing - Lium, Le Mans
00006  * Copyright (C) 2006 Frederic POUHET
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License
00010  * as published by the Free Software Foundation; either version 2
00011  * of the License, or (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00021  *
00022  * ***** END LICENSE BLOCK ***** */
00023  
00024 #ifndef TASK_H
00025 #define TASK_H
00026 
00027 #include "TaskDataInfo.h"
00028 #include "TaskFilterInfo.h"
00029 
00030 #include <string>
00031 #include <vector>
00032 #include <map>
00033 
00034 using namespace std;
00035 
00046 class Task
00047 {
00048 private:
00052         bool mModel;
00053 
00054    /* *
00055         * IP address of the machine running the k10 client
00056         */
00057         //string mClientIpAddr;
00061         string mTaskId;
00065         string mPriority;
00069         string mTaskName;
00073         string mCreationDate;
00077         string mExpiration;
00081         string mUserName;
00085         string mUserMail;
00089         string mBinSourcePath;
00093         string mBinCommand;
00097         string mResultLocalDir;
00101         string mResultStoragePath;
00105         vector <TaskDataInfo*> mDataInfoVect;
00109         map <string, TaskFilterInfo*> mFilterInfoMap;
00113 //      map <string, string> mFilters;
00114         
00115 public:
00116 
00117 
00121   static const std::string kFILTER_CPU_LOAD;
00125   static const std::string kFILTER_CPU_TYPE;
00129   static const std::string kFILTER_SYSTEM_TYPE;
00133   static const std::string kFILTER_ESTIMATED_DURATION;
00137   static const std::string kFILTER_DISK_SPACE;
00141   static const std::string kFILTER_MEM_FREE;
00145   static const std::string kFILTER_TARGET_HOST;
00146 
00150   static const std::string kTASK_STATE;
00151 
00152 
00153 
00158         Task();
00163         ~Task();
00164         
00165 
00170         void initialize();
00176         bool getModel();
00177    /* *
00178      * @fn getClientIpAddr()
00179      * @brief Get the client application IP adresse.
00180          * @return an IP address as string, (ex: "192.168.13.20")
00181      */
00182         //string getClientIpAddr();
00188         string getTaskId();
00194         string getPriority();
00200         string getTaskName();
00206         string getCreationDate();
00212         string getExpiration();
00218         string getUserName();
00224         string getUserMail();
00230         string getBinSourcePath();
00236         string getBinCommand();
00242         string getResultLocalDir();
00248         string getResultStoragePath();
00249 
00250 
00251 
00252         void addFilterInfo( TaskFilterInfo* aFilterInfo);
00253         void addFilterInfo(string aFilterType, string aComparaisonOperator,string aFilterValue);
00254         string getFilterValue(string aFilterType);
00255         string getFilterOperator(string aFilterType);
00256         TaskFilterInfo* getFilterInfo(string aFilterType);
00257         vector<string> Task::getFilterInfoSet();
00258 
00259 
00264         int getNbDataInfo();
00270         TaskDataInfo* getDataInfo(int index);
00275         void addDataInfo( TaskDataInfo* aData);
00276         void addDataInfo( bool aShared, string aSourcePath, string aLocalDir );
00277 
00278 
00279 
00280 //setters
00281         void setModel(bool model);
00282 //      void setClientIpAddr(string clientIpAddr);
00283         void setTaskId(string taskId);
00284         void setPriority(string priority);
00285         void setTaskName(string taskName);
00286         void setCreationDate(string creationDate);
00287         void setExpiration(string expiration);
00288         void setUserName(string userName);
00289         void setUserMail(string userMail);
00290         void setBinSourcePath(string binSourcePath);
00291         void setBinCommand(string binCommand) ;
00292         void setResultLocalDir(string resultLocalDir);
00293         void setResultStoragePath(string resultStoragePath);
00294 
00295         string toString();
00296         
00297                 
00298 };
00299 
00300 
00301 #endif
00302 
00303 
00304 
00305 
00306 

Generated on Fri May 19 23:12:36 2006 for common by  doxygen 1.4.4