Class GeotriggerNotificationInfo
- java.lang.Object
-
- com.esri.arcgisruntime.geotriggers.GeotriggerNotificationInfo
-
- Direct Known Subclasses:
FenceGeotriggerNotificationInfo
public class GeotriggerNotificationInfo extends Object
Provides details about aGeotrigger
condition that has been met.A GeotriggerNotificationInfo is sent by a
GeotriggerMonitor
whenever the condition described by itsGeotrigger
is met. TheGeotrigger
also defines how the GeotriggerNotificationInfo should be created. For example, it describes what message should be displayed to the user.- Since:
- 100.12.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
getActions()
Gets a set of strings describing recommended actions based on this notification.String
getFeedEntityId()
Gets a unique ID for the entity within the feed that triggered the notification info.LocationDataSource.Location
getFeedLocation()
Gets aLocationDataSource.Location
, received from the feed, that meets theGeotriggerMonitor
condition.GeotriggerMonitor
getGeotriggerMonitor()
Gets theGeotriggerMonitor
that sent this notification.String
getMessage()
Gets a message that describes the notification.Map<String,Object>
getMessageProperties()
Gets a dictionary of optional properties derived from theGeotrigger.getMessageExpression()
.
-
-
-
Method Detail
-
getActions
public List<String> getActions()
Gets a set of strings describing recommended actions based on this notification.Optionally, use these strings to determine whether your app will perform custom behavior, such as showing messages or starting/stopping tracking. Note that there is no requirement to take any action when a notification is delivered, but these provide a way to understand the intention of the author of the
Geotrigger
. This property can be empty.These actions are the result of evaluating the
Geotrigger.getMessageExpression()
for the specific objects that triggered this notification. If the expression returns a dictionary containing a list of strings with the key "actions", they are shown in this property.For example, if the
Geotrigger.getMessageExpression()
evaluates to a dictionary ofgetMessageProperties()
containing the following key value pairs:- "message" with the string "Hello world"
- "actions" with a list of action strings "startTracking"
then this property returns a list containing "startTracking". The list of actions are simple strings, so you can use them to control any custom action for your app.
The author of a
Geotrigger
can supply a set of all the possibleGeotrigger.getRequestedActions()
when defining theGeotrigger
. This property returns a list of strings indicating the actions that should be taken by your app, based on this GeotriggerNotificationInfo.- Returns:
- a set of strings describing recommended actions based on this notification
- Since:
- 100.14.0
-
getFeedEntityId
public String getFeedEntityId()
Gets a unique ID for the entity within the feed that triggered the notification info.This property is consistent for all notifications for a given feed entity. For example, use this ID to count the number of sites a team member visits.
If a feed is a
LocationGeotriggerFeed
, all location updates for that feed share the same ID.With a
FenceGeotrigger
, you can combine this property with theFenceGeotriggerNotificationInfo.getFenceId()
to create an ID that groups all notifications for a given feed entity and a specific fence. For example, use a concatenation of the two properties to display a list of areas of interest that are currently occupied and the details of who has entered them.To group events by the geotrigger, use the
Geotrigger.getGeotriggerId()
property.- Returns:
- a unique ID for the entity within the feed that triggered the notification info
- Since:
- 100.13.0
- See Also:
FenceGeotriggerNotificationInfo.getFenceId()
,Geotrigger.getGeotriggerId()
-
getFeedLocation
public LocationDataSource.Location getFeedLocation()
Gets aLocationDataSource.Location
, received from the feed, that meets theGeotriggerMonitor
condition.The
Location
is set if aLocationGeotriggerFeed
was used to create theGeotrigger
that theGeotriggerMonitor
is monitoring. This allows you to access the position and meta-data from the feed, such as the horizontal accuracy, velocity, time stamp and otherLocationDataSource.Location.getAdditionalSourceProperties()
.- Returns:
- a
LocationDataSource.Location
, received from the feed, that meets theGeotriggerMonitor
condition, or null if none - Since:
- 100.12.0
-
getGeotriggerMonitor
public GeotriggerMonitor getGeotriggerMonitor()
Gets theGeotriggerMonitor
that sent this notification.The
GeotriggerMonitor
evaluates a specificGeotrigger
condition that has been met by this GeotriggerNotificationInfo. A singleGeotrigger
condition can result in multiple, repeat notifications.Use this property to interact directly with the
GeotriggerMonitor
. For example, if you no longer want to receive future notifications, you can callGeotriggerMonitor.stop()
.- Returns:
- the
GeotriggerMonitor
that sent this notification - Since:
- 100.12.0
-
getMessage
public String getMessage()
Gets a message that describes the notification.The notification message is the result of evaluating the
Geotrigger.getMessageExpression()
for the specific objects that triggered this notification. The message could be a hard-coded string or use attributes from an area of interest that was entered to display a custom message.For example, with a
FenceGeotrigger
, setting theGeotrigger.getMessageExpression()
property to:"You have entered " + $fencefeature.area_name
would return the
getMessage()
"You have entered Area A", where "area_name" is an attribute field on theFenceGeotriggerNotificationInfo.getFenceGeoElement()
.You can use this message to alert the user directly or in other business logic in your app.
- Returns:
- a message that describes the notification
- Since:
- 100.12.0
-
getMessageProperties
public Map<String,Object> getMessageProperties()
Gets a dictionary of optional properties derived from theGeotrigger.getMessageExpression()
.Optionally, you can evaluate the
ArcadeExpression
to produce properties on top of the basicgetMessage()
. You can access this additional information via this dictionary.- Returns:
- a dictionary of optional properties derived from the
Geotrigger.getMessageExpression()
. - Since:
- 100.12.0
-
-