Code redesign
Refs #11756: Refactor DataHArvesterPlugin to support scheduled execution from smart-executor Task-Url: https://support.d4science.org/issues/11756 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-dashboard-harvester-se-plugin@167598 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
2cb0d8b15f
commit
d5cdc30748
|
@ -12,7 +12,7 @@ import java.util.SortedSet;
|
||||||
import org.gcube.dataharvest.dao.DatabaseManager;
|
import org.gcube.dataharvest.dao.DatabaseManager;
|
||||||
import org.gcube.dataharvest.datamodel.HarvestedData;
|
import org.gcube.dataharvest.datamodel.HarvestedData;
|
||||||
import org.gcube.dataharvest.harvester.SocialHarvester;
|
import org.gcube.dataharvest.harvester.SocialHarvester;
|
||||||
import org.gcube.dataharvest.harvester.VreUsersHarvester;
|
import org.gcube.dataharvest.harvester.VREUsersHarvester;
|
||||||
import org.gcube.dataharvest.harvester.sobigdata.DataMethodDownloadHarvester;
|
import org.gcube.dataharvest.harvester.sobigdata.DataMethodDownloadHarvester;
|
||||||
import org.gcube.dataharvest.harvester.sobigdata.MethodInvocationHarvester;
|
import org.gcube.dataharvest.harvester.sobigdata.MethodInvocationHarvester;
|
||||||
import org.gcube.dataharvest.harvester.sobigdata.ResourceCatalogueHarvester;
|
import org.gcube.dataharvest.harvester.sobigdata.ResourceCatalogueHarvester;
|
||||||
|
@ -147,7 +147,7 @@ public class AccountingDataHarvesterPlugin extends Plugin<DataHarvestPluginDecla
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Collecting info on VRE users
|
// Collecting info on VRE users
|
||||||
VreUsersHarvester vreUsersHarvester = new VreUsersHarvester(start, end);
|
VREUsersHarvester vreUsersHarvester = new VREUsersHarvester(start, end);
|
||||||
List<HarvestedData> harvested = vreUsersHarvester.getData();
|
List<HarvestedData> harvested = vreUsersHarvester.getData();
|
||||||
data.addAll(harvested);
|
data.addAll(harvested);
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
|
|
|
@ -18,11 +18,11 @@ import org.slf4j.LoggerFactory;
|
||||||
* @author Eric Perrone (ISTI - CNR)
|
* @author Eric Perrone (ISTI - CNR)
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
public class VreUsersHarvester extends BasicHarvester {
|
public class VREUsersHarvester extends BasicHarvester {
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(VreUsersHarvester.class);
|
private static Logger logger = LoggerFactory.getLogger(VREUsersHarvester.class);
|
||||||
|
|
||||||
public VreUsersHarvester(Date start, Date end) throws ParseException {
|
public VREUsersHarvester(Date start, Date end) throws ParseException {
|
||||||
super(start, end);
|
super(start, end);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ import org.gcube.dataharvest.dao.DatabaseParameterRetriever;
|
||||||
import org.gcube.dataharvest.datamodel.HarvestedData;
|
import org.gcube.dataharvest.datamodel.HarvestedData;
|
||||||
import org.gcube.dataharvest.harvester.BasicHarvester;
|
import org.gcube.dataharvest.harvester.BasicHarvester;
|
||||||
import org.gcube.dataharvest.harvester.SocialHarvester;
|
import org.gcube.dataharvest.harvester.SocialHarvester;
|
||||||
import org.gcube.dataharvest.harvester.VreUsersHarvester;
|
import org.gcube.dataharvest.harvester.VREUsersHarvester;
|
||||||
import org.gcube.dataharvest.harvester.sobigdata.DataMethodDownloadHarvester;
|
import org.gcube.dataharvest.harvester.sobigdata.DataMethodDownloadHarvester;
|
||||||
import org.gcube.dataharvest.harvester.sobigdata.MethodInvocationHarvester;
|
import org.gcube.dataharvest.harvester.sobigdata.MethodInvocationHarvester;
|
||||||
import org.gcube.dataharvest.harvester.sobigdata.ResourceCatalogueHarvester;
|
import org.gcube.dataharvest.harvester.sobigdata.ResourceCatalogueHarvester;
|
||||||
|
@ -88,7 +88,7 @@ public class Harvester {
|
||||||
public void runAll() {
|
public void runAll() {
|
||||||
try {
|
try {
|
||||||
// collecting info on VRE users
|
// collecting info on VRE users
|
||||||
VreUsersHarvester vreUsersHarvester = new VreUsersHarvester(dateFrom, dateTo);
|
VREUsersHarvester vreUsersHarvester = new VREUsersHarvester(dateFrom, dateTo);
|
||||||
List<HarvestedData> users = vreUsersHarvester.getData();
|
List<HarvestedData> users = vreUsersHarvester.getData();
|
||||||
insertMonthlyData((Date) dateFrom, (Date) dateTo, users);
|
insertMonthlyData((Date) dateFrom, (Date) dateTo, users);
|
||||||
} catch(Exception x) {
|
} catch(Exception x) {
|
||||||
|
|
Loading…
Reference in New Issue