Classes | Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
pqServerConfigurationImporter Class Reference

pqServerConfigurationImporter class can be used to import remote server configurations. More...

#include <pqServerConfigurationImporter.h>

Inherits QObject.

Classes

class  Item
 

Public Types

enum  SourceMode { PVSC }
 

Public Slots

void fetchConfigurations ()
 Use this method to fetch server configurations from urls specified. More...
 
void abortFetch ()
 Aborts blocking in fetchConfigurations(). More...
 

Signals

void incrementalUpdate ()
 fired as source configurations are fetched. More...
 
void configurationsUpdated ()
 fired at end of fetchConfigurations() call. More...
 
void authenticationRequired (QNetworkReply *, QAuthenticator *)
 this signal is fired whenever the source-url requests authentication before delivering the contents. More...
 
void abortFetchTriggered ()
 fired when abortFetch() is called. More...
 
void message (const QString &message)
 this class posts miscellaneous information about the network communication using this signal. More...
 

Public Member Functions

 pqServerConfigurationImporter (QObject *parent=0)
 
 ~pqServerConfigurationImporter () override
 
void addSource (const QString &name, const QUrl &url, SourceMode mode=PVSC)
 Add source URL. More...
 
void clearSources ()
 Remove all added sources. More...
 
const QList< Item > & configurations () const
 Returns the fetched configurations. More...
 

Protected Member Functions

bool processDownloadedContents ()
 Called after data from each source is fetched fully. More...
 
bool fetch (const QUrl &url)
 Returns true if valid config was fetched and processed from the URL, otherwise returns false. More...
 

Detailed Description

pqServerConfigurationImporter class can be used to import remote server configurations.

Definition at line 48 of file pqServerConfigurationImporter.h.

Member Enumeration Documentation

◆ SourceMode

Enumerator
PVSC 

Definition at line 57 of file pqServerConfigurationImporter.h.

Constructor & Destructor Documentation

◆ pqServerConfigurationImporter()

pqServerConfigurationImporter::pqServerConfigurationImporter ( QObject *  parent = 0)

◆ ~pqServerConfigurationImporter()

pqServerConfigurationImporter::~pqServerConfigurationImporter ( )
override

Member Function Documentation

◆ addSource()

void pqServerConfigurationImporter::addSource ( const QString &  name,
const QUrl &  url,
SourceMode  mode = PVSC 
)

Add source URL.

Currently, we only support pvsc sources. In future we may support other types of sources. For every url added, the following locations are tried, in the specific order:

  • ${url}
  • ${url}/v{major_version}.{minor_version}/[win32|macos|nix]/servers.pvsc
  • ${url}/v{major_version}.{minor_version}/[win32|macos|nix]/servers.xml
  • ${url}/v{major_version}.{minor_version}/servers.pvsc
  • ${url}/v{major_version}.{minor_version}/servers.xml
  • ${url}/servers.pvsc
  • ${url}/servers.xml The search stops as soon as a url returns a valid servers configuration file. Note all paths are case-sensitive.

◆ clearSources()

void pqServerConfigurationImporter::clearSources ( )

Remove all added sources.

◆ configurations()

const QList<Item>& pqServerConfigurationImporter::configurations ( ) const

Returns the fetched configurations.

If fetchConfigurations() was aborted using abortFetch(), then this list may be partially filled. Also, this list include all server configurations fetched, without checking if some of these configurations are already present in pqServerConfigurationCollection maintained by pqApplicationCore.

◆ fetchConfigurations

void pqServerConfigurationImporter::fetchConfigurations ( )
slot

Use this method to fetch server configurations from urls specified.

This call blocks until all configurations are fetched. It uses a QEventLoop internally to wait for the network communication. One can abort the waiting by using abortFetch(). Refer to pqServerConnectDialog::fetchServers() for details on using fetchConfigurations() and abortFetch().

◆ abortFetch

void pqServerConfigurationImporter::abortFetch ( )
slot

Aborts blocking in fetchConfigurations().

Has any effect only when fetchConfigurations() has blocked.

◆ incrementalUpdate

void pqServerConfigurationImporter::incrementalUpdate ( )
signal

fired as source configurations are fetched.

Makes it possible to build interfaces that are populated as new configurations arrive, rather than waiting for the entire fetchConfigurations() to complete.

◆ configurationsUpdated

void pqServerConfigurationImporter::configurationsUpdated ( )
signal

fired at end of fetchConfigurations() call.

◆ authenticationRequired

void pqServerConfigurationImporter::authenticationRequired ( QNetworkReply *  ,
QAuthenticator *   
)
signal

this signal is fired whenever the source-url requests authentication before delivering the contents.

Refer to QNetworkAccessManager::authenticationRequired() for details.

◆ abortFetchTriggered

void pqServerConfigurationImporter::abortFetchTriggered ( )
signal

fired when abortFetch() is called.

An internal signal, not really useful for external components.

◆ message

void pqServerConfigurationImporter::message ( const QString &  message)
signal

this class posts miscellaneous information about the network communication using this signal.

◆ processDownloadedContents()

bool pqServerConfigurationImporter::processDownloadedContents ( )
protected

Called after data from each source is fetched fully.

This will process the fetched data and update the configurations list. May fire incrementalUpdate() if configurations were updated.

◆ fetch()

bool pqServerConfigurationImporter::fetch ( const QUrl &  url)
protected

Returns true if valid config was fetched and processed from the URL, otherwise returns false.


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