ServiceGeodatabase

class ServiceGeodatabase : Loadable

A container for a collection of ServiceFeatureTable connected to a feature service. A ServiceGeodatabase connects to a feature service as a whole, grouping together ServiceFeatureTable instances for related records queries, connecting to a version in a branch-versioned service, and managing edits for all tables.

Constructors

Link copied to clipboard
fun ServiceGeodatabase(    portalItem: PortalItem,     versionName: String = "",     sessionType: FeatureServiceSessionType = FeatureServiceSessionType.Transient)

Creates a new ServiceGeodatabase 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 ServiceGeodatabase will fail to load.

Link copied to clipboard
fun ServiceGeodatabase(    url: String,     versionName: String = "",     sessionType: FeatureServiceSessionType = FeatureServiceSessionType.Transient)

Creates a new ServiceGeodatabase 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 ServiceGeodatabase will fail to load.

Functions

Link copied to clipboard
suspend fun applyEdits(): Result<List<FeatureTableEditResult>>

Applies all local edits in all tables to the service. Edits in all tables are applied to the feature service in a call, which is more efficient than doing so one ServiceFeatureTable at a time.

Link copied to clipboard
open override fun cancelLoad()

Cancels loading metadata for the Loadable object.

Link copied to clipboard
suspend fun close(): Result<Unit>

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.

Link copied to clipboard
suspend fun createVersion(newVersion: ServiceVersionParameters): Result<ServiceVersionInfo>

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.

Link copied to clipboard
suspend fun fetchVersions(): Result<List<ServiceVersionInfo>>

Gets a list of all versions on the service. If the service isn't branch versioned, an ErrorType.MappingBranchVersioningNotSupportedByService is thrown.

Link copied to clipboard
fun getTable(layerId: Long): ServiceFeatureTable?

Returns 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 ServiceGeodatabase.getConnectedTables(), the existing object will be returned. Otherwise, a new ServiceFeatureTable will be created.

Link copied to clipboard
fun hasLocalEdits(): Boolean

Determines if any of the tables in the ServiceGeodatabase have unapplied edits.

Link copied to clipboard
open suspend override fun load(): Result<Unit>

Loads the metadata for the object.

Link copied to clipboard
open suspend override fun retryLoad(): Result<Unit>

Loads or retries loading metadata for the object.

Link copied to clipboard
suspend fun switchVersion(versionName: String): Result<Unit>

Switches all connected feature tables to the new version. An error is thrown if:

Link copied to clipboard
suspend fun undoLocalEdits(): Result<Unit>

Undos all of the local edits in all the tables.

Properties

Link copied to clipboard
val connectedTables: List<ServiceFeatureTable>
Link copied to clipboard
val defaultVersionName: String

The name of the default version

Link copied to clipboard
open override val loadStatus: StateFlow<LoadStatus>

The load status.

Link copied to clipboard
val portalItem: PortalItem?
Link copied to clipboard
val serviceInfo: ArcGISFeatureServiceInfo?
Link copied to clipboard
var sessionType: FeatureServiceSessionType

The type of read and edit sessions to use when working with the service. The default value is FeatureServiceSessionType.Transient.

Link copied to clipboard
val supportsBranchVersioning: Boolean

Whether the service supports branch versioning.

Link copied to clipboard
val url: String

The URL of the feature service or the portal item to connect to. Use ArcGISFeatureServiceInfo.getUrl() to get the feature service URL.

Link copied to clipboard
val versionName: String

The name of the version the ServiceGeodatabase is currently connected to. To change the version this ServiceGeodatabase is connected to, use the ServiceGeodatabase.switchVersion(String) method.