diff --git a/src/main/java/org/gcube/dataharvest/AccountingDataHarvesterPlugin.java b/src/main/java/org/gcube/dataharvest/AccountingDataHarvesterPlugin.java index 5e73ec9..6f16596 100644 --- a/src/main/java/org/gcube/dataharvest/AccountingDataHarvesterPlugin.java +++ b/src/main/java/org/gcube/dataharvest/AccountingDataHarvesterPlugin.java @@ -39,6 +39,10 @@ public class AccountingDataHarvesterPlugin extends Plugin harvested = resourceCatalogueHarvester.getData(); data.addAll(harvested); @@ -162,22 +166,27 @@ public class AccountingDataHarvesterPlugin extends Plugin harvested = dataMethodDownloadHarvester.getData(); - data.addAll(harvested); - } catch(Exception e) { - logger.error("Error harvesting Data Method Download for {}", context, e); - } - try { - // Collecting info on method invocation - MethodInvocationHarvester methodInvocationHarvester = new MethodInvocationHarvester(start, end); - List harvested = methodInvocationHarvester.getData(); - data.addAll(harvested); - } catch(Exception e) { - logger.error("Error harvesting Method Invocations for {}", context, e); + if(context.startsWith(SOBIGDATA_CONTEXT) || context.startsWith(SOBIGDATA_EU_CONTEXT)) { + try { + // Collecting info on Data/Method download + DataMethodDownloadHarvester dataMethodDownloadHarvester = new DataMethodDownloadHarvester(start, end); + List harvested = dataMethodDownloadHarvester.getData(); + data.addAll(harvested); + } catch(Exception e) { + logger.error("Error harvesting Data Method Download for {}", context, e); + } + + if(context.startsWith(TAGME_CONTEXT)) { + try { + // Collecting info on method invocation + MethodInvocationHarvester methodInvocationHarvester = new MethodInvocationHarvester(start, end); + List harvested = methodInvocationHarvester.getData(); + data.addAll(harvested); + } catch(Exception e) { + logger.error("Error harvesting Method Invocations for {}", context, e); + } + } } }