|
ArcGIS Runtime SDK for iOS
100.9
|
A task to download and synchronize a sync-enabled geodatabase.
Instances of this class represent a task that can be used to create, download, and synchronize a sync-enabled geodatabase from a sync-enabled ArcGIS Feature service. The service could be hosted in the cloud on ArcGIS Online or on-premises with ArcGIS servers.
Geodatabases generated from an ArcGIS feature service can be used for querying and viewing feature data when the application is offline. Geodatabases can also be edited when offline. Geodatabases for editing can only be requested if the service supports synchronization.
Geodatabases can be synchronized with the service when the application is able to connect to a network again. Synchronization can perform two tasks:
AGSGeodatabase
Class Methods | |
| (instancetype) | + geodatabaseSyncTaskWithURL: |
| (id< AGSCancelable >) | + importDeltaWithGeodatabase:deltaPath:completion: |
Properties | |
| AGSCredential * | credential |
| AGSArcGISFeatureServiceInfo * | featureServiceInfo |
| NSError * | loadError |
| AGSLoadStatus | loadStatus |
| AGSRequestConfiguration * | requestConfiguration |
| NSURL * | URL |
|
requiredinherited |
Cancels loading if it is in progress, otherwise it does nothing. This should be called carefully because other objects could be waiting for loadWithCompletion: or retryLoadWithCompletion: to complete and this will call them all back with the error of NSUserCancelledError
| - (id<AGSCancelable>) defaultGenerateGeodatabaseParametersWithExtent: | (AGSGeometry *) | extent | |
| completion: | (nullable void(^)(AGSGenerateGeodatabaseParameters *__nullable params, NSError *__nullable error)) | completion | |
A convenience method to get properly initialized parameters for generating a geodatabase.
This will populate the parameters with values matching what the service supports. For example if the service does not support PER_LAYER sync model then PER_GEODATABASE will be used. All layers from the service will be included. The extent will be the service's full extent. Attachments are included by default, but related tables/layers are not included. Features inside the provided extent are included in the generated geodatabase. Output features are in the spatial reference of the given extent.
| completion | block that is invoked with the initialized params if the method succeeds, or an error if it fails |
| - (id<AGSCancelable>) defaultSyncGeodatabaseParametersWithGeodatabase: | (AGSGeodatabase *) | geodatabase | |
| completion: | (nullable void(^)(AGSSyncGeodatabaseParameters *__nullable params, NSError *__nullable error)) | completion | |
A convenience method to get properly initialized parameters for synchronizing a geodatabase with its service.
This will populate the parameters with values matching what the service and the geodatabase support. For a geodatabase with PER_LAYER sync model, all geodatabase layers will be included. If the service is read-only then the sync direction will be DOWNLOAD. Otherwise the sync direction will be BIDIRECTIONAL.
| geodatabase | that needs to be synchronized with its service |
| completion | block that is invoked with the initialized params if the method succeeds, or an error if it fails |
| - (id<AGSCancelable>) defaultSyncGeodatabaseParametersWithGeodatabase: | (AGSGeodatabase *) | geodatabase | |
| syncDirection: | (AGSSyncDirection) | syncDirection | |
| completion: | (nullable void(^)(AGSSyncGeodatabaseParameters *__nullable params, NSError *__nullable error)) | completion | |
A convenience method to get properly initialized parameters for synchronizing a geodatabase with its service. Returns a parameters object with the given sync direction. Other parameters are populated with default values.
| geodatabase | that needs to be synchronized with its service |
| syncDirection | the sync direction to use |
| completion | block that is invoked with the initialized params if the method succeeds, or an error if it fails |
| - (AGSGenerateGeodatabaseJob*) generateJobWithParameters: | (AGSGenerateGeodatabaseParameters *) | parameters | |
| downloadFileURL: | (NSURL *) | downloadFileURL | |
Returns a job which can be used to generate a geodatabase from an ArcGIS Feature service using the specified parameters. The result of the job will be of type AGSGeodatabase.
startWithStatusHandler:completion: (AGSGenerateGeodatabaseJob) | parameters | specifying what data to include in the generated geodatabase |
| downloadFileURL | where the geodatabase should be saved on disk, including the desired file name ending with the .geodatabase file extension. |
AGSGeodatabase. | + (instancetype) geodatabaseSyncTaskWithURL: | (NSURL *) | URL |
Initialize the task with a URL to a sync-enabled ArcGIS Feature service
| URL | to a sync-enabled ArcGIS Feature service |
| + (id<AGSCancelable>) importDeltaWithGeodatabase: | (AGSGeodatabase *) | geodatabase | |
| deltaPath: | (NSURL *) | deltaPath | |
| completion: | (void(^)(NSArray< AGSSyncLayerResult * > *__nullable result, NSError *__nullable error)) | completion | |
Import changes from a delta file (*.gdb file) into the geodatabase. This is useful in workflows where the client does not directly connect to the originating service to synchronize changes with the server (either because the client does not have access to the service, or to improve scalability where it is impractical for a large number of clients to depend upon the service). Rather, the changes from the sync-enabled service are made available as a delta file (*.gdb file) to all clients which then import them into their copy of the geodatabase.
| geodatabase | into which to import the delta |
| deltaPath | of the delta file (*.gdb file) containing the changes from the sync-enabled feature service. |
| completion | block that is invoked when the operation completes successfully or encounters an error |
| - (id<AGSCancelable>) importDeltaWithGeodatabase: | (AGSGeodatabase *) | geodatabase | |
| inputPath: | (NSString *) | inputPath | |
| completion: | (void(^)(NSArray< AGSSyncLayerResult * > *__nullable result, NSError *__nullable error)) | completion | |
Import changes from a delta file (*.gdb file) into the geodatabase. This is useful in workflows where the client does not directly connect to the originating service to synchronize changes with the server (either because the client does not have access to the service, or to improve scalability where it is impractical for a large number of clients to depend upon the service). Rather, the changes from the sync-enabled service are made available as a delta file (*.gdb file) to all clients which then import them into their copy of the geodatabase.
| geodatabase | into which to import the delta |
| inputPath | of the delta file (*.gdb file) containing the changes from the sync-enabled feature service. |
| completion | block that is invoked when the operation completes successfully or encounters an error |
importDeltaWithGeodatabase:inputPath:completion: instead. | - (instancetype) initWithURL: | (NSURL *) | URL |
Initialize the task with a URL to a sync-enabled ArcGIS Feature service
| URL | to a sync-enabled ArcGIS Feature service |
|
requiredinherited |
Loads data for the object asynchronously. The completion block is invoked upon completion.
You can call this method any number of times, however only one attempt is made to load the data. If it is already loading, it will just continue to load (i.e. not force a reload). If it has already loaded successfully, the completion block will be invoked right away. If it has already failed to load, the completion block will be invoked right away with error previously encountered. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.
| completion | block that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load. |
- cancelLoad to cancel loading - retryLoadWithCompletion: to force reload | - (id<AGSCancelable>) registerSyncEnabledGeodatabase: | (AGSGeodatabase *) | geodatabase | |
| completion: | (nullable void(^)(NSError *__nullable error)) | completion | |
Register an existing sync-enabled geodatabase as a new sync-enabled geodatabase with the originating service. The geodatabase can then sync changes with the service indepedently of any other copies of the geodatabase that may exist.
| geodatabase | The sync-enabled geodatabase to register as a new replica with the originating service. |
| completion | block that is invoked when the operation completes successfully or encounters an error |
|
requiredinherited |
Tries to reload when an object has failed to load. This method should be called judiciously. It should be called when:
cancelLoad and then this methodIf the data hasn't started loading, it will start loading. If it is already loading, it will just continue to load. If it has already loaded successfully, calls back right away. If it has already failed to load, tries again. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.
| completion | block that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load. |
| - (id<AGSCancelable>) unregisterGeodatabase: | (AGSGeodatabase *) | geodatabase | |
| completion: | (nullable void(^)(NSError *__nullable error)) | completion | |
Unregister an existing sync-enabled geodatabase from its originating service. This removes the geodatabase's replica ID from the service which means it can no longer be synchronized. The local geodatabase will be left behind, but all information about the geodatabase on the service will be removed.
| geodatabase | to unregister |
| completion | block that is invoked when the operation completes successfully or encounters an error |
| - (id<AGSCancelable>) unregisterGeodatabaseWithSyncID: | (NSUUID *) | syncID | |
| completion: | (nullable void(^)(NSError *__nullable error)) | completion | |
Unregister an existing sync-enabled geodatabase from its originating service. This removes the geodatabase's replica ID from the service which means it can no longer be synchronized. This overload uses the geodatabase's sync ID rather than a reference to the geodatabase itself which is commonly used to enable cleanup of the service after the local geodatabase has already been deleted.
| syncID | of the geodatabase to unregister |
| completion | block that is invoked when the operation completes successfully or encounters an error |
|
readwritenonatomicstronginherited |
Security credentials to access the remote resource. Only applicable if the resource is secured.
|
readnonatomicstrong |
Metadata about the ArcGIS Feature service that the task is using
|
readnonatomicstronginherited |
The error that was encountered during the most recent load operation. Will be nil if the operation succeeded.
|
readrequirednonatomicassigninherited |
Status of the load operation.
|
readwritenonatomicstronginherited |
The AGSRequestConfiguration object which defines the behavior and policies to use when accessing the remote resource. The default will be nil. If it is nil the [AGSRequestConfiguration globalConfiguration] will be used.
|
readrequirednonatomicstronginherited |
The URL of the remote resource.