Class ArcGISStreamService

java.lang.Object
com.esri.arcgisruntime.realtime.DynamicEntityDataSource
com.esri.arcgisruntime.realtime.ArcGISStreamService
All Implemented Interfaces:
RemoteResource, Loadable

public final class ArcGISStreamService extends DynamicEntityDataSource
A 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
In the current release, only stream services that send point geometries are supported.

To learn more about ArcGIS stream services see: ArcGIS Server - Stream Services in the ArcGIS Enterprise documentation.

Since:
200.1.0
  • Property Details

    • filter

      public ObjectProperty<ArcGISStreamServiceFilter> 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.

      Since:
      200.1.0
      See Also:
    • serviceInfo

      public ReadOnlyObjectProperty<ArcGISStreamServiceInfo> 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.
      Since:
      200.1.0
      See Also:
  • Constructor Details

    • ArcGISStreamService

      public ArcGISStreamService(String url)
      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

      public ObjectProperty<ArcGISStreamServiceFilter> 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

      public ArcGISStreamServiceFilter getFilter()
      Gets the value of the filter 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

      public void setFilter(ArcGISStreamServiceFilter filter)
      Sets the value of the filter 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 the filter property
      Since:
      200.1.0
      See Also:
    • serviceInfoProperty

      public ReadOnlyObjectProperty<ArcGISStreamServiceInfo> 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

      public ArcGISStreamServiceInfo getServiceInfo()
      Gets the value of the serviceInfo 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

      protected CompletableFuture<Void> 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 a DynamicEntityDataSource.connectAsync() is in progress the future returned here will be cancelled by completing exceptionally with a CancellationException. The implementation of onConnectAsync() should check for cancellation when the future completes and take any necessary action, for example, releasing resources.

      Specified by:
      onConnectAsync in class DynamicEntityDataSource
      Returns:
      a CompletableFuture that handles the connection process of a data source
    • onDisconnectAsync

      protected CompletableFuture<Void> 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 by DynamicEntityDataSource.onConnectAsync() will be cancelled by completing exceptionally.

      Specified by:
      onDisconnectAsync in class DynamicEntityDataSource
      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 returns DynamicEntityDataSourceInfo.

      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 returned DynamicEntityDataSourceInfo 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 class DynamicEntityDataSource
      Returns:
      a CompletableFuture that returns a DynamicEntityDataSourceInfo
    • getUri

      public String getUri()
      Description copied from interface: RemoteResource
      Gets the URI of this RemoteResource. Typically this is the URI used to instantiate the object.
      Returns:
      the URI of this RemoteResource