Package org.dspace.app.rest.utils
Class UsageReportUtils
- java.lang.Object
-
- org.dspace.app.rest.utils.UsageReportUtils
-
@Component public class UsageReportUtils extends Object
This is the Service dealing with theUsageReportRestlogic- Author:
- Maria Verdonck (Atmire) on 08/06/2020
-
-
Field Summary
Fields Modifier and Type Field Description static StringTOP_CITIES_REPORT_IDstatic StringTOP_COUNTRIES_REPORT_IDstatic StringTOTAL_DOWNLOADS_REPORT_IDstatic StringTOTAL_VISITS_PER_MONTH_REPORT_IDstatic StringTOTAL_VISITS_REPORT_ID
-
Constructor Summary
Constructors Constructor Description UsageReportUtils()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UsageReportRestcreateUsageReport(Context context, DSpaceObject dso, String reportId)Creates the stat different stat usage report based on the report id.List<UsageReportRest>getUsageReportsOfDSO(Context context, DSpaceObject dso)Get list of usage reports that are applicable to the DSO (of given UUID)
-
-
-
Field Detail
-
TOTAL_VISITS_REPORT_ID
public static final String TOTAL_VISITS_REPORT_ID
- See Also:
- Constant Field Values
-
TOTAL_VISITS_PER_MONTH_REPORT_ID
public static final String TOTAL_VISITS_PER_MONTH_REPORT_ID
- See Also:
- Constant Field Values
-
TOTAL_DOWNLOADS_REPORT_ID
public static final String TOTAL_DOWNLOADS_REPORT_ID
- See Also:
- Constant Field Values
-
TOP_COUNTRIES_REPORT_ID
public static final String TOP_COUNTRIES_REPORT_ID
- See Also:
- Constant Field Values
-
TOP_CITIES_REPORT_ID
public static final String TOP_CITIES_REPORT_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getUsageReportsOfDSO
public List<UsageReportRest> getUsageReportsOfDSO(Context context, DSpaceObject dso) throws SQLException, ParseException, org.apache.solr.client.solrj.SolrServerException, IOException
Get list of usage reports that are applicable to the DSO (of given UUID)- Parameters:
context- DSpace contextdso- DSpaceObject we want all available usage reports of- Returns:
- List of usage reports, applicable to the given DSO
- Throws:
SQLExceptionParseExceptionorg.apache.solr.client.solrj.SolrServerExceptionIOException
-
createUsageReport
public UsageReportRest createUsageReport(Context context, DSpaceObject dso, String reportId) throws ParseException, org.apache.solr.client.solrj.SolrServerException, IOException
Creates the stat different stat usage report based on the report id. If the report id or the object uuid is invalid, an exception is thrown.- Parameters:
context- DSpace contextdso- DSpace object we want a stat usage report onreportId- Type of usage report requested- Returns:
- Rest object containing the stat usage report, see
UsageReportRest - Throws:
ParseExceptionorg.apache.solr.client.solrj.SolrServerExceptionIOException
-
-