
org.dspace.statistics.service.SolrLoggerService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dspace-api Show documentation
Show all versions of dspace-api Show documentation
DSpace core data model and service APIs.
The newest version!
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.statistics.service;
import java.io.IOException;
import java.net.UnknownHostException;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import jakarta.servlet.http.HttpServletRequest;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrInputDocument;
import org.dspace.content.DSpaceObject;
import org.dspace.core.Context;
import org.dspace.eperson.EPerson;
import org.dspace.statistics.ObjectCount;
import org.dspace.usage.UsageWorkflowEvent;
/**
* Static 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
* @author kevinvandevelde at atmire.com
* @author mdiggory at atmire.com
*/
public interface SolrLoggerService {
/**
* Old post method, use the new {@link #postView} method instead !
*
* @param dspaceObject the object used.
* @param request the current request context.
* @param currentUser the current session's user.
* @deprecated
*/
@Deprecated
public void post(DSpaceObject dspaceObject, HttpServletRequest request,
EPerson currentUser);
/**
* Store a usage event into Solr.
*
* @param dspaceObject the object used.
* @param request the current request context.
* @param currentUser the current session's user.
*/
public void postView(DSpaceObject dspaceObject, HttpServletRequest request,
EPerson currentUser);
/**
* Store a usage event into Solr.
*
* @param dspaceObject the object used.
* @param request the current request context.
* @param currentUser the current session's user.
* @param referrer the optional referrer.
*/
public void postView(DSpaceObject dspaceObject, HttpServletRequest request,
EPerson currentUser, String referrer);
public void postView(DSpaceObject dspaceObject,
String ip, String userAgent, String xforwardedfor, EPerson currentUser);
public void postView(DSpaceObject dspaceObject,
String ip, String userAgent, String xforwardedfor, EPerson currentUser, String referrer);
public void postSearch(DSpaceObject resultObject, HttpServletRequest request, EPerson currentUser,
List queries, int rpp, String sortBy, String order, int page, DSpaceObject scope);
public void postWorkflow(UsageWorkflowEvent usageWorkflowEvent) throws SQLException;
/**
* Method 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.
*
*
* @param doc1 the current SolrInputDocument
* @param dso the current dspace object we want to log
* @throws SQLException if database error
* ignore it
*/
public void storeParents(SolrInputDocument doc1, DSpaceObject dso)
throws SQLException;
public boolean isUseProxies();
/**
* Delete data from the index, as described by a query.
*
* @param query description of the records to be deleted.
* @throws IOException A general class of exceptions produced by failed or interrupted I/O operations.
* @throws SolrServerException Exception from the Solr server to the solrj Java client.
*/
public void removeIndex(String query)
throws IOException, SolrServerException;
public Map> queryField(String query,
List oldFieldVals, String field)
throws IOException;
/**
* Scan the entire 'statistics' collection for documents that should be
* marked 'isBot:true' according to
* {@link org.dspace.statistics.util.SpiderDetector#isSpider(java.lang.String,
* java.lang.String, java.lang.String, java.lang.String)}.
*/
public void markRobots();
/**
* Delete all 'statistics' documents having 'isBot:true'.
*/
public void deleteRobots();
/*
* update(String query, boolean addField, String fieldName, Object
* fieldValue, Object oldFieldValue) throws SolrServerException, IOException
* { List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy