Interface GeofenceAssetAdapter
- All Superinterfaces:
org.openremote.model.ContainerService
- All Known Implementing Classes:
ORConsoleGeofenceAssetAdapter
LocationAttributePredicate that apply to a given
Asset and can convert the LocationAttributePredicates into Geofences that can be implemented by
the asset(s) itself.
The adapter is notified when the Assets RulesEngine.AssetLocationPredicates change; if the
RulesEngine.AssetLocationPredicates.getLocationPredicates() is null or empty then it means that there
are no longer any associated with that Asset so the adapter should clear any that already exist on that
Asset, it is the adapters job to maintain state if required (see initialising flag on processLocationPredicates(java.util.List<org.openremote.manager.rules.RulesEngine.AssetLocationPredicates>)).
How the geofences are implemented and 'pushed' to the Assets is up to the adapter but when a geofence is
triggered on an asset then the asset should update its own location by posting to the asset/location endpoint, the
location value sent should be as follows:
- Geofence Enter - Send geofence centre point as location (centre point should have been provided in the geofence definition retrieved from the backend)
- Geofence Exit - Send null (this will clear the devices location and indicate that the asset has left the geofence)
-
Field Summary
Fields inherited from interface org.openremote.model.ContainerService
DEFAULT_PRIORITY, HIGH_PRIORITY, LOW_PRIORITY, MED_PRIORITY -
Method Summary
Modifier and TypeMethodDescriptionorg.openremote.model.rules.geofence.GeofenceDefinition[]getAssetGeofences(String assetId) Called to return the active geofences for the specifiedAsset; if this adapter supports the requested asset then it should return a non null value to prevent the request from being sent to other geofence adapters.getName()Get the name of this adaptervoidprocessLocationPredicates(List<RulesEngine.AssetLocationPredicates> modifiedAssetLocationPredicates) If an adapter handles the location predicates for a particular asset then the adapter should remove that item from the list to prevent other adapters from also handling it.Methods inherited from interface org.openremote.model.ContainerService
getPriority, init, start, stop
-
Method Details
-
getName
String getName()Get the name of this adapter -
processLocationPredicates
void processLocationPredicates(List<RulesEngine.AssetLocationPredicates> modifiedAssetLocationPredicates) If an adapter handles the location predicates for a particular asset then the adapter should remove that item from the list to prevent other adapters from also handling it. If anRulesEngine.AssetLocationPredicates.getLocationPredicates()is empty then it means there are no longer any location predicates associated with that asset -
getAssetGeofences
Called to return the active geofences for the specifiedAsset; if this adapter supports the requested asset then it should return a non null value to prevent the request from being sent to other geofence adapters.
-