- All Implemented Interfaces:
RemoteResource
,Loadable
DynamicEntityDataSource
that receives a stream of observations from an ArcGIS stream service.
Currently, this is the only concrete class deriving from DynamicEntityDataSource
.
Members of this class allow an application to:
- connect to and receive observations from an ArcGIS stream service
- access metadata about the ArcGIS stream service
- set a server-side filter on the service to limit the number and type of observations sent
To learn more about ArcGIS stream services see: ArcGIS Server - Stream Services in the ArcGIS Enterprise documentation.
- Since:
- 200.1.0
-
Property Summary
TypePropertyDescriptionDefines which observations are returned from the service.Metadata that describes the ArcGIS stream service.Properties inherited from class com.esri.arcgisruntime.realtime.DynamicEntityDataSource
connectionError, connectionStatus, loadError, loadStatus, maximumReconnectionAttempts, purgeOptions, reconnectionInterval
-
Nested Class Summary
Nested classes/interfaces inherited from class com.esri.arcgisruntime.realtime.DynamicEntityDataSource
DynamicEntityDataSource.DynamicEntityObservationPurgedEvent, DynamicEntityDataSource.DynamicEntityObservationPurgedListener, DynamicEntityDataSource.DynamicEntityObservationReceivedEvent, DynamicEntityDataSource.DynamicEntityObservationReceivedListener, DynamicEntityDataSource.DynamicEntityPurgedEvent, DynamicEntityDataSource.DynamicEntityPurgedListener, DynamicEntityDataSource.DynamicEntityReceivedEvent, DynamicEntityDataSource.DynamicEntityReceivedListener
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDefines which observations are returned from the service.Gets the value of thefilter
property.Gets the value of theserviceInfo
property.getUri()
Gets the URI of thisRemoteResource
.protected void
protected CompletableFuture
<Void> Handles the connection process of a data source.protected CompletableFuture
<Void> Handles the disconnection process of a data source.protected CompletableFuture
<DynamicEntityDataSourceInfo> Handles the loading process of a data source and returnsDynamicEntityDataSourceInfo
.Metadata that describes the ArcGIS stream service.void
setFilter
(ArcGISStreamServiceFilter filter) Sets the value of thefilter
property.Methods inherited from class com.esri.arcgisruntime.realtime.DynamicEntityDataSource
addDoneLoadingListener, addDynamicEntityObservationPurgedListener, addDynamicEntityObservationReceivedListener, addDynamicEntityPurgedListener, addDynamicEntityReceivedListener, addLoadStatusChangedListener, addObservation, cancelLoad, connectAsync, connectionErrorProperty, connectionStatusProperty, deleteEntityAsync, disconnectAsync, getConnectionError, getConnectionStatus, getCredential, getLoadError, getLoadStatus, getMaximumReconnectionAttempts, getPurgeOptions, getReconnectionInterval, getRequestConfiguration, loadAsync, loadErrorProperty, loadStatusProperty, maximumReconnectionAttemptsProperty, purgeAllAsync, purgeOptionsProperty, reconnectionIntervalProperty, removeDoneLoadingListener, removeDynamicEntityObservationPurgedListener, removeDynamicEntityObservationReceivedListener, removeDynamicEntityPurgedListener, removeDynamicEntityReceivedListener, removeLoadStatusChangedListener, retryLoadAsync, setConnectionFailed, setCredential, setMaximumReconnectionAttempts, setReconnectionInterval, setRequestConfiguration
-
Property Details
-
filter
Defines which observations are returned from the service.Use this property to define a filter that informs the server which observations to send on the stream. The filter may include spatial or attribute criteria (or both). Using this server-side filter is useful for limiting how much data must be handled in the client application, which can help with application performance and memory footprint.
This property is used when the data source connection is initiated; therefore, the filter cannot be changed once the data source is loaded.
The default value is null, meaning no filter is applied.
- Since:
- 200.1.0
- See Also:
-
serviceInfo
Metadata that describes the ArcGIS stream service.This property is null by default and is populated when the data source loads.
Once the data source is loaded, you can use this metadata to find things like:
- Fields: Field definitions for data in the stream
- Track ID field: The field that contains a unique ID for each track in a track-aware service
- Archive service URL: A service that contains the latest observations for dynamic entities provided by this stream.
- Since:
- 200.1.0
- See Also:
-
-
Constructor Details
-
ArcGISStreamService
Creates a new stream service.- Parameters:
url
- the URL of the stream service- Throws:
NullPointerException
- if url is null- Since:
- 200.1.0
-
-
Method Details
-
internalDoneLoadingListener
protected void internalDoneLoadingListener() -
filterProperty
Defines which observations are returned from the service.Use this property to define a filter that informs the server which observations to send on the stream. The filter may include spatial or attribute criteria (or both). Using this server-side filter is useful for limiting how much data must be handled in the client application, which can help with application performance and memory footprint.
This property is used when the data source connection is initiated; therefore, the filter cannot be changed once the data source is loaded.
The default value is null, meaning no filter is applied.
- Returns:
- the
filter
property - Since:
- 200.1.0
- See Also:
-
getFilter
Gets the value of thefilter
property.- Property description:
- Defines which observations are returned from the service.
Use this property to define a filter that informs the server which observations to send on the stream. The filter may include spatial or attribute criteria (or both). Using this server-side filter is useful for limiting how much data must be handled in the client application, which can help with application performance and memory footprint.
This property is used when the data source connection is initiated; therefore, the filter cannot be changed once the data source is loaded.
The default value is null, meaning no filter is applied.
- Returns:
- the value of the
filter
property - Since:
- 200.1.0
- See Also:
-
setFilter
Sets the value of thefilter
property.- Property description:
- Defines which observations are returned from the service.
Use this property to define a filter that informs the server which observations to send on the stream. The filter may include spatial or attribute criteria (or both). Using this server-side filter is useful for limiting how much data must be handled in the client application, which can help with application performance and memory footprint.
This property is used when the data source connection is initiated; therefore, the filter cannot be changed once the data source is loaded.
The default value is null, meaning no filter is applied.
- Parameters:
filter
- the value for thefilter
property- Since:
- 200.1.0
- See Also:
-
serviceInfoProperty
Metadata that describes the ArcGIS stream service.This property is null by default and is populated when the data source loads.
Once the data source is loaded, you can use this metadata to find things like:
- Fields: Field definitions for data in the stream
- Track ID field: The field that contains a unique ID for each track in a track-aware service
- Archive service URL: A service that contains the latest observations for dynamic entities provided by this stream.
- Returns:
- the
serviceInfo
property - Since:
- 200.1.0
- See Also:
-
getServiceInfo
Gets the value of theserviceInfo
property.- Property description:
- Metadata that describes the ArcGIS stream service.
This property is null by default and is populated when the data source loads.
Once the data source is loaded, you can use this metadata to find things like:
- Fields: Field definitions for data in the stream
- Track ID field: The field that contains a unique ID for each track in a track-aware service
- Archive service URL: A service that contains the latest observations for dynamic entities provided by this stream.
- Returns:
- the value of the
serviceInfo
property - Since:
- 200.1.0
- See Also:
-
onConnectAsync
Description copied from class:DynamicEntityDataSource
Handles the connection process of a data source.Override this method to perform operations that initiate a connection and start the flow of data from an underlying data source. For instance, operations like connecting a websocket, opening a source file, or starting a polling timer are all operations that may be performed in this method.
This method is called by the ArcGIS Maps SDK when the connection is required. This can be due to an explicit call to
DynamicEntityDataSource.connectAsync()
or called implicitly when a layer that contains the data source needs to be rendered.The completable future should complete exceptionally if the connect operation fails. The exception is passed back to the data source and is available in the
DynamicEntityDataSource.connectionErrorProperty()
property.If
DynamicEntityDataSource.disconnectAsync()
is called when aDynamicEntityDataSource.connectAsync()
is in progress the future returned here will be cancelled by completing exceptionally with aCancellationException
. The implementation ofonConnectAsync()
should check for cancellation when the future completes and take any necessary action, for example, releasing resources.- Specified by:
onConnectAsync
in classDynamicEntityDataSource
- Returns:
- a
CompletableFuture
that handles the connection process of a data source
-
onDisconnectAsync
Description copied from class:DynamicEntityDataSource
Handles the disconnection process of a data source.Override this method to perform operations that stop the flow of data from an underlying data source.
If a
DynamicEntityDataSource.connectAsync()
is in progress when this method is called the future returned byDynamicEntityDataSource.onConnectAsync()
will be cancelled by completing exceptionally.- Specified by:
onDisconnectAsync
in classDynamicEntityDataSource
- Returns:
- a
CompletableFuture
that handles the disconnection process of a data source
-
onLoadAsync
Description copied from class:DynamicEntityDataSource
Handles the loading process of a data source and returnsDynamicEntityDataSourceInfo
.Override this method to populate and return a
DynamicEntityDataSourceInfo
object. This object defines the schema and metadata used by the internal data cache of the DynamicEntityDataSource. If the returnedDynamicEntityDataSourceInfo
object does not contain all required values, the data source will fail to load and will not be usable.This method is called by the ArcGIS Maps SDK when loading is required. This can be due to an explicit call to load the data source using
Loadable.loadAsync()
or called implicitly when a layer that contains the data source needs to be rendered.The completable future should complete exceptionally if the load operation fails. The exception is passed back to the data source and is available in the
DynamicEntityDataSource.loadErrorProperty()
property.- Specified by:
onLoadAsync
in classDynamicEntityDataSource
- Returns:
- a
CompletableFuture
that returns aDynamicEntityDataSourceInfo
-
getUri
Description copied from interface:RemoteResource
Gets the URI of thisRemoteResource
. Typically this is the URI used to instantiate the object.- Returns:
- the URI of this RemoteResource
-