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:
54 
59  pqServerConfiguration(vtkPVXMLElement* xml, int connectionTimeout = 60);
60 
65  bool isMutable() const { return this->Mutable; }
66  void setMutable(bool val) { this->Mutable = val; }
67 
71  void setName(const QString& name);
72  QString name() const;
73 
79  bool isNameDefault() const;
80 
84  pqServerResource resource() const;
85  void setResource(const QString&);
86  void setResource(const pqServerResource&);
87 
97  pqServerResource actualResource() const;
98 
102  QString URI() const;
103 
108  int connectionTimeout() const;
109  void setConnectionTimeout(int connectionTimeout);
110 
115  {
118  COMMAND
119  };
120 
125  StartupType startupType() const;
126 
135  QString command(double& timeout, double& delay) const;
136 
145  QString execCommand(double& timeout, double& delay) const;
146 
150  void setStartupToManual();
151 
155  void setStartupToCommand(double timeout, double delay, const QString& command);
156 
160  QString toString(vtkIndent indent) const;
161 
165  pqServerConfiguration clone() const;
166 
170  vtkPVXMLElement* optionsXML() const;
171 
175  vtkPVXMLElement* hintsXML() const;
176 
182  bool isPortForwarding() const { return this->PortForwarding; };
183 
189  QString portForwardingLocalPort() const;
190 
191 protected:
192  vtkPVXMLElement* startupXML() const;
193 
194  void parseSshPortForwardingXML();
195  QString sshFullCommand(QString sshCommand, vtkPVXMLElement* sshConfigXML) const;
196 
197  static QString termCommand();
198  static QString sshCommand();
199  static QString lookForCommand(QString command);
200 
201 private:
202  void constructor(vtkPVXMLElement*, int connectionTimeout = 60);
203  bool Mutable;
204  int ConnectionTimeout;
206  bool PortForwarding;
207  bool SSHCommand;
208  QString PortForwardingLocalPort;
209  QString ActualURI;
210 };
211 
212 #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.