GeodatabaseSyncTask QML Type

  • Esri.ArcGISRuntime
  • GeodatabaseSyncTask
  • A task to download and sync a sync-enabled mobile geodatabase. More...

    Import Statement: import Esri.ArcGISRuntime
    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 Enterprise. 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 ApiKeyResource, Loadable, Cancelable, and RemoteResource.

    Property Documentation

    [since Esri.ArcGISRuntime 100.10] apiKey : string

    Returns the API key.

    This property was introduced in Esri.ArcGISRuntime 100.10.

    See also ApiKeyResource.


    [read-only] 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.


    [read-only] 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.


    [read-only] defaultGenerateGeodatabaseParameters : GenerateGeodatabaseParameters

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

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


    [read-only] 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.


    [read-only] error : Error

    Returns the error object (read-only).

    See also Loadable and Error.


    [read-only] featureServiceInfo : ArcGISFeatureServiceInfo

    Metadata about the ArcGIS feature service.


    [read-only] 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.


    [read-only] loadStatus : Enums.LoadStatus

    Returns the load status (read-only).

    See also Loadable and Enums.LoadStatus.


    [read-only] registerSyncEnabledGeodatabaseStatus : Enums.TaskStatus

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

    See also Enums.TaskStatus.


    [default, since Esri.ArcGISRuntime 100.1] requestConfiguration : RequestConfiguration

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

    This property was introduced in Esri.ArcGISRuntime 100.1.


    [read-only] 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

    [since Esri.ArcGISRuntime 100.10] apiKeyChanged()

    Emitted when the apiKey property changes.

    Note: The corresponding handler is onApiKeyChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.10.

    See also ApiKeyResource.


    createDefaultGenerateParametersStatusChanged()

    Emitted when the createDefaultGenerateParametersStatus property of this GeodatabaseSyncTask changes.

    Note: The corresponding handler is onCreateDefaultGenerateParametersStatusChanged.


    createDefaultSyncParametersStatusChanged()

    Emitted when the createDefaultSyncParametersStatus property of this GeodatabaseSyncTask changes.

    Note: The corresponding handler is onCreateDefaultSyncParametersStatusChanged.


    credentialChanged()

    Emitted when the credential property of this GeodatabaseSyncTask changes.

    Note: The corresponding handler is onCredentialChanged.


    featureServiceInfoChanged()

    Emitted when the featureServiceInfo property of this GeodatabaseSyncTask changes.

    Note: The corresponding handler is onFeatureServiceInfoChanged.


    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.

    Note: The corresponding handler is onLoadErrorChanged.

    See also Loadable and Object.


    loadStatusChanged()

    Emitted when the loadStatus property changes.

    Note: The corresponding handler is onLoadStatusChanged.

    See also Loadable.


    registerSyncEnabledGeodatabaseStatusChanged()

    Emitted when the registerSyncEnabledGeodatabaseStatus property of this GeodatabaseSyncTask changes.

    Note: The corresponding handler is onRegisterSyncEnabledGeodatabaseStatusChanged.


    [since Esri.ArcGISRuntime 100.1] requestConfigurationChanged()

    Emitted when the requestConfiguration property changes.

    Note: The corresponding handler is onRequestConfigurationChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.1.


    unregisterStatusChanged()

    Emitted when the unregisterStatus property of this GeodatabaseSyncTask changes.

    Note: The corresponding handler is onUnregisterStatusChanged.


    urlChanged()

    Emitted when the url property of this GeodatabaseSyncTask changes.

    Note: The corresponding handler is onUrlChanged.


    Method Documentation

    void cancelLoad()

    See also Loadable.


    bool cancelTask(string taskId)

    Cancel the task with the ID taskId.

    Returns false if the task cannot be canceled or there is no task with the specified id taskId.

    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.


    [since Esri.ArcGISRuntime 100.3] 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 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 its 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.

    You should not execute more than one sync on a particular geodatabase at the same time. This includes any operations that export or import deltas from the local Geodatabase:

    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.


    [since Esri.ArcGISRuntime 100.3] 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.

    You should not execute more than one sync on a particular geodatabase at the same time. This includes any operations that export or import deltas from the local Geodatabase:

    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 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.


    [since Esri.ArcGISRuntime 100.2] 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 method was introduced in Esri.ArcGISRuntime 100.2.


    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.