Class KeySearchTracker

    • Constructor Detail

      • KeySearchTracker

        protected KeySearchTracker​(java.sql.Connection conn,
                                   java.util.Queue<Track> trackQueue)
        Build a search tracker
        Parameters:
        conn - connection to the database
        trackQueue - the queue where the tracks are temporary stored
    • Method Detail

      • getInstance

        public static KeySearchTracker getInstance​(java.sql.Connection con,
                                                   java.util.Queue<Track> trackQueue)
        Return an instance of the KeySearchTracker
        Parameters:
        con - connection to the database
        trackQueue - the queue where the tracks are temporary stored
        Returns:
        KeySearchTracker the searchy tracker
      • getStatementCreatingTable

        public java.lang.String getStatementCreatingTable()
        Description copied from class: AbstractTracker
        Generate the sql statement to create the table used by the tracker
        Specified by:
        getStatementCreatingTable in class AbstractTracker
        Returns:
        String sql statement
      • trackSearch

        protected void trackSearch​(java.lang.String keyword,
                                   Profile profile,
                                   java.lang.String sessionIdentifier)
        Record the search.
        Parameters:
        keyword - keyword
        profile - user
        sessionIdentifier - session
      • getKeywordSearches

        protected java.util.Map<java.lang.String,​java.lang.Integer> getKeywordSearches​(java.sql.Connection con)
        Return the number of search for each keyword
        Parameters:
        con - the connection
        Returns:
        map with key the keyword and the number of searches for that keyword