ArcGIS Runtime SDK for iOS: AGSOfflineMapSyncJob Class Reference
ArcGIS Runtime SDK for iOS  100.15
AGSOfflineMapSyncJob Class Reference

Description

A job to sync an offline map.

Instances of this class represent a long running job that can synchronize an offline map's feature layers and tables with their originating ArcGIS Feature service. This job is associated with a number of sub-jobs that sync the feaure layers and tables using AGSSyncGeodatabaseJob.

A job is dormant when it is created. It must be explicitly started using startWithStatusHandler:completion: (AGSOfflineMapSyncJob).

When the server accepts the job, it assigns a unique ID to the job which is avialable in AGSJob::serverJobID. The client then periodically polls for the status of the job on the server and provides this information in the status handler. If the job completes successfully, the result of the job is downloaded and provided in the completion handler, otherwise an error is provided when the job fails.

Note
If this job is to be serialized to JSON, its map needs to be loaded first. An attempt to serialize with a not loaded map will fail with an AGSErrorCodeMappingNotLoaded error.
Since
100.1
License Restrictions:
This feature requires a Basic license for production deployment when sync direction is Bidirectional or Upload with public feature services or when using a private feature service with any sync direction. "Public" feature services means services hosted on the Internet and available anonymously (not secured). "Private" includes all other scenarios such as feature services hosted on a local network within an enterprise or feature services hosted on the Internet but secured . No license required in Developer mode for testing.
Inheritance diagram for AGSOfflineMapSyncJob:
AGSJob AGSObject <AGSRemoteResource> <AGSJSONSerializable>

Instance Methods

(BOOL) - cancel
 
(id< AGSCancelable >) - cancelWithCompletion:
 
(id< AGSCancelable >) - checkStatusWithCompletion:
 
(BOOL) - pause
 
(void) - startWithStatusHandler:completion:
 
(void) - startWithStatusHandler:completion:
 
(nullable id) - toJSON:
 

Class Methods

(nullable id< AGSJSONSerializable >) + fromJSON:error:
 

Properties

AGSCredentialcredential
 
NSError * error
 
NSArray< AGSGeodatabaseDeltaInfo * > * geodatabaseDeltaInfos
 
AGSJobType jobType
 
NSArray< AGSJobMessage * > * messages
 
AGSOfflineMapSyncParametersparameters
 
NSProgress * progress
 
AGSRequestConfigurationrequestConfiguration
 
AGSOfflineMapSyncResultresult
 
NSString * serverJobID
 
AGSJobStatus status
 
NSDictionary< NSString *, id > * unknownJSON
 
NSDictionary< NSString *, id > * unsupportedJSON
 
NSURL * URL
 

Method Documentation

◆ cancel

- (BOOL) cancel

Cancels the job. Returns a value indicating whether the job was successfully canceled.

Since
100
Deprecated:
100.1. Replaced by cancelWithCompletion:.

Provided by category AGSJob(AGSDeprecated).

◆ cancelWithCompletion:

- (id<AGSCancelable>) cancelWithCompletion: (void(^)(NSError *_Nullable error))  completion

Cancels this AGSJob and waits for any asynchronous, server-side operations to be canceled.

The job is canceled and will result in an AGSJobStatusFailed status after all cancellation tasks have completed. For jobs running on a server, a cancel request is sent for the associated AGSJob::serverJobID. You should always cancel unneeded jobs (for example when exiting your app) to avoid placing unnecessary load on the server. Examples of server-side jobs include:

In addition, the AGSGenerateOfflineMapJob is composed of several server-side jobs, depending on the types of layers in your AGSMap. Canceling this high-level job will also send a cancel request to the underlying server jobs.

Upon calling this method, the AGSJob::status is immediately set to AGSJobStatusCanceling.

Parameters
completionA block that is invoked when the operation completes successfully or encounters an error.
Returns
An operation which can be canceled.
Since
100.14

◆ checkStatusWithCompletion:

- (id<AGSCancelable>) checkStatusWithCompletion: (void(^)(NSError *__nullable error))  completion

Force status check. This method can be called from UIApplication::application:performFetchWithCompletionHandler:.

Since
100.0

◆ fromJSON:error:

+ (nullable id<AGSJSONSerializable>) fromJSON: (id)  JSONObject
error: (NSError **)  error 
staticrequiredinherited

Initializes and returns an object from its JSON representation.

Parameters
JSONObjectNSDictionary or NSArray containing the JSON.
errorencountered during the operation, if any.
Since
100

◆ pause

- (BOOL) pause

Pauses the job. Returns a value indicating whether the job was successfully paused.

Since
100
Deprecated:
100.1. Please use the pause method through the NSProgress API (exposed via NSProgressReporting through the progress property).

Provided by category AGSJob(AGSDeprecated).

◆ startWithStatusHandler:completion: [1/2]

- (void) startWithStatusHandler: (nullable void(^)(AGSJobStatus status))  statusHandler
completion: (void(^)(AGSOfflineMapSyncResult *__nullable result, NSError *__nullable error))  completion 

Start the job by submitting it to the server

Parameters
statusHandleris invoked periodically whenever the job's status changes
completionblock that is invoked with the result when the job succeeds, or an error if it fails
Since
100.1
License Restrictions:
This feature requires a Basic license for production deployment when sync direction is Bidirectional or Upload with public feature services or when using a private feature service with any sync direction. "Public" feature services means services hosted on the Internet and available anonymously (not secured). "Private" includes all other scenarios such as feature services hosted on a local network within an enterprise or feature services hosted on the Internet but secured . No license required in Developer mode for testing.

◆ startWithStatusHandler:completion: [2/2]

- (void) startWithStatusHandler: (nullable void(^)(AGSJobStatus status))  statusHandler
completion: (void(^)(id __nullable result, NSError *__nullable error))  completion 

◆ toJSON:

- (nullable id) toJSON: (NSError **)  error
requiredinherited

Returns JSON representation for this object.

Parameters
errorencountered during the operation, if any.
Returns
NSDictionary or NSArray containing the JSON.
Since
100

Reimplemented in AGSPortalItem.

Property Documentation

◆ credential

- (AGSCredential*) credential
readwritenonatomicstronginherited

Security credentials to access the remote resource. Only applicable if the resource is secured.

Since
100

◆ error

- (NSError*) error
readnonatomicstronginherited

Error encountered during job execution, if any.

Since
100

◆ geodatabaseDeltaInfos

- (NSArray<AGSGeodatabaseDeltaInfo *>*) geodatabaseDeltaInfos
readnonatomiccopy

Returns information on upload and download delta geodatabases generated during the sync process.

Contains a collection of AGSGeodatabaseDeltaInfo with one for each geodatabase synced. These provide information about the synced geodatabase along with the paths to its uploaded and downloaded deltas.

Delta geodatabases allow you to troubleshoot sync problems - for example by inspecting the changes they contain or sending the file to the system administrator for the feature service.

This collection will be updated even if the job fails and there are deltas on disk. This collection will only be updated if AGSOfflineMapSyncParameters::keepGeodatabaseDeltas is YES, otherwise it will remain empty.

Since
100.10

◆ jobType

- (AGSJobType) jobType
readnonatomicassigninherited

The type of job

Since
100

◆ messages

- (NSArray<AGSJobMessage*>*) messages
readnonatomiccopyinherited

Informational messages produced during execution of the job.

The messages can be monitored using Key-Value Observing (KVO).

Since
100

◆ parameters

- (AGSOfflineMapSyncParameters*) parameters
readnonatomicstrong

The parameters used to kick off this job.

Since
100.2

◆ progress

- (NSProgress*) progress
readnonatomicstronginherited

The progress for this job. As a consumer of this progress property, you can observe it's property changes and pause, cancel, resume. Do not, however, set the readwrite properties of this progress object. Those are reserved for internal use. Setting them externally will corrupt the state and lead to undefined behavior.

Since
100.1

◆ requestConfiguration

- (AGSRequestConfiguration*) requestConfiguration
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.

Since
100

◆ result

- (AGSOfflineMapSyncResult*) result
readnonatomicstrong

Result of the job

Since
100.1

◆ serverJobID

- (NSString*) serverJobID
readnonatomiccopyinherited

Unique ID of the job on the server on which it is executing.

Since
100

◆ status

- (AGSJobStatus) status
readnonatomicassigninherited

Current status of the job.

The status can be monitored using Key-Value Observing (KVO).

Since
100

◆ unknownJSON

- (NSDictionary<NSString*,id>*) unknownJSON
readrequirednonatomiccopyinherited

A dictionary of values that was in the source JSON but was unparsed by API.

Returns
NSDictionary containing the unknown JSON.
Since
100

◆ unsupportedJSON

- (NSDictionary<NSString*,id>*) unsupportedJSON
readnonatomiccopyinherited

A dictionary of values that are supported by the REST API, but not exposed through the SDK API.

Returns
NSDictionary containing the unsupported JSON.
Since
100

◆ URL

- (NSURL*) URL
readrequirednonatomicstronginherited

The URL of the remote resource.

Since
100