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 ObjectanonymizeIp(String ip)Anonymize a given ipvoidcommit()Commit the solr core.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()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, String ip, String userAgent, String xforwardedfor, EPerson currentUser, String referrer)voidpostView(DSpaceObject dspaceObject, javax.servlet.http.HttpServletRequest request, EPerson currentUser)Store a usage event into Solr.voidpostView(DSpaceObject dspaceObject, javax.servlet.http.HttpServletRequest request, EPerson currentUser, String referrer)Store a usage event into Solr.voidpostWorkflow(UsageWorkflowEvent usageWorkflowEvent)voidquery(String query, int max, int facetMinCount)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, int facetMinCount)Perform a solr query.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, int facetMinCount, boolean defaultFilterQueries)Perform a solr query.ObjectCount[]queryFacetDate(String query, String filterQuery, int max, String dateType, String dateStart, String dateEnd, boolean showTotal, Context context, int facetMinCount)Query used to get values grouped by the date.ObjectCount[]queryFacetField(String query, String filterQuery, String facetField, int max, boolean showTotal, List<String> facetQueries, int facetMinCount)Query used to get values grouped by the given facet field.Map<String,Integer>queryFacetQuery(String query, String filterQuery, List<String> facetQueries, int facetMinCount)Map<String,List<String>>queryField(String query, List oldFieldVals, String field)ObjectCountqueryTotal(String query, String filterQuery, int facetMinCount)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)voidupdate(String query, String action, List<String> fieldNames, List<List<Object>> fieldValuesList, boolean commit)Update the solr core.
-
-
-
Method Detail
-
post
@Deprecated void post(DSpaceObject dspaceObject, javax.servlet.http.HttpServletRequest request, EPerson currentUser)
Deprecated.Old post method, use the newpostView(org.dspace.content.DSpaceObject, javax.servlet.http.HttpServletRequest, org.dspace.eperson.EPerson)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, javax.servlet.http.HttpServletRequest request, EPerson currentUser, String referrer)
Store a usage event into Solr.- Parameters:
dspaceObject- the object used.request- the current request context.currentUser- the current session's user.referrer- the optional referrer.
-
postView
void postView(DSpaceObject dspaceObject, String ip, String userAgent, String xforwardedfor, EPerson currentUser)
-
postView
void postView(DSpaceObject dspaceObject, String ip, String userAgent, String xforwardedfor, EPerson currentUser, String referrer)
-
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
-
update
void update(String query, String action, List<String> fieldNames, List<List<Object>> fieldValuesList, boolean commit) throws org.apache.solr.client.solrj.SolrServerException, IOException
Update the solr core.- Parameters:
query- query indicating which documents to updateaction- the update action keywordfieldNames- the fields to updatefieldValuesList- the values for the fields to updatecommit- whether to commit the changes- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
query
void query(String query, int max, int facetMinCount) 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, int facetMinCount) 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 queriesfacetMinCount- Minimum count of results facet must have to return a result- 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, int facetMinCount) 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.facetMinCount- Minimum count of results facet must have to return a result- 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, int facetMinCount) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
queryTotal
ObjectCount queryTotal(String query, String filterQuery, int facetMinCount) 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, int facetMinCount) throws org.apache.solr.client.solrj.SolrServerException, IOException
Perform a solr query.- Parameters:
query- the query to be usedfilterQuery- filter queryfacetField- field to facet the results byrows- the max number of results to returnmax- the max number of facets to returndateType- 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 todayfacetQueries- list of facet queriessort- the sort fieldascending- the sort direction (true: ascending)facetMinCount- Minimum count of results facet must have to return a result- Throws:
org.apache.solr.client.solrj.SolrServerException- Exception from the Solr server to the solrj Java client.IOException- passed through.
-
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, int facetMinCount, boolean defaultFilterQueries) throws org.apache.solr.client.solrj.SolrServerException, IOException
Perform a solr query.- Parameters:
query- the query to be usedfilterQuery- filter queryfacetField- field to facet the results byrows- the max number of results to returnmax- the max number of facets to returndateType- 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 todayfacetQueries- list of facet queriessort- the sort fieldascending- the sort direction (true: ascending)facetMinCount- Minimum count of results facet must have to return a resultdefaultFilterQueries- use the default filter queries- Throws:
org.apache.solr.client.solrj.SolrServerException- Exception from the Solr server to the solrj Java client.IOException- passed through.
-
getIgnoreSpiderIPs
String getIgnoreSpiderIPs()
Returns in a filterQuery string all the ip addresses that should be ignored- Returns:
- a string query with ip addresses
-
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
-
exportHits
void exportHits() throws ExceptionExport all SOLR usage statistics for viewing/downloading content to a flat text file. The file goes to a series- Throws:
Exception- if error
-
commit
void commit() throws IOException, org.apache.solr.client.solrj.SolrServerExceptionCommit the solr core.- Throws:
IOExceptionorg.apache.solr.client.solrj.SolrServerException
-
anonymizeIp
Object anonymizeIp(String ip) throws UnknownHostException
Anonymize a given ip- Parameters:
ip- The ip to anonymize.- Throws:
UnknownHostException
-
-