Documentation Home

Geolocation Workflow

The core Broadleaf geolocation service iterates through four steps to obtain geolocation data in the following order:

  • GeolocationFilter
  • GeolocationRequestProcessor
  • GeolocationService
  • GeolocationAPI

Geolocation Filter & Request Processor

The geolocation filter touches all site-side requests and delegates to the geolocation request processor.

If geolocation services are enabled, the processor will check the session for previously acquired geolocation data. If no data is found, then the processor determines the IP address of the request, makes a call to the geolocation service, and stores the resulting location data on the session. The acquired location data, regardless of whether it came from a new API call or the session, is then placed on the Broadleaf Request Context.

Geolocation Service

The geolocation service first determines the active API implementation using the geolocation.api system property. It will then call the identified API and return the location data to the request processor.

GeolocationAPI

Each implementation of the GeolocationAPI implements the getLocationData(String ipAddress) method and returns a geolocation data transfer object.

To learn more about the data transfer object, see the Data Transfer Object doc.