pqServerConfiguration.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: $RCSfile$
5 
6  Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
7  All rights reserved.
8 
9  ParaView is a free software; you can redistribute it and/or modify it
10  under the terms of the ParaView license version 1.2.
11 
12  See License_v1.2.txt for the full ParaView license.
13  A copy of this license can be obtained by contacting
14  Kitware Inc.
15  28 Corporate Drive
16  Clifton Park, NY 12065
17  USA
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 ========================================================================*/
32 #ifndef pqServerConfiguration_h
33 #define pqServerConfiguration_h
34 
35 #include "pqCoreModule.h"
36 #include "pqServerResource.h"
37 #include "vtkPVXMLElement.h" // needed for ivar
38 #include "vtkSmartPointer.h"
39 #include <QObject>
40 
41 class vtkPVXMLElement;
42 class pqServerResource;
43 class vtkIndent;
44 
50 {
51 public:
56 
61 
65  pqServerConfiguration(const QString& name);
66 
71 
76  bool isMutable() const { return this->Mutable; }
77  void setMutable(bool val) { this->Mutable = val; }
78 
82  void setName(const QString& name);
83  QString name() const;
84 
90  bool isNameDefault() const;
91 
95  static QString defaultName();
96 
100  pqServerResource resource() const;
101  void setResource(const QString&);
102  void setResource(const pqServerResource&);
103 
113  pqServerResource actualResource();
114 
118  QString URI() const;
119 
125  int connectionTimeout(int defaultTimeout = 60) const;
126  void setConnectionTimeout(int connectionTimeout);
127 
132  {
135  COMMAND
136  };
137 
142  StartupType startupType() const;
143 
155  QString command(double& processWait, double& delay) const;
156 
167  QString execCommand(double& processWait, double& delay) const;
168 
172  void setStartupToManual();
173 
177  void setStartupToCommand(double processWait, double delay, const QString& command);
178 
182  QString toString(vtkIndent indent) const;
183 
187  pqServerConfiguration clone() const;
188 
192  vtkPVXMLElement* optionsXML() const;
193 
197  vtkPVXMLElement* hintsXML() const;
198 
204  bool isPortForwarding() const { return this->PortForwarding; };
205 
211  QString portForwardingLocalPort() const;
212 
213 protected:
214  vtkPVXMLElement* startupXML() const;
215 
216  void parseSshPortForwardingXML();
217  QString sshFullCommand(QString sshCommand, vtkPVXMLElement* sshConfigXML) const;
218 
219  static QString termCommand();
220  static QString sshCommand();
221  static QString lookForCommand(QString command);
222 
223 private:
224  void constructor(const QString& name);
225  void constructor(vtkPVXMLElement*);
226  bool Mutable = true;
228  bool PortForwarding = false;
229  bool SSHCommand = false;
230  QString PortForwardingLocalPort;
231  QString ActualURI;
232 };
233 
234 #endif
name
#define PQCORE_EXPORT
Definition: pqCoreModule.h:15
bool isMutable() const
Get/Set whether the configuration is mutable.
bool isPortForwarding() const
Get if this is a port forwarding configuration.
pqServerConfiguration corresponds to a server connection configuration.
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
pqServerResource encapsulates a resource in ParaView.