00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef REMOTEQUEUEINTERFACE_H
00017 #define REMOTEQUEUEINTERFACE_H
00018
00019 #ifdef ENABLE_SSH
00020
00021 #include <globalsearch/queueinterface.h>
00022
00023 namespace GlobalSearch {
00024 class SSHConnection;
00025
00033 class RemoteQueueInterface : public QueueInterface
00034 {
00035 Q_OBJECT;
00036
00037 public:
00044 explicit RemoteQueueInterface(OptBase *parent,
00045 const QString &settingFile = "");
00046
00050 virtual ~RemoteQueueInterface();
00051
00052 public slots:
00053
00069 virtual bool writeFiles(Structure *s,
00070 const QHash<QString, QString> &files) const;
00071
00080 virtual bool startJob(Structure *s) =0;
00081
00087 virtual bool stopJob(Structure *s) =0;
00088
00092 virtual QueueInterface::QueueStatus getStatus(Structure *s) const =0;
00093
00104 virtual bool prepareForStructureUpdate(Structure *s) const;
00105
00117 virtual bool checkIfFileExists(Structure *s,
00118 const QString &filename,
00119 bool *exists);
00126 virtual bool fetchFile(Structure *s,
00127 const QString &filename,
00128 QString *contents) const;
00129
00160 virtual bool grepFile(Structure *s,
00161 const QString &matchText,
00162 const QString &filename,
00163 QStringList *matches = 0,
00164 int *exitcode = 0,
00165 const bool caseSensitive = true) const;
00166
00167 protected:
00179 bool createRemoteDirectory(Structure *structure,
00180 SSHConnection *ssh) const;
00181
00190 bool cleanRemoteDirectory(Structure *structure,
00191 SSHConnection *ssh) const;
00192
00202 bool copyRemoteFilesToLocalCache(Structure *structure,
00203 SSHConnection *ssh) const;
00204 };
00205 }
00206
00207 #endif // ENABLE_SSH
00208 #endif // REMOTEQUEUEINTERFACE_H