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 "vtkParaViewDeprecation.h" // for PARAVIEW_DEPRECATED_IN_5_14_0
11 #include "vtkSmartPointer.h"
12 
13 #include <QObject>
14 
15 class vtkPVXMLElement;
16 class pqServerResource;
17 class vtkIndent;
18 
24 {
25 public:
30 
35 
39  pqServerConfiguration(const QString& name);
40 
45 
50  bool isMutable() const { return this->Mutable; }
51  void setMutable(bool val) { this->Mutable = val; }
52 
56  void setName(const QString& name);
57  QString name() const;
58 
64  bool isNameDefault() const;
65 
69  static QString defaultName();
70 
74  pqServerResource resource() const;
75  void setResource(const QString&);
76  void setResource(const pqServerResource&);
77 
87  pqServerResource actualResource();
88 
92  QString URI() const;
93 
99  int connectionTimeout(int defaultTimeout = 60) const;
100  void setConnectionTimeout(int connectionTimeout);
101 
106  {
109  COMMAND
110  };
111 
116  StartupType startupType() const;
117 
129  QString command(double& processWait, double& delay) const;
130 
141  QString execCommand(double& processWait, double& delay) const;
142 
146  void setStartupToManual();
147 
151  void setStartupToCommand(double processWait, double delay, const QString& command);
152 
156  QString toString(vtkIndent indent) const;
157 
161  pqServerConfiguration clone() const;
162 
166  vtkPVXMLElement* optionsXML() const;
167 
171  vtkPVXMLElement* hintsXML() const;
172 
178  bool isPortForwarding() const { return this->PortForwarding; };
179 
185  PARAVIEW_DEPRECATED_IN_5_14_0("Use int localPortForwardingPort() const instead")
186  QString portForwardingLocalPort() const;
187 
196  int localPortForwardingPort() const;
197 
201  void setDefaultLocalPortForwardingPort(int port);
202 
203 protected:
204  vtkPVXMLElement* startupXML() const;
205 
206  void parseSshPortForwardingXML();
207  QString sshFullCommand(QString sshCommand, vtkPVXMLElement* sshConfigXML) const;
208 
209  static QString termCommand();
210  static QString sshCommand();
211  static QString lookForCommand(QString command);
212 
213 private:
214  void constructor(const QString& name);
215  void constructor(vtkPVXMLElement*);
216  bool Mutable = true;
218  bool PortForwarding = false;
219  bool SSHCommand = false;
220  int LocalPortForwardingPort = -1;
221  int DefaultLocalPortForwardingPort = -1;
222  QString ActualURI;
223 };
224 
225 #endif
#define PARAVIEW_DEPRECATED_IN_5_14_0(reason)
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.
port
pqServerResource encapsulates a resource in ParaView.