Geotrigger condition and, when it is met, results in a GeotriggerNotificationInfo.
A Geotrigger defines a query that is evaluated against GIS data as it
changes in real time. For example, "Notify me when my device location enters one of my
target areas" or "Notify me when my device location is within 50 m of my destination".
A GeotriggerMonitor is created with a Geotrigger that it continually checks to
determine whether the condition has been met.
Once a GeotriggerMonitor is created, you begin checking the condition by calling
startAsync(). Once you are finished, call
stop(). When a Geotrigger evaluates to true, a
GeotriggerMonitorNotificationEvent is sent. You can subscribe to the
notification info to receive details of where the Geotrigger was activated and the
condition that was met.
- Since:
- 100.12.0
-
Constructor Summary
ConstructorsConstructorDescriptionGeotriggerMonitor(Geotrigger geotrigger) Constructs a GeotriggerMonitor with aGeotriggercondition. -
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters the given GeotriggerMonitorNotificationEventListener to be called when an update is received from the GeotriggerMonitor.voidaddGeotriggerMonitorStatusChangedEventListener(GeotriggerMonitorStatusChangedEventListener listener) Registers the given GeotriggerMonitorStatusChangedEventListener to be called when an update is received from the GeotriggerMonitor.voidaddGeotriggerMonitorWarningChangedEventListener(GeotriggerMonitorWarningChangedEventListener listener) Registers the given GeotriggerMonitorWarningChangedEventListener to be called when an update is received from the GeotriggerMonitor.Gets theGeotriggerthat will be monitored.Gets the current monitoring status of the GeotriggerMonitor.Gets an error that describes a problem encountered while starting or monitoring theGeotrigger.booleanremoveGeotriggerMonitorNotificationEventListener(GeotriggerMonitorNotificationEventListener listener) Unregisters the given GeotriggerMonitorNotificationEventListener that was previously added usingaddGeotriggerMonitorNotificationEventListener(GeotriggerMonitorNotificationEventListener).booleanremoveGeotriggerMonitorStatusChangedEventListener(GeotriggerMonitorStatusChangedEventListener listener) Unregisters the given GeotriggerMonitorStatusChangedEventListener that was previously added usingaddGeotriggerMonitorStatusChangedEventListener(GeotriggerMonitorStatusChangedEventListener).booleanremoveGeotriggerMonitorWarningChangedEventListener(GeotriggerMonitorWarningChangedEventListener listener) Unregisters the given GeotriggerMonitorWarningChangedEventListener that was previously added usingaddGeotriggerMonitorWarningChangedEventListener(GeotriggerMonitorWarningChangedEventListener).Starts evaluating the GeotriggerMonitor.voidstop()Stops evaluating the GeotriggerMonitor.
-
Constructor Details
-
GeotriggerMonitor
Constructs a GeotriggerMonitor with aGeotriggercondition.- Parameters:
geotrigger- theGeotriggerwhich will be monitored- Throws:
IllegalArgumentException- if geotrigger is null- Since:
- 100.12.0
-
-
Method Details
-
getGeotrigger
Gets theGeotriggerthat will be monitored.- Returns:
- the
Geotriggerthat will be monitored - Since:
- 100.12.0
-
getStatus
Gets the current monitoring status of the GeotriggerMonitor.A GeotriggerMonitor begins with a monitoring status of
GeotriggerMonitorStatus.STOPPEDand changes toGeotriggerMonitorStatus.STARTEDwhen you callstartAsync(). When you callstop(), the monitoring status changes toGeotriggerMonitorStatus.STOPPED.- Returns:
- the current monitoring status of the GeotriggerMonitor
- Since:
- 100.12.0
-
getWarning
Gets an error that describes a problem encountered while starting or monitoring theGeotrigger.A warning can occur at various stages of monitoring a
Geotrigger:- When starting the GeotriggerMonitor
- When accessing the components of the
Geotriggersuch as theGeotriggerFeed - When performing on-going monitoring
Problems that occur when starting the GeotriggerMonitor result in a
GeotriggerMonitorStatusofGeotriggerMonitorStatus.FAILED_TO_START. These issues must be fixed and start called again before you receive any notifications. For example, if theGeotrigger.getMessageExpression()is an invalidArcadeExpression, monitoring cannot be carried out.Problems that occur when accessing the components of the
Geotriggerwill not prevent the GeotriggerMonitor from starting. However, until the problem is resolved, you will not receive any notifications. For example, if aLocationGeotriggerFeeduses aLocationDataSourcethat is not started, you will not receive any notifications. Once theLocationDataSourceis successfully started, monitoring will resume. If aFenceParametershas no valid data for a fence you will not receive any notifications.Problems that occur during ongoing monitoring relate to issues with individual objects such as the graphics that make up the fences for a
GraphicFenceParameters. These warnings do not prevent notifications from being sent for other valid fences. For example, a fence is considered invalid if it has:- An empty
Geometry - A missing
SpatialReference - A point or polyline
Geometryand a buffer distance of 0.
- Returns:
- an error that describes a problem encountered while starting or monitoring the
Geotrigger, or null if none - Since:
- 100.12.0
-
startAsync
Starts evaluating the GeotriggerMonitor.When the GeotriggerMonitor is successfully performing checks, the
GeotriggerMonitorStatuswill beGeotriggerMonitorStatus.STARTED.- Returns:
- a
ListenableFutureindicating when the GeotriggerMonitor has started - Since:
- 100.12.0
-
stop
public void stop()Stops evaluating the GeotriggerMonitor.Stopping the GeotriggerMonitor prevents the condition from being evaluated and notifications from being sent. If you are using a
LocationGeotriggerFeedcreated from aLocationDataSource, the data source must also be stopped to turn off GPS receivers etc.When the GeotriggerMonitor is stopped, the
getStatus()will beGeotriggerMonitorStatus.STOPPED.- Since:
- 100.12.0
-
addGeotriggerMonitorNotificationEventListener
public void addGeotriggerMonitorNotificationEventListener(GeotriggerMonitorNotificationEventListener listener) Registers the given GeotriggerMonitorNotificationEventListener to be called when an update is received from the GeotriggerMonitor.Adding this listener on the UI thread will cause it to be invoked on the UI thread, otherwise it is not guaranteed on which thread the listener is invoked.
- Parameters:
listener- the listener to register- Throws:
IllegalArgumentException- if the GeotriggerMonitorNotificationEventListener is null- Since:
- 100.12.0
- See Also:
-
removeGeotriggerMonitorNotificationEventListener
public boolean removeGeotriggerMonitorNotificationEventListener(GeotriggerMonitorNotificationEventListener listener) Unregisters the given GeotriggerMonitorNotificationEventListener that was previously added usingaddGeotriggerMonitorNotificationEventListener(GeotriggerMonitorNotificationEventListener).- Parameters:
listener- the listener to unregister- Returns:
- true if the listener was successfully removed; false otherwise
- Since:
- 100.12.0
-
addGeotriggerMonitorStatusChangedEventListener
public void addGeotriggerMonitorStatusChangedEventListener(GeotriggerMonitorStatusChangedEventListener listener) Registers the given GeotriggerMonitorStatusChangedEventListener to be called when an update is received from the GeotriggerMonitor.Adding this listener on the UI thread will cause it to be invoked on the UI thread, otherwise it is not guaranteed on which thread the listener is invoked.
- Parameters:
listener- the listener to register- Throws:
IllegalArgumentException- if the GeotriggerMonitorStatusChangedEventListener is null- Since:
- 100.12.0
- See Also:
-
removeGeotriggerMonitorStatusChangedEventListener
public boolean removeGeotriggerMonitorStatusChangedEventListener(GeotriggerMonitorStatusChangedEventListener listener) Unregisters the given GeotriggerMonitorStatusChangedEventListener that was previously added usingaddGeotriggerMonitorStatusChangedEventListener(GeotriggerMonitorStatusChangedEventListener).- Parameters:
listener- the listener to unregister- Returns:
- true if the listener was successfully removed; false otherwise
- Since:
- 100.12.0
-
addGeotriggerMonitorWarningChangedEventListener
public void addGeotriggerMonitorWarningChangedEventListener(GeotriggerMonitorWarningChangedEventListener listener) Registers the given GeotriggerMonitorWarningChangedEventListener to be called when an update is received from the GeotriggerMonitor.Adding this listener on the UI thread will cause it to be invoked on the UI thread, otherwise it is not guaranteed on which thread the listener is invoked.
- Parameters:
listener- the listener to register- Throws:
IllegalArgumentException- if the GeotriggerMonitorWarningChangedEventListener is null- Since:
- 100.12.0
- See Also:
-
removeGeotriggerMonitorWarningChangedEventListener
public boolean removeGeotriggerMonitorWarningChangedEventListener(GeotriggerMonitorWarningChangedEventListener listener) Unregisters the given GeotriggerMonitorWarningChangedEventListener that was previously added usingaddGeotriggerMonitorWarningChangedEventListener(GeotriggerMonitorWarningChangedEventListener).- Parameters:
listener- the listener to unregister- Returns:
- true if the listener was successfully removed; false otherwise
- Since:
- 100.12.0
-