public class SolrLoggerServiceImpl extends Object implements SolrLoggerService, org.springframework.beans.factory.InitializingBean
| Modifier and Type | Class and Description |
|---|---|
class |
SolrLoggerServiceImpl.ResultProcessor |
static class |
SolrLoggerServiceImpl.StatisticsType |
| Modifier and Type | Field and Description |
|---|---|
protected BitstreamService |
bitstreamService |
protected ContentServiceFactory |
contentServiceFactory |
static String |
DATE_FORMAT_8601 |
static String |
DATE_FORMAT_DCDATE |
protected String |
filterQuery
String of IP and Ranges in IPTable as a Solr Query
|
protected com.maxmind.geoip.LookupService |
locationService |
protected org.apache.solr.client.solrj.impl.HttpSolrServer |
solr |
protected boolean |
useProxies |
| Modifier | Constructor and Description |
|---|---|
protected |
SolrLoggerServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAdditionalSolrYearCores(org.apache.solr.client.solrj.SolrQuery solrQuery) |
protected void |
addDocumentsToFile(Context context,
org.apache.solr.common.SolrDocumentList docs,
File exportOutput) |
void |
afterPropertiesSet() |
protected org.apache.solr.client.solrj.impl.HttpSolrServer |
createCore(org.apache.solr.client.solrj.impl.HttpSolrServer solr,
String coreName) |
void |
deleteIP(String ip) |
void |
deleteRobotsByIP() |
void |
deleteRobotsByIsBotFlag() |
void |
exportHits()
Export all SOLR usage statistics for viewing/downloading content to a flat text file.
|
protected String |
generateURL(String baseURL,
Map<String,String> parameters) |
protected org.apache.solr.common.SolrInputDocument |
getCommonSolrDoc(DSpaceObject dspaceObject,
javax.servlet.http.HttpServletRequest request,
EPerson currentUser)
Returns a solr input document containing common information about the statistics
regardless if we are logging a search or a view of a DSpace object
|
protected org.apache.solr.common.SolrInputDocument |
getCommonSolrDoc(DSpaceObject dspaceObject,
String ip,
String userAgent,
String xforwardedfor,
EPerson currentUser) |
protected String |
getDateView(String name,
String type,
Context context) |
String |
getIgnoreSpiderIPs()
Returns in a filterQuery string all the ip addresses that should be ignored
|
boolean |
isUseProxies() |
void |
markRobotByUserAgent(String agent) |
void |
markRobotsByIP() |
void |
optimizeSOLR()
Maintenance to keep a SOLR index efficient.
|
void |
post(DSpaceObject dspaceObject,
javax.servlet.http.HttpServletRequest request,
EPerson currentUser)
Old post method, use the new postview method instead !
|
void |
postSearch(DSpaceObject resultObject,
javax.servlet.http.HttpServletRequest request,
EPerson currentUser,
List<String> queries,
int rpp,
String sortBy,
String order,
int page,
DSpaceObject scope) |
void |
postView(DSpaceObject dspaceObject,
javax.servlet.http.HttpServletRequest request,
EPerson currentUser)
Store a usage event into Solr.
|
void |
postView(DSpaceObject dspaceObject,
String ip,
String userAgent,
String xforwardedfor,
EPerson currentUser) |
void |
postWorkflow(UsageWorkflowEvent usageWorkflowEvent) |
void |
query(String query,
int max) |
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) |
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) |
ObjectCount |
queryTotal(String query,
String filterQuery) |
void |
reindexBitstreamHits(boolean removeDeletedBitstreams) |
void |
removeIndex(String query)
Delete data from the index, as described by a query.
|
void |
shardSolrIndex() |
void |
storeParents(org.apache.solr.common.SolrInputDocument doc1,
DSpaceObject dso)
Method just used to log the parents.
|
void |
update(String query,
String action,
List<String> fieldNames,
List<List<Object>> fieldValuesList) |
protected org.apache.solr.client.solrj.impl.HttpSolrServer solr
public static final String DATE_FORMAT_8601
public static final String DATE_FORMAT_DCDATE
protected com.maxmind.geoip.LookupService locationService
protected boolean useProxies
@Autowired(required=true) protected BitstreamService bitstreamService
@Autowired(required=true) protected ContentServiceFactory contentServiceFactory
protected String filterQuery
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic void post(DSpaceObject dspaceObject, javax.servlet.http.HttpServletRequest request, EPerson currentUser)
SolrLoggerServicepost in interface SolrLoggerServicedspaceObject - the object used.request - the current request context.currentUser - the current session's user.public void postView(DSpaceObject dspaceObject, javax.servlet.http.HttpServletRequest request, EPerson currentUser)
SolrLoggerServicepostView in interface SolrLoggerServicedspaceObject - the object used.request - the current request context.currentUser - the current session's user.public void postView(DSpaceObject dspaceObject, String ip, String userAgent, String xforwardedfor, EPerson currentUser)
postView in interface SolrLoggerServiceprotected org.apache.solr.common.SolrInputDocument getCommonSolrDoc(DSpaceObject dspaceObject, javax.servlet.http.HttpServletRequest request, EPerson currentUser) throws SQLException
dspaceObject - the object used.request - the current request context.currentUser - the current session's user.SQLException - in case of a database exceptionprotected org.apache.solr.common.SolrInputDocument getCommonSolrDoc(DSpaceObject dspaceObject, String ip, String userAgent, String xforwardedfor, EPerson currentUser) throws SQLException
SQLExceptionpublic void postSearch(DSpaceObject resultObject, javax.servlet.http.HttpServletRequest request, EPerson currentUser, List<String> queries, int rpp, String sortBy, String order, int page, DSpaceObject scope)
postSearch in interface SolrLoggerServicepublic void postWorkflow(UsageWorkflowEvent usageWorkflowEvent) throws SQLException
postWorkflow in interface SolrLoggerServiceSQLExceptionpublic void storeParents(org.apache.solr.common.SolrInputDocument doc1,
DSpaceObject dso)
throws SQLException
SolrLoggerServicestoreParents in interface SolrLoggerServicedoc1 - the current SolrInputDocumentdso - the current dspace object we want to logSQLException - ignore itpublic boolean isUseProxies()
isUseProxies in interface SolrLoggerServicepublic void removeIndex(String query) throws IOException, org.apache.solr.client.solrj.SolrServerException
SolrLoggerServiceremoveIndex in interface SolrLoggerServicequery - description of the records to be deleted.IOExceptionorg.apache.solr.client.solrj.SolrServerExceptionpublic Map<String,List<String>> queryField(String query, List oldFieldVals, String field)
queryField in interface SolrLoggerServicepublic void markRobotsByIP()
markRobotsByIP in interface SolrLoggerServicepublic void markRobotByUserAgent(String agent)
markRobotByUserAgent in interface SolrLoggerServicepublic void deleteRobotsByIsBotFlag()
deleteRobotsByIsBotFlag in interface SolrLoggerServicepublic void deleteIP(String ip)
deleteIP in interface SolrLoggerServicepublic void deleteRobotsByIP()
deleteRobotsByIP in interface SolrLoggerServicepublic void update(String query, String action, List<String> fieldNames, List<List<Object>> fieldValuesList) throws org.apache.solr.client.solrj.SolrServerException, IOException
update in interface SolrLoggerServiceorg.apache.solr.client.solrj.SolrServerExceptionIOExceptionpublic void query(String query, int max) throws org.apache.solr.client.solrj.SolrServerException
query in interface SolrLoggerServiceorg.apache.solr.client.solrj.SolrServerExceptionpublic ObjectCount[] queryFacetField(String query, String filterQuery, String facetField, int max, boolean showTotal, List<String> facetQueries) throws org.apache.solr.client.solrj.SolrServerException
SolrLoggerServicequeryFacetField in interface SolrLoggerServicequery - the query to be usedfacetField - 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 arrayorg.apache.solr.client.solrj.SolrServerException - ...public 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
SolrLoggerServicequeryFacetDate in interface SolrLoggerServicequery - the query to be usedmax - 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 arrayorg.apache.solr.client.solrj.SolrServerException - ...public Map<String,Integer> queryFacetQuery(String query, String filterQuery, List<String> facetQueries) throws org.apache.solr.client.solrj.SolrServerException
queryFacetQuery in interface SolrLoggerServiceorg.apache.solr.client.solrj.SolrServerExceptionpublic ObjectCount queryTotal(String query, String filterQuery) throws org.apache.solr.client.solrj.SolrServerException
queryTotal in interface SolrLoggerServiceorg.apache.solr.client.solrj.SolrServerExceptionpublic 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
query in interface SolrLoggerServiceorg.apache.solr.client.solrj.SolrServerExceptionpublic String getIgnoreSpiderIPs()
SolrLoggerServicegetIgnoreSpiderIPs in interface SolrLoggerServicepublic void optimizeSOLR()
SolrLoggerServiceoptimizeSOLR in interface SolrLoggerServicepublic void shardSolrIndex()
throws IOException,
org.apache.solr.client.solrj.SolrServerException
shardSolrIndex in interface SolrLoggerServiceIOExceptionorg.apache.solr.client.solrj.SolrServerExceptionprotected org.apache.solr.client.solrj.impl.HttpSolrServer createCore(org.apache.solr.client.solrj.impl.HttpSolrServer solr,
String coreName)
throws IOException,
org.apache.solr.client.solrj.SolrServerException
IOExceptionorg.apache.solr.client.solrj.SolrServerExceptionpublic void reindexBitstreamHits(boolean removeDeletedBitstreams)
throws Exception
reindexBitstreamHits in interface SolrLoggerServiceExceptionpublic void exportHits()
throws Exception
SolrLoggerServiceexportHits in interface SolrLoggerServiceExceptionprotected void addDocumentsToFile(Context context, org.apache.solr.common.SolrDocumentList docs, File exportOutput) throws SQLException, ParseException, IOException
SQLExceptionParseExceptionIOExceptionprotected String generateURL(String baseURL, Map<String,String> parameters) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected void addAdditionalSolrYearCores(org.apache.solr.client.solrj.SolrQuery solrQuery)
Copyright © 2016 DuraSpace. All Rights Reserved.