ArcGIS Runtime SDK for iOS
100.15
|
A container for a collection of AGSServiceFeatureTable
connected to a feature service.
An AGSServiceGeodatabase
connects to a feature service as a whole, grouping together AGSServiceFeatureTable
instances for related records queries, connecting to a version in a branch-versioned service, and managing edits for all tables.
Instance Methods | |
(id< AGSCancelable >) | - applyEditsWithCompletion: |
(void) | - cancelLoad |
(id< AGSCancelable >) | - closeWithCompletion: |
(id< AGSCancelable >) | - createVersionWithParameters:completion: |
(void) | - doCancelLoading |
(void) | - doStartLoading: |
(id< AGSCancelable >) | - fetchVersionsWithCompletion: |
(BOOL) | - hasLocalEdits |
(instancetype) | - initWithPortalItem: |
(instancetype) | - initWithPortalItem:sessionType: |
(instancetype) | - initWithPortalItem:versionName: |
(instancetype) | - initWithPortalItem:versionName:sessionType: |
(instancetype) | - initWithURL: |
(instancetype) | - initWithURL:sessionType: |
(instancetype) | - initWithURL:versionName: |
(instancetype) | - initWithURL:versionName:sessionType: |
(void) | - loadDidFinishWithError: |
(void) | - loadWithCompletion: |
(void) | - onLoadStatusChanged |
(void) | - retryLoadWithCompletion: |
(id< AGSCancelable >) | - switchVersionWithName:completion: |
(nullable AGSServiceFeatureTable *) | - tableWithLayerID: |
(id< AGSCancelable >) | - undoLocalEditsWithCompletion: |
Class Methods | |
(instancetype) | + serviceGeodatabaseWithPortalItem: |
(instancetype) | + serviceGeodatabaseWithPortalItem:sessionType: |
(instancetype) | + serviceGeodatabaseWithPortalItem:versionName: |
(instancetype) | + serviceGeodatabaseWithPortalItem:versionName:sessionType: |
(instancetype) | + serviceGeodatabaseWithURL: |
(instancetype) | + serviceGeodatabaseWithURL:sessionType: |
(instancetype) | + serviceGeodatabaseWithURL:versionName: |
(instancetype) | + serviceGeodatabaseWithURL:versionName:sessionType: |
Properties | |
NSArray< AGSServiceFeatureTable * > * | connectedTables |
AGSCredential * | credential |
NSString * | defaultVersionName |
NSError * | loadError |
AGSLoadStatus | loadStatus |
AGSPortalItem * | portalItem |
AGSRequestConfiguration * | requestConfiguration |
AGSArcGISFeatureServiceInfo * | serviceInfo |
AGSFeatureServiceSessionType | sessionType |
BOOL | supportsBranchVersioning |
NSURL * | URL |
NSString * | versionName |
- (id<AGSCancelable>) applyEditsWithCompletion: | (void(^)(NSArray< AGSFeatureTableEditResult * > *__nullable result, NSError *__nullable error)) | completion |
Applies all local edits in all tables to the service.
Edits in all tables are applied to the feature service in a single call, which is more efficient than doing so one AGSServiceFeatureTable
at a time.
completion | A block that is invoked when the operation finishes. The result parameter is populated if the operation completed successfully, otherwise the error parameter is populated. |
AGSFeatureServiceSessionType
|
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>) closeWithCompletion: | (void(^)(NSError *__nullable error)) | completion |
Closes this service geodatabase.
A request to stop any active reading or editing sessions with the feature service is sent and once this asynchronous process is complete, this service geodatabase will be closed.
Before calling this method, there should be no references to all related data. For example, terminate fetch versions, create version, switch, apply or undo edits, remove feature layers, and release tables from map.
After calling this method, accessing this service geodatabase or any of its connected tables will fail with AGSErrorCodeGDBDatabaseClosed
.
Closing this service geodatabase is not necessary if it has not been loaded.
completion | The error parameter is populated on failure. |
- (id<AGSCancelable>) createVersionWithParameters: | (AGSServiceVersionParameters *) | parameters | |
completion: | (void(^)(AGSServiceVersionInfo *__nullable result, NSError *__nullable error)) | completion | |
Creates a new version in the service based on the default version.
Branch versioning requires that the default version always be the ancestor of all other versions.
If the service isn't branch versioned, this will complete with AGSErrorCodeMappingBranchVersioningNotSupportedByService
If the version parameters do not include a name, this will complete with an error.
parameters | The properties of the new version. |
completion | A block that is invoked when the operation finishes. The result parameter is populated if the operation completed successfully, otherwise the error parameter is populated. |
- (void) doCancelLoading |
Never call this method directly. The framework calls this method on a background thread when cancelLoad (AGSLoadable-p)
is called. It is meant to be overriden by subclasses. Subclasses should override this method to cancel loading their data and call loadDidFinishWithError: (AGSLoadableBase(ForSubclassEyesOnly))
at the end passing in an error representing NSUserCancelledError
.
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
- (void) doStartLoading: | (BOOL) | retrying |
Never call this method directly. The framework calls this method on a background thread when loadWithCompletion: (AGSLoadable-p)
or retryLoadWithCompletion: (AGSLoadable-p)
is called. It is meant to be overriden by subclasses. Subclasses should override this method to load their data and call loadDidFinishWithError: (AGSLoadableBase(ForSubclassEyesOnly))
upon completion, passing in the error if any.
retrying | flag that is true if this method was called from retryLoadWithCompletion: (AGSLoadable-p) . |
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
- (id<AGSCancelable>) fetchVersionsWithCompletion: | (void(^)(NSArray< AGSServiceVersionInfo * > *__nullable result, NSError *__nullable error)) | completion |
Gets a list of all versions on the service.
If the service isn't branch versioned, this will complete with AGSErrorCodeMappingBranchVersioningNotSupportedByService
completion | A block that is invoked when the operation finishes. The result parameter is populated if the operation completed successfully, otherwise the error parameter is populated. |
- (BOOL) hasLocalEdits |
Determines if any of the tables in the AGSServiceGeodatabase
have unapplied edits.
- (instancetype) initWithPortalItem: | (AGSPortalItem *) | portalItem |
Creates a new AGSServiceGeodatabase
object from a feature service portal item, and connects to the default version in the feature service.
If the service is branch versioned, the AGSServiceGeodatabase
will connect to the default version.
portalItem | A feature service AGSPortalItem . |
- (instancetype) initWithPortalItem: | (AGSPortalItem *) | portalItem | |
sessionType: | (AGSFeatureServiceSessionType) | sessionType | |
Creates a new AGSServiceGeodatabase
object from a feature service portal item, and connects to the default version in the feature service.
If the service is branch versioned, the AGSServiceGeodatabase
will connect to the default version.
If using AGSFeatureServiceSessionTypePersistent
, it is important to call closeWithCompletion:
before destruction.
portalItem | A feature service AGSPortalItem . |
sessionType | The type of read and edit sessions to use when working with the service. |
- (instancetype) initWithPortalItem: | (AGSPortalItem *) | portalItem | |
versionName: | (NSString *) | versionName | |
Creates a new AGSServiceGeodatabase
object from a feature service portal item, and connects to a specific version in the feature service.
If a version with the name does not exist, or the service is not branch versioned, the AGSServiceGeodatabase
will fail to load.
portalItem | A feature service AGSPortalItem . |
versionName | The existing version to connect to when the AGSServiceGeodatabase loads. |
- (instancetype) initWithPortalItem: | (AGSPortalItem *) | portalItem | |
versionName: | (NSString *) | versionName | |
sessionType: | (AGSFeatureServiceSessionType) | sessionType | |
Creates a new AGSServiceGeodatabase
object from a feature service portal item, and connects to a specific version in the feature service.
If a version with the name does not exist, or the service is not branch versioned, the AGSServiceGeodatabase
will fail to load. If using AGSFeatureServiceSessionTypePersistent
, it is important to call closeWithCompletion:
before destruction.
portalItem | A feature service AGSPortalItem . |
versionName | The existing version to connect to when the AGSServiceGeodatabase loads. |
sessionType | The type of read and edit sessions to use when working with the service. |
- (instancetype) initWithURL: | (NSURL *) | URL |
Creates an AGSServiceGeodatabase
object connected to the default version in a feature service
If the service is branch versioned, the AGSServiceGeodatabase
will connect to the default version.
URL | The URL of the feature service or the portal item to connect to. |
- (instancetype) initWithURL: | (NSURL *) | URL | |
sessionType: | (AGSFeatureServiceSessionType) | sessionType | |
Creates an AGSServiceGeodatabase
object connected to the default version in a feature service.
If the service is branch versioned, the AGSServiceGeodatabase
will connect to the default version.
If using AGSFeatureServiceSessionTypePersistent
, it is important to call closeWithCompletion:
before destruction.
URL | The URL of the feature service or the portal item to connect to. |
sessionType | The type of read and edit sessions to use when working with the service. |
- (instancetype) initWithURL: | (NSURL *) | URL | |
versionName: | (NSString *) | versionName | |
Creates an AGSServiceGeodatabase
object connected to a specific version in a feature service.
If a version with the name does not exist, or the service is not branch versioned, the AGSServiceGeodatabase
will fail to load.
URL | The URL of the feature service or the portal item to connect to. |
versionName | The existing version to connect to when the AGSServiceGeodatabase loads. |
- (instancetype) initWithURL: | (NSURL *) | URL | |
versionName: | (NSString *) | versionName | |
sessionType: | (AGSFeatureServiceSessionType) | sessionType | |
Creates an AGSServiceGeodatabase
object connected to a specific version in a feature service.
If a version with the name does not exist, or the service is not branch versioned, the AGSServiceGeodatabase
will fail to load.
If using AGSFeatureServiceSessionTypePersistent
, it is important to call closeWithCompletion:
before destruction.
URL | The URL of the feature service or the portal item to connect to. |
versionName | The existing version to connect to when the AGSServiceGeodatabase loads. |
sessionType | The type of read and edit sessions to use when working with the service. |
- (void) loadDidFinishWithError: | (nullable NSError *) | error |
Only subclasses should call this method in doStartLoading: (AGSLoadableBase(ForSubclassEyesOnly))
and doCancelLoading (AGSLoadableBase(ForSubclassEyesOnly))
when done loading or failed to load.
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
|
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 - (void) onLoadStatusChanged |
Never call this method directly. The framework calls this method on a background thread when AGSLoadable::loadStatus
changes is called. Subclasses can optionally implement this to know when their loading status has changed.
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
|
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. |
+ (instancetype) serviceGeodatabaseWithPortalItem: | (AGSPortalItem *) | portalItem |
Creates a new AGSServiceGeodatabase
object from a feature service portal item, and connects to the default version in the feature service.
If the service is branch versioned, the AGSServiceGeodatabase
will connect to the default version.
portalItem | A feature service AGSPortalItem . |
+ (instancetype) serviceGeodatabaseWithPortalItem: | (AGSPortalItem *) | portalItem | |
sessionType: | (AGSFeatureServiceSessionType) | sessionType | |
Creates a new AGSServiceGeodatabase
object from a feature service portal item, and connects to the default version in the feature service.
If the service is branch versioned, the AGSServiceGeodatabase
will connect to the default version.
If using AGSFeatureServiceSessionTypePersistent
, it is important to call closeWithCompletion:
before destruction.
portalItem | A feature service AGSPortalItem . |
sessionType | The type of read and edit sessions to use when working with the service. |
+ (instancetype) serviceGeodatabaseWithPortalItem: | (AGSPortalItem *) | portalItem | |
versionName: | (NSString *) | versionName | |
Creates a new AGSServiceGeodatabase
object from a feature service portal item, and connects to a specific version in the feature service.
If a version with the name does not exist, or the service is not branch versioned, the AGSServiceGeodatabase
will fail to load.
portalItem | A feature service AGSPortalItem . |
versionName | The existing version to connect to when the AGSServiceGeodatabase loads. |
+ (instancetype) serviceGeodatabaseWithPortalItem: | (AGSPortalItem *) | portalItem | |
versionName: | (NSString *) | versionName | |
sessionType: | (AGSFeatureServiceSessionType) | sessionType | |
Creates a new AGSServiceGeodatabase
object from a feature service portal item, and connects to a specific version in the feature service.
If a version with the name does not exist, or the service is not branch versioned, the AGSServiceGeodatabase
will fail to load. If using AGSFeatureServiceSessionTypePersistent
, it is important to call closeWithCompletion:
before destruction.
portalItem | A feature service AGSPortalItem . |
versionName | The existing version to connect to when the AGSServiceGeodatabase loads. |
sessionType | The type of read and edit sessions to use when working with the service. |
+ (instancetype) serviceGeodatabaseWithURL: | (NSURL *) | URL |
Creates an AGSServiceGeodatabase
connected to the default version in a feature service.
If the service is branch versioned, the AGSServiceGeodatabase
will connect to the default version.
URL | The URL of the feature service or the portal item to connect to. |
URL
. + (instancetype) serviceGeodatabaseWithURL: | (NSURL *) | URL | |
sessionType: | (AGSFeatureServiceSessionType) | sessionType | |
Creates a new AGSServiceGeodatabase
connected to the default version in a feature service.
If the service is branch versioned, the AGSServiceGeodatabase
will connect to the default version.
If using AGSFeatureServiceSessionTypePersistent
, it is important to call closeWithCompletion:
before destruction.
URL | The URL of the feature service or the portal item to connect to. |
sessionType | The type of read and edit sessions to use when working with the service. |
URL
. + (instancetype) serviceGeodatabaseWithURL: | (NSURL *) | URL | |
versionName: | (NSString *) | versionName | |
Creates an AGSServiceGeodatabase
connected to a specific version in a feature service.
If a version with the name does not exist, or the service is not branch versioned, the AGSServiceGeodatabase
will fail to load.
URL | The URL of the feature service or the portal item to connect to. |
versionName | The existing version to connect to when the AGSServiceGeodatabase loads. |
URL
. + (instancetype) serviceGeodatabaseWithURL: | (NSURL *) | URL | |
versionName: | (NSString *) | versionName | |
sessionType: | (AGSFeatureServiceSessionType) | sessionType | |
Creates an AGSServiceGeodatabase
connected to a specific version in a feature service.
If a version with the name does not exist, or the service is not branch versioned, the AGSServiceGeodatabase
will fail to load.
If using AGSFeatureServiceSessionTypePersistent
, it is important to call closeWithCompletion:
before destruction.
URL | The URL of the feature service or the portal item to connect to. |
versionName | The existing version to connect to when the AGSServiceGeodatabase loads. |
sessionType | The type of read and edit sessions to use when working with the service. |
URL
. - (id<AGSCancelable>) switchVersionWithName: | (NSString *) | versionName | |
completion: | (void(^)(NSError *__nullable error)) | completion | |
Switches all connected feature tables to the new version.
An error is returned if:
AGSServiceGeodatabase::connectedTables
have unapplied editsCheck the result of hasLocalEdits:
before attempting to switch versions, to make sure all changes are saved to the service or discarded from the local cache. Use the applyEditsWithCompletion:
or undoLocalEditsWithCompletion:
methods as appropriate to save or discard changes before switching versions.
versionName | The name of the version to connect to. |
completion | The error parameter is populated on failure. |
- (nullable AGSServiceFeatureTable *) tableWithLayerID: | (NSInteger) | layerID |
Creates a service feature table object from the ID of a layer or table in the service.
If a table instance for the layer already exists in AGSServiceGeodatabase::connectedTables
, the existing object will be returned. Otherwise, a new AGSServiceFeatureTable
will be created.
layerID | The layer id for which to create the table. |
nil
is returned. - (id<AGSCancelable>) undoLocalEditsWithCompletion: | (void(^)(NSError *__nullable error)) | completion |
Undoes all of the local edits in all the tables.
completion | The error parameter is populated on failure. |
AGSFeatureServiceSessionType
|
readnonatomiccopy |
An array of feature tables managed by the AGSServiceGeodatabase
.
|
readwritenonatomicstronginherited |
Security credentials to access the remote resource. Only applicable if the resource is secured.
|
readnonatomiccopy |
The name of the default version.
|
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.
|
readnonatomicstrong |
The AGSPortalItem
which the AGSServiceGeodatabase
was created from.
- initWithPortalItem:
|
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.
|
readnonatomicstrong |
The metadata of the service this object is connected to.
|
readwritenonatomicassign |
The type of read and edit sessions to use when working with the service.
The default value is AGSFeatureServiceSessionTypeTransient
.
If the feature service this AGSServiceGeodatabase
references is not branch-versioned, only AGSFeatureServiceSessionTypeTransient
is supported.
If using AGSFeatureServiceSessionTypePersistent
, it is important to call closeWithCompletion:
before destruction.
Cannot be set after the AGSServiceGeodatabase
is loaded. When the AGSServiceGeodatabase
is created by loading an AGSMap
, use AGSLoadSettings
to control the session type.
|
readnonatomicassign |
Whether the service supports branch versioning.
|
readrequirednonatomicstronginherited |
The URL of the remote resource.
|
readnonatomiccopy |
The name of the version the AGSServiceGeodatabase
is currently connected to.
To change the version this AGSServiceGeodatabase
is connected to, use the switchVersionWithName:completion:
method.