Package org.dspace.statistics.service
Interface SolrLoggerService
-
- All Known Implementing Classes:
SolrLoggerServiceImpl
public interface SolrLoggerServiceStatic holder for a HttpSolrClient connection pool to issue usage logging events to Solr from DSpace libraries, and some static query composers.- Author:
- ben at atmire.com, kevinvandevelde at atmire.com, mdiggory at atmire.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voiddeleteIP(String ip)voiddeleteRobotsByIP()voiddeleteRobotsByIsBotFlag()voidexportHits()Export all SOLR usage statistics for viewing/downloading content to a flat text file.StringgetIgnoreSpiderIPs()Returns in a filterQuery string all the ip addresses that should be ignoredbooleanisUseProxies()voidmarkRobotByUserAgent(String agent)voidmarkRobotsByIP()voidoptimizeSOLR()Maintenance to keep a SOLR index efficient.voidpost(DSpaceObject dspaceObject, javax.servlet.http.HttpServletRequest request, EPerson currentUser)Deprecated.voidpostSearch(DSpaceObject resultObject, javax.servlet.http.HttpServletRequest request, EPerson currentUser, List<String> queries, int rpp, String sortBy, String order, int page, DSpaceObject scope)voidpostView(DSpaceObject dspaceObject, String ip, String userAgent, String xforwardedfor, EPerson currentUser)voidpostView(DSpaceObject dspaceObject, javax.servlet.http.HttpServletRequest request, EPerson currentUser)Store a usage event into Solr.voidpostWorkflow(UsageWorkflowEvent usageWorkflowEvent)voidquery(String query, int max)org.apache.solr.client.solrj.response.QueryResponsequery(String query, String filterQuery, String facetField, int rows, int max, String dateType, String dateStart, String dateEnd, List<String> facetQueries, String sort, boolean ascending)ObjectCount[]queryFacetDate(String query, String filterQuery, int max, String dateType, String dateStart, String dateEnd, boolean showTotal, Context context)Query used to get values grouped by the date.ObjectCount[]queryFacetField(String query, String filterQuery, String facetField, int max, boolean showTotal, List<String> facetQueries)Query used to get values grouped by the given facet field.Map<String,Integer>queryFacetQuery(String query, String filterQuery, List<String> facetQueries)Map<String,List<String>>queryField(String query, List oldFieldVals, String field)ObjectCountqueryTotal(String query, String filterQuery)voidreindexBitstreamHits(boolean removeDeletedBitstreams)voidremoveIndex(String query)Delete data from the index, as described by a query.voidshardSolrIndex()voidstoreParents(org.apache.solr.common.SolrInputDocument doc1, DSpaceObject dso)Method just used to log the parents.voidupdate(String query, String action, List<String> fieldNames, List<List<Object>> fieldValuesList)
-
-
-
Method Detail
-
post
void post(DSpaceObject dspaceObject, javax.servlet.http.HttpServletRequest request, EPerson currentUser)
Deprecated.Old post method, use the new postview method instead !- Parameters:
dspaceObject- the object used.request- the current request context.currentUser- the current session's user.
-
postView
void postView(DSpaceObject dspaceObject, javax.servlet.http.HttpServletRequest request, EPerson currentUser)
Store a usage event into Solr.- Parameters:
dspaceObject- the object used.request- the current request context.currentUser- the current session's user.
-
postView
void postView(DSpaceObject dspaceObject, String ip, String userAgent, String xforwardedfor, EPerson currentUser)
-
postSearch
void postSearch(DSpaceObject resultObject, javax.servlet.http.HttpServletRequest request, EPerson currentUser, List<String> queries, int rpp, String sortBy, String order, int page, DSpaceObject scope)
-
postWorkflow
void postWorkflow(UsageWorkflowEvent usageWorkflowEvent) throws SQLException
- Throws:
SQLException
-
storeParents
void storeParents(org.apache.solr.common.SolrInputDocument doc1, DSpaceObject dso) throws SQLExceptionMethod just used to log the parents.- Community log: owning comms.
- Collection log: owning comms and their comms.
- Item log: owning colls/comms.
- Bitstream log: owning item/colls/comms.
- Parameters:
doc1- the current SolrInputDocumentdso- the current dspace object we want to log- Throws:
SQLException- if database error ignore it
-
isUseProxies
boolean isUseProxies()
-
removeIndex
void removeIndex(String query) throws IOException, org.apache.solr.client.solrj.SolrServerException
Delete data from the index, as described by a query.- Parameters:
query- description of the records to be deleted.- Throws:
IOException- A general class of exceptions produced by failed or interrupted I/O operations.org.apache.solr.client.solrj.SolrServerException- Exception from the Solr server to the solrj Java client.
-
queryField
Map<String,List<String>> queryField(String query, List oldFieldVals, String field) throws IOException
- Throws:
IOException
-
markRobotsByIP
void markRobotsByIP()
-
markRobotByUserAgent
void markRobotByUserAgent(String agent)
-
deleteRobotsByIsBotFlag
void deleteRobotsByIsBotFlag()
-
deleteIP
void deleteIP(String ip)
-
deleteRobotsByIP
void deleteRobotsByIP()
-
update
void update(String query, String action, List<String> fieldNames, List<List<Object>> fieldValuesList) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
query
void query(String query, int max) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
queryFacetField
ObjectCount[] queryFacetField(String query, String filterQuery, String facetField, int max, boolean showTotal, List<String> facetQueries) throws org.apache.solr.client.solrj.SolrServerException, IOException
Query used to get values grouped by the given facet field.- Parameters:
query- the query to be usedfilterQuery- filter queryfacetField- the facet field on which to group our valuesmax- the max number of values given back (in case of 10 the top 10 will be given)showTotal- a boolean determining whether the total amount should be given back as the last element of the arrayfacetQueries- list of facet queries- Returns:
- an array containing our results
- Throws:
org.apache.solr.client.solrj.SolrServerException- Exception from the Solr server to the solrj Java client.IOException- passed through.
-
queryFacetDate
ObjectCount[] queryFacetDate(String query, String filterQuery, int max, String dateType, String dateStart, String dateEnd, boolean showTotal, Context context) throws org.apache.solr.client.solrj.SolrServerException, IOException
Query used to get values grouped by the date.- Parameters:
query- the query to be usedfilterQuery- filter querymax- the max number of values given back (in case of 10 the top 10 will be given)dateType- the type to be used (example: DAY, MONTH, YEAR)dateStart- the start date Format:(-3, -2, ..) the date is calculated relatively on todaydateEnd- the end date stop Format (-2, +1, ..) the date is calculated relatively on todayshowTotal- a boolean determining whether the total amount should be given back as the last element of the arraycontext- The relevant DSpace Context.- Returns:
- and array containing our results
- Throws:
org.apache.solr.client.solrj.SolrServerException- Exception from the Solr server to the solrj Java client.IOException- passed through.
-
queryFacetQuery
Map<String,Integer> queryFacetQuery(String query, String filterQuery, List<String> facetQueries) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
queryTotal
ObjectCount queryTotal(String query, String filterQuery) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
query
org.apache.solr.client.solrj.response.QueryResponse query(String query, String filterQuery, String facetField, int rows, int max, String dateType, String dateStart, String dateEnd, List<String> facetQueries, String sort, boolean ascending) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
getIgnoreSpiderIPs
String getIgnoreSpiderIPs()
Returns in a filterQuery string all the ip addresses that should be ignored- Returns:
- a string query with ip addresses
-
optimizeSOLR
void optimizeSOLR()
Maintenance to keep a SOLR index efficient. Note: This might take a long time.
-
shardSolrIndex
void shardSolrIndex() throws IOException, org.apache.solr.client.solrj.SolrServerException- Throws:
IOExceptionorg.apache.solr.client.solrj.SolrServerException
-
reindexBitstreamHits
void reindexBitstreamHits(boolean removeDeletedBitstreams) throws Exception- Throws:
Exception
-
-