Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
pqServerConfiguration Class Reference

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...
 
vtkPVXMLElementoptionsXML () const
 returns the <Options> element, if any. More...
 
vtkPVXMLElementhintsXML () 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...
 

Static Public Member Functions

static QString defaultName ()
 Returns the default name of a server configuration. More...
 

Protected Member Functions

vtkPVXMLElementstartupXML () 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)
 

Detailed Description

pqServerConfiguration corresponds to a server connection configuration.

These are typically read from pvsc files.

Definition at line 49 of file pqServerConfiguration.h.

Member Enumeration Documentation

◆ StartupType

Types of start.

Enumerator
INVALID 
MANUAL 
COMMAND 

Definition at line 131 of file pqServerConfiguration.h.

Constructor & Destructor Documentation

◆ pqServerConfiguration() [1/3]

pqServerConfiguration::pqServerConfiguration ( )

Create an empty server configuration with the default name.

◆ ~pqServerConfiguration()

pqServerConfiguration::~pqServerConfiguration ( )

Default destructor.

◆ pqServerConfiguration() [2/3]

pqServerConfiguration::pqServerConfiguration ( const QString &  name)

Create an empty server configuration with a provided name.

◆ pqServerConfiguration() [3/3]

pqServerConfiguration::pqServerConfiguration ( vtkPVXMLElement xml)

Create a server configuration with the provided xml.

Member Function Documentation

◆ isMutable()

bool pqServerConfiguration::isMutable ( ) const
inline

Get/Set whether the configuration is mutable.

This variable is not serialized.

Definition at line 76 of file pqServerConfiguration.h.

◆ setMutable()

void pqServerConfiguration::setMutable ( bool  val)
inline

Definition at line 77 of file pqServerConfiguration.h.

◆ setName()

void pqServerConfiguration::setName ( const QString &  name)

Get/Set the name for the configuration.

◆ name()

QString pqServerConfiguration::name ( ) const

◆ isNameDefault()

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.

◆ defaultName()

static QString pqServerConfiguration::defaultName ( )
static

Returns the default name of a server configuration.

◆ resource()

pqServerResource pqServerConfiguration::resource ( ) const

Get/Set the resource that describes the server scheme, hostname(s) and port(s).

◆ setResource() [1/2]

void pqServerConfiguration::setResource ( const QString &  )

◆ setResource() [2/2]

void pqServerConfiguration::setResource ( const pqServerResource )

◆ actualResource()

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.

◆ URI()

QString pqServerConfiguration::URI ( ) const

get the resource URI, does not contain the server name

◆ connectionTimeout()

int pqServerConfiguration::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.

If not set in the XML, the defaultTimeout is retuned.

◆ setConnectionTimeout()

void pqServerConfiguration::setConnectionTimeout ( int  connectionTimeout)

◆ startupType()

StartupType pqServerConfiguration::startupType ( ) const

returns the startup type for this configuration.

There are 3 types of startup: manual, simple-command and custom-command.

◆ command()

QString pqServerConfiguration::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.

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.

◆ execCommand()

QString pqServerConfiguration::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.

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.

◆ setStartupToManual()

void pqServerConfiguration::setStartupToManual ( )

changes the startup type to manual.

◆ setStartupToCommand()

void pqServerConfiguration::setStartupToCommand ( double  processWait,
double  delay,
const QString &  command 
)

changes the startup type to command.

◆ toString()

QString pqServerConfiguration::toString ( vtkIndent  indent) const

serialize to a string.

◆ clone()

pqServerConfiguration pqServerConfiguration::clone ( ) const

Create a new clone (deep copying the vtkPVXMLElement).

◆ optionsXML()

vtkPVXMLElement* pqServerConfiguration::optionsXML ( ) const

returns the <Options> element, if any.

◆ hintsXML()

vtkPVXMLElement* pqServerConfiguration::hintsXML ( ) const

returns the <Hints> element, if any.

◆ isPortForwarding()

bool pqServerConfiguration::isPortForwarding ( ) const
inline

Get if this is a port forwarding configuration.

PortForwardingConfiguration uses SSH tunneling and is configured directly in xml server file

Definition at line 204 of file pqServerConfiguration.h.

◆ portForwardingLocalPort()

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.

◆ startupXML()

vtkPVXMLElement* pqServerConfiguration::startupXML ( ) const
protected

◆ parseSshPortForwardingXML()

void pqServerConfiguration::parseSshPortForwardingXML ( )
protected

◆ sshFullCommand()

QString pqServerConfiguration::sshFullCommand ( QString  sshCommand,
vtkPVXMLElement sshConfigXML 
) const
protected

◆ termCommand()

static QString pqServerConfiguration::termCommand ( )
staticprotected

◆ sshCommand()

static QString pqServerConfiguration::sshCommand ( )
staticprotected

◆ lookForCommand()

static QString pqServerConfiguration::lookForCommand ( QString  command)
staticprotected

The documentation for this class was generated from the following file: