pqServerConfiguration.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqServerConfiguration_h
5 #define pqServerConfiguration_h
6 
7 #include "pqCoreModule.h"
8 #include "pqServerResource.h"
9 #include "vtkPVXMLElement.h" // needed for ivar
10 #include "vtkSmartPointer.h"
11 #include <QObject>
12 
13 class vtkPVXMLElement;
14 class pqServerResource;
15 class vtkIndent;
16 
22 {
23 public:
28 
33 
37  pqServerConfiguration(const QString& name);
38 
43 
48  bool isMutable() const { return this->Mutable; }
49  void setMutable(bool val) { this->Mutable = val; }
50 
54  void setName(const QString& name);
55  QString name() const;
56 
62  bool isNameDefault() const;
63 
67  static QString defaultName();
68 
72  pqServerResource resource() const;
73  void setResource(const QString&);
74  void setResource(const pqServerResource&);
75 
85  pqServerResource actualResource();
86 
90  QString URI() const;
91 
97  int connectionTimeout(int defaultTimeout = 60) const;
98  void setConnectionTimeout(int connectionTimeout);
99 
104  {
107  COMMAND
108  };
109 
114  StartupType startupType() const;
115 
127  QString command(double& processWait, double& delay) const;
128 
139  QString execCommand(double& processWait, double& delay) const;
140 
144  void setStartupToManual();
145 
149  void setStartupToCommand(double processWait, double delay, const QString& command);
150 
154  QString toString(vtkIndent indent) const;
155 
159  pqServerConfiguration clone() const;
160 
164  vtkPVXMLElement* optionsXML() const;
165 
169  vtkPVXMLElement* hintsXML() const;
170 
176  bool isPortForwarding() const { return this->PortForwarding; };
177 
183  QString portForwardingLocalPort() const;
184 
185 protected:
186  vtkPVXMLElement* startupXML() const;
187 
188  void parseSshPortForwardingXML();
189  QString sshFullCommand(QString sshCommand, vtkPVXMLElement* sshConfigXML) const;
190 
191  static QString termCommand();
192  static QString sshCommand();
193  static QString lookForCommand(QString command);
194 
195 private:
196  void constructor(const QString& name);
197  void constructor(vtkPVXMLElement*);
198  bool Mutable = true;
200  bool PortForwarding = false;
201  bool SSHCommand = false;
202  QString PortForwardingLocalPort;
203  QString ActualURI;
204 };
205 
206 #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.