Skip To Content ArcGIS for Developers Sign In Dashboard

LocalServer Class

(Esri::ArcGISRuntime::LocalServer)

A local server instance. More...

Header: #include <LocalServer>
Inherits: Object

Public Functions

  • 31 public functions inherited from QObject

Signals

void statusChanged()

Static Public Members

QString appDataPath()
QString installPath()
LocalServer *instance()
bool isFilterWebContent()
bool isInstallValid()
QList<LocalService *> services()
void setAppDataPath(const QString &appDataPath)
void setFilterWebContent(bool enableFilterWebContent)
void setInstallPath(const QString &installPath)
void setTempDataPath(const QString &tempDataPath)
void start()
Esri::ArcGISRuntime::LocalServerStatus status()
void stop()
QString tempDataPath()
QUrl url()
  • 10 static public members inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

A local server instance.

Note: Local server is only available on Windows and Linux.

The local server is an optional component of the ArcGIS Runtime SDKs which can be downloaded for Windows and Linux platforms. The local server component is not supported on other platforms.

The local server is used for executing offline geoprocessing tasks in your apps. Local server also allows developers to consume map image layers or feature layers which require a map package (.mpk) file.

Before any services can be used on local server, the local server process must be started. Only one instance of the local server can be running at any time.

Once the local server is started, local services can be started which will use packages generated from ArcGIS Desktop.

Your app can call isInstallValid to check whether the local server installation is detected. If the local server is installed at a custom directory, use setInstallPath to specify the custom directory before starting the local server.

Start the local server by calling the asynchronous start method and monitoring the statusChanged signal. Alternatively, starting a local service on a local server that is stopped will start the local server.

To determine whether the local server is running, use the status method. When the local server is no longer required, your app may shut it down by calling stop. The local server will shut down by itself when the app exits.

Your app cannot change the local server's properties if the local server status is starting, started, or stopping.

Member Function Documentation

LocalServer::~LocalServer()

Destructor.

[static] QString LocalServer::appDataPath()

Returns a path to a directory to be used for local app data.

See also setAppDataPath().

[static] QString LocalServer::installPath()

Returns the installation path.

This method returns the value that was set with setInstallPath until either isInstallValid or start is called. After one of those methods is called, this method returns the actual installation path found.

See also setInstallPath().

[static] LocalServer *LocalServer::instance()

Returns the instance of the local server.

The instance of LocalServer is a singleton.

[static] bool LocalServer::isFilterWebContent()

Returns true if web content filtering is enabled.

[static] bool LocalServer::isInstallValid()

Returns true if a local server installation was found.

This method searches for the installation directory in this order:

  • If installPath is set, the method looks there and if the installation is not found, the search ends.
  • If installPath is not set, the method looks in the directory that contains the app.
  • If not found with the app directory, the method looks for the InstallDir value in the registry entry for the local server, such as HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ESRI\LocalServer100.0. If the value is found, the method looks in that directory.

[static] QList<LocalService *> LocalServer::services()

Returns a list of local services hosted by the local server.

[static] void LocalServer::setAppDataPath(const QString &appDataPath)

Sets a path to a directory to be used for local app data.

  • appDataPath - The path where local app data is stored.

This method may be called when the local server is not started and is not starting.

See also appDataPath().

[static] void LocalServer::setFilterWebContent(bool enableFilterWebContent)

Sets web content filtering to enableFilterWebContent.

Turns on filtering of HTML content for feature service text fields. By default this is enabled. When this is enabled only a small subset of HTML is accepted and an error will occur if unsupported HTML is used. Filter web content should be set to disabled if you want to use unfiltered HTML.

This method may be called when the local server is not started and is not starting.

See also isFilterWebContent().

[static] void LocalServer::setInstallPath(const QString &installPath)

Sets the local server installation path to installPath.

This method may be called when the local server is not started and is not starting.

See also installPath().

[static] void LocalServer::setTempDataPath(const QString &tempDataPath)

Sets a path to a directory to be used for temporary data to tempDataPath.

This method may be called when the local server is not started and is not starting.

See also tempDataPath().

[static] void LocalServer::start()

Starts the local server asynchronously.

Use the statusChanged signal and the status property to monitor when the service has started. Calling this method on a server that is running has no effect.

[static] Esri::ArcGISRuntime::LocalServerStatus LocalServer::status()

Returns the status of the local server.

[signal] void LocalServer::statusChanged()

Signal emitted when the status property changes.

[static] void LocalServer::stop()

Shuts down the local server asynchronously.

Use the statusChanged signal and the status property to monitor when the service has stopped. Calling this method on a server that is stopping or stopped has no effect.

[static] QString LocalServer::tempDataPath()

Returns a path to a directory to be used for temporary data.

See also setTempDataPath().

[static] QUrl LocalServer::url()

Returns the URL for the local server.


Feedback on this topic?