Package org.intermine.api.tracker
Class KeySearchTracker
- java.lang.Object
-
- org.intermine.api.tracker.AbstractTracker
-
- org.intermine.api.tracker.KeySearchTracker
-
- All Implemented Interfaces:
Tracker
public class KeySearchTracker extends AbstractTracker
- Author:
- Daniela
-
-
Field Summary
-
Fields inherited from class org.intermine.api.tracker.AbstractTracker
trackerLogger, trackQueue, trackTableName
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
KeySearchTracker(java.sql.Connection conn, java.util.Queue<Track> trackQueue)
Build a search tracker
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static KeySearchTracker
getInstance(java.sql.Connection con, java.util.Queue<Track> trackQueue)
Return an instance of the KeySearchTrackerprotected java.util.Map<java.lang.String,java.lang.Integer>
getKeywordSearches(java.sql.Connection con)
Return the number of search for each keywordjava.lang.String
getName()
Return the tracker's namejava.lang.String
getStatementCreatingTable()
Generate the sql statement to create the table used by the trackerprotected void
trackSearch(java.lang.String keyword, Profile profile, java.lang.String sessionIdentifier)
Record the search.-
Methods inherited from class org.intermine.api.tracker.AbstractTracker
createTrackerTable, getTrackTableName, releaseResources, setTrackQueue, storeTrack
-
-
-
-
Constructor Detail
-
KeySearchTracker
protected KeySearchTracker(java.sql.Connection conn, java.util.Queue<Track> trackQueue)
Build a search tracker- Parameters:
conn
- connection to the databasetrackQueue
- 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 databasetrackQueue
- the queue where the tracks are temporary stored- Returns:
- KeySearchTracker the searchy tracker
-
getName
public java.lang.String getName()
Description copied from class:AbstractTracker
Return the tracker's name- Specified by:
getName
in interfaceTracker
- Specified by:
getName
in classAbstractTracker
- Returns:
- String tracker's name
-
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 classAbstractTracker
- Returns:
- String sql statement
-
trackSearch
protected void trackSearch(java.lang.String keyword, Profile profile, java.lang.String sessionIdentifier)
Record the search.- Parameters:
keyword
- keywordprofile
- usersessionIdentifier
- 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
-
-