Interface Associator

  • All Known Implementing Classes:
    DefaultAssociator

    public interface Associator
    Implement event association logic used by the indexer. It is the associators job to describe how to find matching events, and then choose the best matching event that was found. The indexer uses the Associator to build a query used to search the ProductIndex. After querying the ProductIndex, the indexer then calls the chooseEvent method with any found events.
    • Method Detail

      • getSearchRequest

        SearchRequest getSearchRequest​(ProductSummary summary)
        Create a SearchRequest that can be used to find related events.
        Parameters:
        summary - the product summary being associated.
        Returns:
        a SearchRequest that can be used to search the ProductIndex.
      • chooseEvent

        Event chooseEvent​(java.util.List<Event> events,
                          ProductSummary summary)
        Choose the best matching event for a product summary from a list of events. If no events match, returns null.
        Parameters:
        events - a list of candidate events.
        summary - the product summary being associated.
        Returns:
        the best match event, or null if no matching event found.
      • eventsAssociated

        boolean eventsAssociated​(Event event1,
                                 Event event2)
        Check if two events are associated.
        Parameters:
        event1 - the first event
        event2 - the second event
        Returns:
        true if they refer to the same event, false otherwise.
      • getEventIdQuery

        ProductIndexQuery getEventIdQuery​(java.lang.String eventSource,
                                          java.lang.String eventCode)
        Get a ProductIndexQuery that searches by eventid.
        Parameters:
        eventSource - relevant to event
        eventCode - relevant to event
        Returns:
        a ProductIndexQuery that searches by eventid.
      • getLocationQuery

        ProductIndexQuery getLocationQuery​(java.util.Date time,
                                           java.math.BigDecimal latitude,
                                           java.math.BigDecimal longitude)
        Get a ProductIndexQuery that searches by location.
        Parameters:
        time - of event
        latitude - of event
        longitude - of event
        Returns:
        a ProductIndexQuery that searches by location.