Skip To Content ArcGIS for Developers Sign In Dashboard

GeodatabaseSyncTask QML Type

A task to download and sync a sync-enabled mobile geodatabase. More...

Import Statement: import Esri.ArcGISRuntime 100.6
Since: Esri.ArcGISRuntime 100.0
Inherits:

Object

Properties

Signals

Methods

Detailed Description

Mobile geodatabases are designed for querying and viewing feature data when your app is offline. In addition, while offline your app can edit a geodatabase locally and later sync changes with the service, assuming that the associated service supports sync. While offline, the mobile geodatabase keeps track of local edits. When those edits are synchronized with the service, local edits are sent to the service and changes made on the service in the meantime by other processes are received into the mobile geodatabase.

You can create a mobile geodatabase on your device by downloading it from a sync-enabled ArcGIS feature service. If the geodatabase is sync-enabled, you can sync it with the sync-enabled service from which it was created (its associated service) by registering the mobile geodatabase with the service. The GeodatabaseSyncTask supports creating a geodatabase via downloading from a service, and syncing a sync-enabled geodatabase with its associated service.

Another option is to provision a copy of a sync-enabled mobile geodatabase onto your device by loading it onto your device's file system. Register this geodatabase with the associated service, which gives the geodatabase copy its own replica ID. This identifies the geodatabase copy differently from the original geodatabase, and making the copy sync-able with the service.

GeodatabaseSyncTask also allows you to unregister a geodatabase, which permanently prevents sync of that mobile geodatabase with its associated service. Unregistered geodatabases cannot be re-registered.

The associated service may be hosted in the cloud on ArcGIS Online or on-premises with ArcGIS Server. Your app must have network access to the service in order to download or sync with the service.

This QML type supports the following default properties. A default property may be declared inside another declared object without being assigned explicitly to a property.

TypeDefault Property
Credentialcredential
RequestConfigurationrequestConfiguration (since Esri.ArcGISRuntime 100.1)

See also Loadable, Cancelable, and RemoteResource.

Property Documentation

createDefaultGenerateParametersStatus : Enums.TaskStatus

Returns the current status of the createDefaultGenerateGeodatabaseParameters method (read-only).

Wait until the createDefaultGenerateParametersStatus is Enums.TaskStatusCompleted before obtaining the defaultGenerateGeodatabaseParameters.

See also Enums.TaskStatus.


createDefaultSyncParametersStatus : Enums.TaskStatus

Returns the current status of the createDefaultSyncGeodatabaseParameters method (read-only).

Wait until the createDefaultSyncParametersStatus is Enums.TaskStatusCompleted before obtaining the defaultSyncGeodatabaseParameters.

See also Enums.TaskStatus.


[default] credential : Credential

The security credential used to access the service.

Only applicable if using an online service that is secured.


defaultGenerateGeodatabaseParameters : GenerateGeodatabaseParameters

Returns the parameters created from createDefaultGenerateGeodatabaseParameters() (read-only).

Obtain this property after the createDefaultGenerateParametersStatusChanged signal emits, and the createDefaultGenerateParametersStatus is Enums.TaskStatusCompleted.


defaultSyncGeodatabaseParameters : SyncGeodatabaseParameters

Returns the parameters created from GeodatabaseSyncTask::createDefaultSyncGeodatabaseParameters (read-only).

Obtain this property after the createDefaultSyncParametersStatusChanged signal emits, and the createDefaultSyncParametersStatus is Enums.TaskStatusCompleted.


error : Error

Returns the error object (read-only).

See also Loadable and Error.


featureServiceInfo : ArcGISFeatureServiceInfo

Metadata about the ArcGIS feature service.


generateGeodatabaseJobs : list<GenerateGeodatabaseJob>

Returns the list of GenerateGeodatabaseJob objects in this GeodatabaseSyncTask (read-only).

Each job can be tracked using its jobStatus property.

See also GenerateGeodatabaseJob.


loadError : Error

Returns the load error (read-only).

Note: load errors are also reported on the error property and emit the errorChanged signal.

See also Loadable.


loadStatus : Enums.LoadStatus

Returns the load status (read-only).

See also Loadable and Enums.LoadStatus.


registerSyncEnabledGeodatabaseStatus : Enums.TaskStatus

Returns the current status of the registerSyncEnabledGeodatabase method (read-only).

See also Enums.TaskStatus.


[default] requestConfiguration : RequestConfiguration

The configuration parameters used for network requests sent by this task.

This QML property was introduced in Esri.ArcGISRuntime 100.1.


syncGeodatabaseJobs : list<SyncGeodatabaseJob>

Returns the list of SyncGeodatabaseJob objects in this GeodatabaseSyncTask (read-only).

Each job can be tracked using its jobStatus property.

See also SyncGeodatabaseJob.


unregisterStatus : Enums.TaskStatus

Returns the current status of the unregisterGeodatabase method (read-only).

See also Enums.TaskStatus.


url : url

The URL to a sync-enabled ArcGIS Feature service.


Signal Documentation

createDefaultGenerateParametersStatusChanged()

Emitted when the createDefaultGenerateParametersStatus property of this GeodatabaseSyncTask changes.


createDefaultSyncParametersStatusChanged()

Emitted when the createDefaultSyncParametersStatus property of this GeodatabaseSyncTask changes.


credentialChanged()

Emitted when the credential property of this GeodatabaseSyncTask changes.


featureServiceInfoChanged()

Emitted when the featureServiceInfo property of this GeodatabaseSyncTask changes.


generateGeodatabaseJobsChanged()

Emitted when the generateGeodatabaseJobs property of this GeodatabaseSyncTask changes.


loadErrorChanged()

Emitted when the loadError property of this GeodatabaseSyncTask changes.

Note: load errors are also reported on the error property and emit the errorChanged signal.

See also Loadable and Object.


loadStatusChanged()

Emitted when the loadStatus property changes.

See also Loadable.


registerSyncEnabledGeodatabaseStatusChanged()

Emitted when the registerSyncEnabledGeodatabaseStatus property of this GeodatabaseSyncTask changes.


requestConfigurationChanged()

Emitted when the requestConfiguration property changes.

This QML signal was introduced in Esri.ArcGISRuntime 100.1.


syncGeodatabaseJobsChanged()

Emitted when the syncGeodatabaseJobs property of this GeodatabaseSyncTask changes.


unregisterStatusChanged()

Emitted when the unregisterStatus property of this GeodatabaseSyncTask changes.


urlChanged()

Emitted when the url property of this GeodatabaseSyncTask changes.


Method Documentation

void cancelLoad()

See also Loadable.


bool cancelTask(string taskId)

Cancels a GeodatabaseSyncTask.

  • taskId - The ID of the task to cancel.

See also Cancelable.


string createDefaultGenerateGeodatabaseParameters(Geometry extent)

Starts a task to get properly initialized parameters for generating a geodatabase based on the specified extent.

This convenience method populates a GenerateGeodatabaseParameters object with values based on defaults and on what the service supports.

GenerateGeodatabaseParameters is returned to the app through the property defaultGenerateGeodatabaseParameters. Monitor the signal createDefaultGenerateParametersStatusChanged. When the status changes to Enums.TaskStatusCompleted, the defaultGenerateGeodatabaseParameters property is populated.

  • If the service does not support Enums.SyncModelLayer then Enums.SyncModelGeodatabase will be used.
    • All layers from the service will be included.
    • The extent will be the service's full extent.
  • Features inside the provided extent are included in the generated geodatabase.
  • Output features are in the spatial reference of the given extent.
  • Attachments are included.
  • Related tables and layers are not included.

Returns the task ID for the new task.


string createDefaultSyncGeodatabaseParameters(Geodatabase geodatabase)

Starts a task to get properly initialized parameters for syncing a geodatabase with its service.

  • geodatabase - The geodatabase that will be synced.

This convenience method will populate the parameters with values matching what the service and the geodatabase support.

Returns the task ID for the new task.


string createDefaultSyncGeodatabaseParametersWithSyncDirection(Geodatabase geodatabase, SyncDirection syncDirection)

Starts a task to get properly initialized parameters for syncing a geodatabase with its service using provided sync direction.

  • geodatabase - The geodatabase that will be synced.
  • syncDirection - The preferred sync direction.

This convenience method will populate the parameters with values matching what the service and the geodatabase support.

  • For a geodatabase using Enums.SyncModelLayer, all layers will be included.
  • For a read-only service, the sync direction will be Enums.SyncDirectionDownload. Otherwise, the sync direction will be set based on the syncDirection parameter.

Returns the task ID for the new task.

This QML method was introduced in Esri.ArcGISRuntime 100.3.


GenerateGeodatabaseJob generateGeodatabase(GenerateGeodatabaseParameters parameters, url urlToGeodatabaseFile)

Returns a job to generate a mobile geodatabase from an ArcGIS Feature service.

  • parameters - Parameters specifying what information to include in the geodatabase.
  • urlToGeodatabaseFile - A file URL to save the geodatabase on the local file system.

The result of the job will be of type Geodatabase.

The urlToGeodatabaseFile can specify a url for the downloaded geodatabase, including the desired name and the .geodatabase file extension. Or, urlToGeodatabaseFile can be a filename only, in which case the file extension is added and the geodatabase is stored in the user's Documents folder.

A GenerateGeodatabaseJob representing the progress on the server is returned.

The returned job is in the Enums.JobStatusNotStarted state. Start it by calling Job::start().

See also Job.


void load()

See also Loadable.


string registerSyncEnabledGeodatabase(Geodatabase geodatabase)

Starts a task to register a copy of a sync enabled geodatabase with a service so the copy can sync to the service.

  • geodatabase - The mobile geodatabase to register.

The local geodatabase file is typically a copy of another original geodatabase file. The original geodatabase must already be known to the service and have a replica ID. A successful register will give the local geodatabase it's own replica ID and separate it from the original. It can then be synchronized with the service to receive updates. After taking copies of the original database, do not sync changes to the original until all copies have been registered. This operation is not related to GeodatabaseSyncTask::unregisterGeodatabase which removes the geodatabase from the service.

Returns the task ID for the new task.


void retryLoad()

See also Loadable.


SyncGeodatabaseJob syncGeodatabase(SyncGeodatabaseParameters parameters, Geodatabase geodatabase)

Returns a job to sync a mobile geodatabase with its originating ArcGIS Feature service.

  • parameters - Parameters specifying how to sync the geodatabase.
  • geodatabase - The geodatabase to sync with the service.

The result of the job will be a list of SyncLayerResult objects. This list will be empty for a successfully completed job. If individual edits failed then the result array provides these errors grouped by each table using SyncLayerResult instances. These contain information for each edit error as a FeatureEditResult.

A SyncGeodatabaseJob representing the progress on the server is returned.

The returned job is in the Enums.JobStatusNotStarted state. Start it by calling Job::start().

See also Job.


SyncGeodatabaseJob syncGeodatabaseWithSyncDirection(SyncDirection syncDirection, bool rollbackOnFailure, Geodatabase geodatabase)

Returns a job to sync a mobile geodatabase with its originating ArcGIS Feature service using provided sync direction.

  • syncDirection - The preferred sync direction.
  • rollbackOnFailure - Whether to roll back edits when a failure occurs.
  • geodatabase - The geodatabase to sync with the service.

The result of the job will be a list of SyncLayerResult objects. This list will be empty for a successfully completed job. If individual edits failed then the result array provides these errors grouped by each table using SyncLayerResult instances. These contain information for each edit error as a FeatureEditResult.

If rollbackOnFailure is false, then failed edits are skipped. Other edits are still applied. This property only applies to edits uploaded by the client to the server. It does not apply to edits imported by client from the server.

A SyncGeodatabaseJob representing the progress on the server is returned.

The returned job is in the Enums.JobStatusNotStarted state. Start it by calling Job::start().

This QML method was introduced in Esri.ArcGISRuntime 100.3.

See also Job.


string unregisterGeodatabase(Geodatabase geodatabase)

Starts a task to unregister an existing sync-enabled mobile geodatabase from the service.

  • geodatabase - The mobile geodatabase to unregister.

This removes the geodatabase's replica ID from the service, which means the geodatabase can no longer be synchronized with the service. The local geodatabase is not deleted and remains on the local file system.

Returns the task ID for the new asynchronous task.


string unregisterGeodatabaseWithSyncId(String syncId)

Starts a task to unregister an existing sync-enabled mobile geodatabase from the service.

This removes the geodatabase's replica ID from the service, which means the geodatabase can no longer be synchronized with the service. The local geodatabase remains on the local file system.

Returns the task ID for the new task.

This QML method was introduced in Esri.ArcGISRuntime 100.2.



Feedback on this topic?