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 
12 #include <QObject>
13 
14 class vtkPVXMLElement;
15 class pqServerResource;
16 class vtkIndent;
17 
22 class PQCORE_EXPORT pqServerConfiguration
23 {
24 public:
29 
34 
38  pqServerConfiguration(const QString& name);
39 
44 
49  bool isMutable() const { return this->Mutable; }
50  void setMutable(bool val) { this->Mutable = val; }
51 
55  void setName(const QString& name);
56  QString name() const;
57 
63  bool isNameDefault() const;
64 
68  static QString defaultName();
69 
73  pqServerResource resource() const;
74  void setResource(const QString&);
75  void setResource(const pqServerResource&);
76 
86  pqServerResource actualResource();
87 
91  QString URI() const;
92 
98  int connectionTimeout(int defaultTimeout = 60) const;
99  void setConnectionTimeout(int connectionTimeout);
100 
105  {
108  COMMAND
109  };
110 
115  StartupType startupType() const;
116 
128  QString command(double& processWait, double& delay) const;
129 
140  QString execCommand(double& processWait, double& delay) const;
141 
145  void setStartupToManual();
146 
150  void setStartupToCommand(double processWait, double delay, const QString& command);
151 
155  QString toString(vtkIndent indent) const;
156 
160  pqServerConfiguration clone() const;
161 
165  vtkPVXMLElement* optionsXML() const;
166 
170  vtkPVXMLElement* hintsXML() const;
171 
177  bool isPortForwarding() const { return this->PortForwarding; };
178 
187  int localPortForwardingPort() const;
188 
192  void setDefaultLocalPortForwardingPort(int port);
193 
194 protected:
195  vtkPVXMLElement* startupXML() const;
196 
197  void parseSshPortForwardingXML();
198  QString sshFullCommand(QString sshCommand, vtkPVXMLElement* sshConfigXML) const;
199 
200  static QString termCommand();
201  static QString sshCommand();
202  static QString lookForCommand(QString command);
203 
204 private:
205  void constructor(const QString& name);
206  void constructor(vtkPVXMLElement*);
207  bool Mutable = true;
209  bool PortForwarding = false;
210  bool SSHCommand = false;
211  int LocalPortForwardingPort = -1;
212  int DefaultLocalPortForwardingPort = -1;
213  QString ActualURI;
214 };
215 
216 #endif
name
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.
port
pqServerResource encapsulates a resource in ParaView.