Package org.intermine.api.tracker
Class AbstractTracker
- java.lang.Object
-
- org.intermine.api.tracker.AbstractTracker
-
- All Implemented Interfaces:
Tracker
- Direct Known Subclasses:
KeySearchTracker
,ListTracker
,LoginTracker
,QueryTracker
,TemplateTracker
public abstract class AbstractTracker extends java.lang.Object implements Tracker
Abstract interface for creating trackers objects.- Author:
- dbutano
-
-
Field Summary
Fields Modifier and Type Field Description protected TrackerLogger
trackerLogger
protected java.util.Queue<Track>
trackQueue
protected java.lang.String
trackTableName
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractTracker(java.util.Queue<Track> trackQueue, java.lang.String trackTableName)
Construct a Tracker setting the tracks queue and the table name
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
createTrackerTable(java.sql.Connection connection)
Create the table where the tracker saves dataabstract java.lang.String
getName()
Return the tracker's nameabstract java.lang.String
getStatementCreatingTable()
Generate the sql statement to create the table used by the trackerjava.lang.String
getTrackTableName()
Return the table's name associated to the trackerprotected void
releaseResources(java.sql.ResultSet rs, java.sql.Statement stm)
Close the result set and statement objects specified in inputvoid
setTrackQueue(java.util.Queue<Track> trackQueue)
Set the queue of tracksvoid
storeTrack(Track track)
Save into the table the track object representing the user activity
-
-
-
Field Detail
-
trackQueue
protected java.util.Queue<Track> trackQueue
-
trackTableName
protected java.lang.String trackTableName
-
trackerLogger
protected TrackerLogger trackerLogger
-
-
Constructor Detail
-
AbstractTracker
protected AbstractTracker(java.util.Queue<Track> trackQueue, java.lang.String trackTableName)
Construct a Tracker setting the tracks queue and the table name- Parameters:
trackQueue
- the queue where the tracks are temporary storedtrackTableName
- the table where store the tracks
-
-
Method Detail
-
getTrackTableName
public java.lang.String getTrackTableName()
Return the table's name associated to the tracker- Returns:
- String table's name
-
createTrackerTable
public void createTrackerTable(java.sql.Connection connection) throws java.lang.Exception
Create the table where the tracker saves data- Specified by:
createTrackerTable
in interfaceTracker
- Parameters:
connection
- the userprofile connection- Throws:
java.lang.Exception
- when a database error access is verified
-
storeTrack
public void storeTrack(Track track)
Save into the table the track object representing the user activity- Specified by:
storeTrack
in interfaceTracker
- Parameters:
track
- the object saved into the database
-
getName
public abstract java.lang.String getName()
Return the tracker's name
-
setTrackQueue
public void setTrackQueue(java.util.Queue<Track> trackQueue)
Set the queue of tracks- Parameters:
trackQueue
- the queue to set
-
getStatementCreatingTable
public abstract java.lang.String getStatementCreatingTable()
Generate the sql statement to create the table used by the tracker- Returns:
- String sql statement
-
releaseResources
protected void releaseResources(java.sql.ResultSet rs, java.sql.Statement stm)
Close the result set and statement objects specified in input- Parameters:
rs
- the ResultSet object to closestm
- the STatement object to close
-
-