1 /******************************************************************************
2 
3   This source file is part of the MoleQueue project.
4 
5   Copyright 2011-2012 Kitware, Inc.
6 
7   This source code is released under the New BSD License, (the "License").
8 
9   Unless required by applicable law or agreed to in writing, software
10   distributed under the License is distributed on an "AS IS" BASIS,
11   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   See the License for the specific language governing permissions and
13   limitations under the License.
14 
15 ******************************************************************************/
16 
17 #include "sshconnection.h"
18 
19 #include <cstdlib>
20 
21 namespace MoleQueue {
22 
SshConnection(QObject * parentObject)23 SshConnection::SshConnection(QObject *parentObject) : QObject(parentObject),
24   m_persistent(false), m_portNumber(-1)
25 {
26 }
27 
~SshConnection()28 SshConnection::~SshConnection()
29 {
30 }
31 
isValid() const32 bool SshConnection::isValid() const
33 {
34   if (m_hostName.isEmpty())
35     return false;
36   else
37     return true;
38 }
39 
output() const40 QString SshConnection::output() const
41 {
42   return "";
43 }
44 
exitCode() const45 int SshConnection::exitCode() const
46 {
47   return -1;
48 }
49 
waitForCompletion(int)50 bool SshConnection::waitForCompletion(int)
51 {
52   return false;
53 }
54 
isComplete() const55 bool SshConnection::isComplete() const
56 {
57   return false;
58 }
59 
execute(const QString &)60 bool SshConnection::execute(const QString &)
61 {
62   // Always fails in the base class - no valid transport.
63   return false;
64 }
65 
copyTo(const QString &,const QString &)66 bool SshConnection::copyTo(const QString &, const QString &)
67 {
68   return false;
69 }
70 
copyFrom(const QString &,const QString &)71 bool SshConnection::copyFrom(const QString &, const QString &)
72 {
73   return false;
74 }
75 
copyDirTo(const QString &,const QString &)76 bool SshConnection::copyDirTo(const QString &, const QString &)
77 {
78   return false;
79 }
80 
copyDirFrom(const QString &,const QString &)81 bool SshConnection::copyDirFrom(const QString &, const QString &)
82 {
83   return false;
84 }
85 
debug()86 bool SshConnection::debug()
87 {
88   const char *val = qgetenv("MOLEQUEUE_DEBUG_SSH");
89   return (val != NULL && val[0] != '\0');
90 }
91 
92 } // End of namespace
93