pqServerConfiguration corresponds to a server connection configuration. More...
#include <pqServerConfiguration.h>
Public Types | |
enum | StartupType { INVALID, MANUAL, COMMAND } |
Types of start. More... | |
Public Member Functions | |
pqServerConfiguration () | |
Create an empty server configuration with the default name. More... | |
~pqServerConfiguration () | |
Default destructor. More... | |
pqServerConfiguration (const QString &name) | |
Create an empty server configuration with a provided name. More... | |
pqServerConfiguration (vtkPVXMLElement *xml) | |
Create a server configuration with the provided xml. More... | |
bool | isMutable () const |
Get/Set whether the configuration is mutable. More... | |
void | setMutable (bool val) |
void | setName (const QString &name) |
Get/Set the name for the configuration. More... | |
QString | name () const |
bool | isNameDefault () const |
Returns true if the name for this configuration is the default one i.e. More... | |
pqServerResource | resource () const |
Get/Set the resource that describes the server scheme, hostname(s) and port(s). More... | |
void | setResource (const QString &) |
void | setResource (const pqServerResource &) |
pqServerResource | actualResource () |
Get the actual resource that describes the server scheme, hostname(s) and port(s). More... | |
QString | URI () const |
get the resource URI, does not contain the server name More... | |
int | connectionTimeout (int defaultTimeout=60) const |
Get/Set the timeout in seconds that will be used when connecting 0 means no retry and -1 means infinite retries. More... | |
void | setConnectionTimeout (int connectionTimeout) |
StartupType | startupType () const |
returns the startup type for this configuration. More... | |
QString | command (double &processWait, double &delay) const |
If startupType() == COMMAND, then this method can be used to obtain the command for the startup, from the client side. More... | |
QString | execCommand (double &processWait, double &delay) const |
If startupType() == COMMAND, then this method can be used to obtain the command for the startup, on the remote server, contained in the exec attributes. More... | |
void | setStartupToManual () |
changes the startup type to manual. More... | |
void | setStartupToCommand (double processWait, double delay, const QString &command) |
changes the startup type to command. More... | |
QString | toString (vtkIndent indent) const |
serialize to a string. More... | |
pqServerConfiguration | clone () const |
Create a new clone (deep copying the vtkPVXMLElement). More... | |
vtkPVXMLElement * | optionsXML () const |
returns the <Options> element, if any. More... | |
vtkPVXMLElement * | hintsXML () const |
returns the <Hints> element, if any. More... | |
bool | isPortForwarding () const |
Get if this is a port forwarding configuration. More... | |
QString | portForwardingLocalPort () const |
Get the port forwarding local port. More... | |
int | localPortForwardingPort () const |
Get the port local port using forwarding. More... | |
void | setDefaultLocalPortForwardingPort (int port) |
Set the default value to use for local port forwarding. More... | |
Static Public Member Functions | |
static QString | defaultName () |
Returns the default name of a server configuration. More... | |
Protected Member Functions | |
vtkPVXMLElement * | startupXML () const |
void | parseSshPortForwardingXML () |
QString | sshFullCommand (QString sshCommand, vtkPVXMLElement *sshConfigXML) const |
Static Protected Member Functions | |
static QString | termCommand () |
static QString | sshCommand () |
static QString | lookForCommand (QString command) |
pqServerConfiguration corresponds to a server connection configuration.
These are typically read from pvsc files.
Definition at line 23 of file pqServerConfiguration.h.
Types of start.
Enumerator | |
---|---|
INVALID | |
MANUAL | |
COMMAND |
Definition at line 105 of file pqServerConfiguration.h.
pqServerConfiguration::pqServerConfiguration | ( | ) |
Create an empty server configuration with the default name.
pqServerConfiguration::~pqServerConfiguration | ( | ) |
Default destructor.
pqServerConfiguration::pqServerConfiguration | ( | const QString & | name | ) |
Create an empty server configuration with a provided name.
pqServerConfiguration::pqServerConfiguration | ( | vtkPVXMLElement * | xml | ) |
Create a server configuration with the provided xml.
|
inline |
Get/Set whether the configuration is mutable.
This variable is not serialized.
Definition at line 50 of file pqServerConfiguration.h.
|
inline |
Definition at line 51 of file pqServerConfiguration.h.
void pqServerConfiguration::setName | ( | const QString & | name | ) |
Get/Set the name for the configuration.
QString pqServerConfiguration::name | ( | ) | const |
bool pqServerConfiguration::isNameDefault | ( | ) | const |
Returns true if the name for this configuration is the default one i.e.
the one that gets set when none is specified. Useful to determine "empty" configurations.
|
static |
Returns the default name of a server configuration.
pqServerResource pqServerConfiguration::resource | ( | ) | const |
Get/Set the resource that describes the server scheme, hostname(s) and port(s).
void pqServerConfiguration::setResource | ( | const QString & | ) |
void pqServerConfiguration::setResource | ( | const pqServerResource & | ) |
pqServerResource pqServerConfiguration::actualResource | ( | ) |
Get the actual resource that describes the server scheme, hostname(s) and port(s).
Can be different from resource() when using SSH Port Forwarding as it will point to ip and port actually used for the tcp connection, which can be different than the server where the pvserver is running. eg. it will give you localhost:8080, instead of serverip:serverport when using port forwarding. Using this method is needed only when using low level tcp api. resource() method should be used in any other cases.
QString pqServerConfiguration::URI | ( | ) | const |
get the resource URI, does not contain the server name
Get/Set the timeout in seconds that will be used when connecting 0 means no retry and -1 means infinite retries.
If not set in the XML, the defaultTimeout is retuned.
void pqServerConfiguration::setConnectionTimeout | ( | int | connectionTimeout | ) |
StartupType pqServerConfiguration::startupType | ( | ) | const |
returns the startup type for this configuration.
There are 3 types of startup: manual, simple-command and custom-command.
If startupType() == COMMAND, then this method can be used to obtain the command for the startup, from the client side.
Note that this does not include any information options etc. that may be specified in the startup. This is the full command to be executed on the client, which includes xterm, ssh... This also recovers processWait and delay attributes. processWait is the amount of time to wait for the process to start in seconds. delay is the amount of time wait for the process to finish, -1 means infinite wait.
If startupType() == COMMAND, then this method can be used to obtain the command for the startup, on the remote server, contained in the exec attributes.
Note that this does not include any information options etc. that may be specified in the startup. This also recovers processWait and delay attributes. processWait is the amount of time to wait for the process to start in seconds. delay is the amount of time wait for the process to finish, -1 means infinite wait.
void pqServerConfiguration::setStartupToManual | ( | ) |
changes the startup type to manual.
void pqServerConfiguration::setStartupToCommand | ( | double | processWait, |
double | delay, | ||
const QString & | command | ||
) |
changes the startup type to command.
QString pqServerConfiguration::toString | ( | vtkIndent | indent | ) | const |
serialize to a string.
pqServerConfiguration pqServerConfiguration::clone | ( | ) | const |
Create a new clone (deep copying the vtkPVXMLElement).
vtkPVXMLElement* pqServerConfiguration::optionsXML | ( | ) | const |
returns the <Options> element, if any.
vtkPVXMLElement* pqServerConfiguration::hintsXML | ( | ) | const |
returns the <Hints> element, if any.
|
inline |
Get if this is a port forwarding configuration.
PortForwardingConfiguration uses SSH tunneling and is configured directly in xml server file
Definition at line 178 of file pqServerConfiguration.h.
QString pqServerConfiguration::portForwardingLocalPort | ( | ) | const |
Get the port forwarding local port.
Initialized by the server xml if port forwarding is used. Equal to the resource port if port forwarding is not used.
int pqServerConfiguration::localPortForwardingPort | ( | ) | const |
Get the port local port using forwarding.
This value will only be computed when calling pqServerConfiguration::ressource() It will be overriden as follows:
void pqServerConfiguration::setDefaultLocalPortForwardingPort | ( | int | port | ) |
Set the default value to use for local port forwarding.
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |