Public Types | 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 ()
 
 ~pqServerConfiguration ()
 
 pqServerConfiguration (vtkPVXMLElement *xml, int connectionTimeout=60)
 Create a server configuration with the provided xml and timeout. 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 () const
 Get the actual resource that describes the server scheme, hostname(s) and port(s). More...
 
QString URI () const
 get the resource URI More...
 
int connectionTimeout () 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 &timeout, 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 &timeout, 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 timeout, 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...
 

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 114 of file pqServerConfiguration.h.

Constructor & Destructor Documentation

◆ pqServerConfiguration() [1/2]

pqServerConfiguration::pqServerConfiguration ( )

◆ ~pqServerConfiguration()

pqServerConfiguration::~pqServerConfiguration ( )

◆ pqServerConfiguration() [2/2]

pqServerConfiguration::pqServerConfiguration ( vtkPVXMLElement xml,
int  connectionTimeout = 60 
)

Create a server configuration with the provided xml and timeout.

the timeout is in seconds, 0 means no retry and -1 means infinite retries.

Member Function Documentation

◆ isMutable()

bool pqServerConfiguration::isMutable ( ) const
inline

Get/Set whether the configuration is mutable.

This variable is not serialized.

Definition at line 65 of file pqServerConfiguration.h.

◆ setMutable()

void pqServerConfiguration::setMutable ( bool  val)
inline

Definition at line 66 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.

◆ 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 ( ) const

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. ressource() method should be used in any other cases.

◆ URI()

QString pqServerConfiguration::URI ( ) const

get the resource URI

◆ connectionTimeout()

int pqServerConfiguration::connectionTimeout ( ) const

Get/Set the timeout in seconds that will be used when connecting 0 means no retry and -1 means infinite retries.

◆ 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 timeout,
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...

◆ execCommand()

QString pqServerConfiguration::execCommand ( double timeout,
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 timeout and delay attributes.

◆ setStartupToManual()

void pqServerConfiguration::setStartupToManual ( )

changes the startup type to manual.

◆ setStartupToCommand()

void pqServerConfiguration::setStartupToCommand ( double  timeout,
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 182 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 ressource 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: