Fixed Plugin Name
This commit is contained in:
parent
095429432a
commit
9f6b745c4d
116
pom.xml
116
pom.xml
|
@ -12,9 +12,9 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.gcube.accounting</groupId>
|
<groupId>org.gcube.accounting</groupId>
|
||||||
<artifactId>accounting-dashboard-harvester-se-plugin</artifactId>
|
<artifactId>accounting-dashboard-harvester-se-plugin</artifactId>
|
||||||
<version>1.3.0</version>
|
<version>1.4.0</version>
|
||||||
<name>Accounting Dashboard Harvester SmartExecutor Plugin</name>
|
<name>Accounting Dashboard Harvester Smart Executor Plugin</name>
|
||||||
<description>Accounting Dashboard Harvester SmartExecutor Plugin</description>
|
<description>Accounting Dashboard Harvester Smart Executor Plugin</description>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</connection>
|
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</connection>
|
||||||
|
@ -31,16 +31,9 @@
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.distribution</groupId>
|
<groupId>org.gcube.vremanagement</groupId>
|
||||||
<artifactId>gcube-bom</artifactId>
|
<artifactId>smart-executor-bom</artifactId>
|
||||||
<version>LATEST</version>
|
<version>1.0.0</version>
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.distribution</groupId>
|
|
||||||
<artifactId>gcube-smartgears-bom</artifactId>
|
|
||||||
<version>LATEST</version>
|
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -48,39 +41,11 @@
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.vremanagement</groupId>
|
|
||||||
<artifactId>smart-executor-api</artifactId>
|
|
||||||
<version>[1.5.0, 2.0.0-SNAPSHOT)</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
|
||||||
<artifactId>jackson-databind</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-api</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.vremanagement</groupId>
|
|
||||||
<artifactId>smart-executor-client</artifactId>
|
|
||||||
<version>[1.3.0,2.0.0-SNAPSHOT)</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-lang</groupId>
|
<groupId>commons-lang</groupId>
|
||||||
<artifactId>commons-lang</artifactId>
|
<artifactId>commons-lang</artifactId>
|
||||||
<version>2.6</version>
|
<version>2.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.core</groupId>
|
|
||||||
<artifactId>common-encryption</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portlets.admin</groupId>
|
<groupId>org.gcube.portlets.admin</groupId>
|
||||||
<artifactId>rmp-common-library</artifactId>
|
<artifactId>rmp-common-library</artifactId>
|
||||||
|
@ -96,73 +61,28 @@
|
||||||
<artifactId>google-http-client-gson</artifactId>
|
<artifactId>google-http-client-gson</artifactId>
|
||||||
<version>1.21.0</version>
|
<version>1.21.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>storagehub-client-library</artifactId>
|
<artifactId>storagehub-client-library</artifactId>
|
||||||
<version>[1.0.0, 2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0, 2.0.0-SNAPSHOT)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.data-publishing</groupId>
|
<groupId>org.gcube.data-publishing</groupId>
|
||||||
<artifactId>gcat-client</artifactId>
|
<artifactId>gcat-client</artifactId>
|
||||||
<version>[1.0.0, 2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0, 2.0.0-SNAPSHOT)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Dependencies forced to provided -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>org.gcube.accounting</groupId>
|
||||||
<artifactId>jackson-core</artifactId>
|
<artifactId>accounting-lib</artifactId>
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
|
||||||
<artifactId>jackson-databind</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
|
||||||
<artifactId>jackson-annotations</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.resources</groupId>
|
|
||||||
<artifactId>common-gcore-resources</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.common</groupId>
|
|
||||||
<artifactId>authorization-client</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.common</groupId>
|
|
||||||
<artifactId>common-authorization</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.core</groupId>
|
<groupId>org.gcube.core</groupId>
|
||||||
<artifactId>common-gcore-stubs</artifactId>
|
<artifactId>common-encryption</artifactId>
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.core</groupId>
|
<groupId>org.gcube.vremanagement</groupId>
|
||||||
<artifactId>common-scope-maps</artifactId>
|
<artifactId>smart-executor-api</artifactId>
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- END Dependencies forced to provided -->
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.resources.discovery</groupId>
|
|
||||||
<artifactId>ic-client</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.resources</groupId>
|
|
||||||
<artifactId>registry-publisher</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.accounting</groupId>
|
<groupId>org.gcube.accounting</groupId>
|
||||||
<artifactId>accounting-analytics</artifactId>
|
<artifactId>accounting-analytics</artifactId>
|
||||||
|
@ -173,19 +93,11 @@
|
||||||
<artifactId>accounting-analytics-persistence-couchbase</artifactId>
|
<artifactId>accounting-analytics-persistence-couchbase</artifactId>
|
||||||
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.accounting</groupId>
|
|
||||||
<artifactId>accounting-lib</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.accounting</groupId>
|
<groupId>org.gcube.accounting</groupId>
|
||||||
<artifactId>accounting-summary-access</artifactId>
|
<artifactId>accounting-summary-access</artifactId>
|
||||||
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.json</groupId>
|
<groupId>org.json</groupId>
|
||||||
<artifactId>json</artifactId>
|
<artifactId>json</artifactId>
|
||||||
|
@ -194,6 +106,11 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Test Dependencies -->
|
<!-- Test Dependencies -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.vremanagement</groupId>
|
||||||
|
<artifactId>smart-executor-client</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
|
@ -203,7 +120,6 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>ch.qos.logback</groupId>
|
<groupId>ch.qos.logback</groupId>
|
||||||
<artifactId>logback-classic</artifactId>
|
<artifactId>logback-classic</artifactId>
|
||||||
<version>1.0.13</version>
|
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -38,9 +38,9 @@ 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 AccountingDataHarvesterPlugin extends Plugin<DataHarvestPluginDeclaration> {
|
public class AccountingDashboardHarvesterPlugin extends Plugin<AccountingDashboardHarvesterPluginDeclaration> {
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(AccountingDataHarvesterPlugin.class);
|
private static Logger logger = LoggerFactory.getLogger(AccountingDashboardHarvesterPlugin.class);
|
||||||
|
|
||||||
private static final String PROPERTY_FILENAME = "config.properties";
|
private static final String PROPERTY_FILENAME = "config.properties";
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ public class AccountingDataHarvesterPlugin extends Plugin<DataHarvestPluginDecla
|
||||||
protected Date start;
|
protected Date start;
|
||||||
protected Date end;
|
protected Date end;
|
||||||
|
|
||||||
public AccountingDataHarvesterPlugin(DataHarvestPluginDeclaration pluginDeclaration) {
|
public AccountingDashboardHarvesterPlugin(AccountingDashboardHarvesterPluginDeclaration pluginDeclaration) {
|
||||||
super(pluginDeclaration);
|
super(pluginDeclaration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ public class AccountingDataHarvesterPlugin extends Plugin<DataHarvestPluginDecla
|
||||||
public Properties getConfigParameters() throws IOException {
|
public Properties getConfigParameters() throws IOException {
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
try {
|
try {
|
||||||
InputStream input = AccountingDataHarvesterPlugin.class.getClassLoader()
|
InputStream input = AccountingDashboardHarvesterPlugin.class.getClassLoader()
|
||||||
.getResourceAsStream(PROPERTY_FILENAME);
|
.getResourceAsStream(PROPERTY_FILENAME);
|
||||||
properties.load(input);
|
properties.load(input);
|
||||||
return properties;
|
return properties;
|
|
@ -12,18 +12,18 @@ 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 DataHarvestPluginDeclaration implements PluginDeclaration {
|
public class AccountingDashboardHarvesterPluginDeclaration implements PluginDeclaration {
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(DataHarvestPluginDeclaration.class);
|
private static Logger logger = LoggerFactory.getLogger(AccountingDashboardHarvesterPluginDeclaration.class);
|
||||||
|
|
||||||
public static final String NAME = "AccountingDataHarvester";
|
public static final String NAME = "AccountingDashboardHarvester";
|
||||||
public static final String DESCRIPTION = "Data Harvest for Accounting Summary Dashboard";
|
public static final String DESCRIPTION = "Data Harvester for Accounting Dashboard";
|
||||||
public static final String VERSION = "1.0.0";
|
public static final String VERSION = "1.4.0";
|
||||||
|
|
||||||
/**{@inheritDoc}*/
|
/**{@inheritDoc}*/
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
logger.debug(String.format("%s initialized", AccountingDataHarvesterPlugin.class.getSimpleName()));
|
logger.debug(String.format("%s initialized", AccountingDashboardHarvesterPlugin.class.getSimpleName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**{@inheritDoc}*/
|
/**{@inheritDoc}*/
|
||||||
|
@ -48,14 +48,13 @@ public class DataHarvestPluginDeclaration implements PluginDeclaration {
|
||||||
@Override
|
@Override
|
||||||
public Map<String, String> getSupportedCapabilities() {
|
public Map<String, String> getSupportedCapabilities() {
|
||||||
Map<String, String> discoveredCapabilities = new HashMap<String, String>();
|
Map<String, String> discoveredCapabilities = new HashMap<String, String>();
|
||||||
discoveredCapabilities.put("FakeKey", "FakeValue");
|
|
||||||
return discoveredCapabilities;
|
return discoveredCapabilities;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**{@inheritDoc}*/
|
/**{@inheritDoc}*/
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends Plugin<? extends PluginDeclaration>> getPluginImplementation() {
|
public Class<? extends Plugin<? extends PluginDeclaration>> getPluginImplementation() {
|
||||||
return AccountingDataHarvesterPlugin.class;
|
return AccountingDashboardHarvesterPlugin.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
|
@ -12,7 +12,7 @@ import org.gcube.common.authorization.client.Constants;
|
||||||
import org.gcube.common.authorization.library.AuthorizationEntry;
|
import org.gcube.common.authorization.library.AuthorizationEntry;
|
||||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.gcube.dataharvest.AccountingDataHarvesterPlugin;
|
import org.gcube.dataharvest.AccountingDashboardHarvesterPlugin;
|
||||||
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
||||||
import org.gcube.dataharvest.utils.DateUtils;
|
import org.gcube.dataharvest.utils.DateUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -57,7 +57,7 @@ public abstract class BasicHarvester {
|
||||||
public abstract List<AccountingRecord> getAccountingRecords() throws Exception;
|
public abstract List<AccountingRecord> getAccountingRecords() throws Exception;
|
||||||
|
|
||||||
public Dimension getDimension(HarvestedDataKey harvestedDataKey) {
|
public Dimension getDimension(HarvestedDataKey harvestedDataKey) {
|
||||||
return AccountingDataHarvesterPlugin.getDimension(harvestedDataKey.getKey());
|
return AccountingDashboardHarvesterPlugin.getDimension(harvestedDataKey.getKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.gcube.accounting.datamodel.AggregatedUsageRecord;
|
||||||
import org.gcube.accounting.datamodel.aggregation.AggregatedJobUsageRecord;
|
import org.gcube.accounting.datamodel.aggregation.AggregatedJobUsageRecord;
|
||||||
import org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord;
|
import org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord;
|
||||||
import org.gcube.accounting.datamodel.usagerecords.ServiceUsageRecord;
|
import org.gcube.accounting.datamodel.usagerecords.ServiceUsageRecord;
|
||||||
import org.gcube.dataharvest.AccountingDataHarvesterPlugin;
|
import org.gcube.dataharvest.AccountingDashboardHarvesterPlugin;
|
||||||
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
||||||
import org.gcube.dataharvest.utils.DateUtils;
|
import org.gcube.dataharvest.utils.DateUtils;
|
||||||
import org.gcube.dataharvest.utils.Utils;
|
import org.gcube.dataharvest.utils.Utils;
|
||||||
|
@ -72,7 +72,7 @@ public class MethodInvocationHarvester extends BasicHarvester {
|
||||||
AggregatedServiceUsageRecord.class, temporalConstraint, filters, contexts, true);
|
AggregatedServiceUsageRecord.class, temporalConstraint, filters, contexts, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScopeDescriptor scopeDescriptor = AccountingDataHarvesterPlugin.getScopeDescriptor();
|
ScopeDescriptor scopeDescriptor = AccountingDashboardHarvesterPlugin.getScopeDescriptor();
|
||||||
Dimension dimension = getDimension(HarvestedDataKey.METHOD_INVOCATIONS);
|
Dimension dimension = getDimension(HarvestedDataKey.METHOD_INVOCATIONS);
|
||||||
|
|
||||||
if(result != null) {
|
if(result != null) {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import java.util.List;
|
||||||
|
|
||||||
import org.gcube.accounting.accounting.summary.access.model.ScopeDescriptor;
|
import org.gcube.accounting.accounting.summary.access.model.ScopeDescriptor;
|
||||||
import org.gcube.accounting.accounting.summary.access.model.update.AccountingRecord;
|
import org.gcube.accounting.accounting.summary.access.model.update.AccountingRecord;
|
||||||
import org.gcube.dataharvest.AccountingDataHarvesterPlugin;
|
import org.gcube.dataharvest.AccountingDashboardHarvesterPlugin;
|
||||||
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
||||||
import org.gcube.dataharvest.utils.Utils;
|
import org.gcube.dataharvest.utils.Utils;
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
|
@ -44,7 +44,7 @@ public class SocialInteractionsHarvester extends SocialNetworkingHarvester {
|
||||||
|
|
||||||
getJson();
|
getJson();
|
||||||
|
|
||||||
ScopeDescriptor scopeDescriptor = AccountingDataHarvesterPlugin.getScopeDescriptor();
|
ScopeDescriptor scopeDescriptor = AccountingDashboardHarvesterPlugin.getScopeDescriptor();
|
||||||
|
|
||||||
AccountingRecord likesAR = new AccountingRecord(scopeDescriptor, instant, getDimension(HarvestedDataKey.SOCIAL_LIKES), (long) likes);
|
AccountingRecord likesAR = new AccountingRecord(scopeDescriptor, instant, getDimension(HarvestedDataKey.SOCIAL_LIKES), (long) likes);
|
||||||
logger.debug("{} : {}", likesAR.getDimension().getId(), likesAR.getMeasure());
|
logger.debug("{} : {}", likesAR.getDimension().getId(), likesAR.getMeasure());
|
||||||
|
|
|
@ -33,7 +33,7 @@ import org.gcube.common.resources.gcore.ServiceEndpoint.Property;
|
||||||
import org.gcube.common.resources.gcore.utils.Group;
|
import org.gcube.common.resources.gcore.utils.Group;
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.gcube.common.scope.impl.ScopeBean;
|
import org.gcube.common.scope.impl.ScopeBean;
|
||||||
import org.gcube.dataharvest.AccountingDataHarvesterPlugin;
|
import org.gcube.dataharvest.AccountingDashboardHarvesterPlugin;
|
||||||
import org.gcube.dataharvest.datamodel.AnalyticsReportCredentials;
|
import org.gcube.dataharvest.datamodel.AnalyticsReportCredentials;
|
||||||
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
||||||
import org.gcube.dataharvest.datamodel.VREAccessesReportRow;
|
import org.gcube.dataharvest.datamodel.VREAccessesReportRow;
|
||||||
|
@ -109,7 +109,7 @@ public class VREAccessesHarvester extends BasicHarvester {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ScopeDescriptor scopeDescriptor = AccountingDataHarvesterPlugin.getScopeDescriptor();
|
ScopeDescriptor scopeDescriptor = AccountingDashboardHarvesterPlugin.getScopeDescriptor();
|
||||||
|
|
||||||
AccountingRecord ar = new AccountingRecord(scopeDescriptor, instant, getDimension(HarvestedDataKey.ACCESSES), (long) measure);
|
AccountingRecord ar = new AccountingRecord(scopeDescriptor, instant, getDimension(HarvestedDataKey.ACCESSES), (long) measure);
|
||||||
logger.debug("{} : {}", ar.getDimension().getId(), ar.getMeasure());
|
logger.debug("{} : {}", ar.getDimension().getId(), ar.getMeasure());
|
||||||
|
|
|
@ -7,7 +7,7 @@ import java.util.List;
|
||||||
|
|
||||||
import org.gcube.accounting.accounting.summary.access.model.ScopeDescriptor;
|
import org.gcube.accounting.accounting.summary.access.model.ScopeDescriptor;
|
||||||
import org.gcube.accounting.accounting.summary.access.model.update.AccountingRecord;
|
import org.gcube.accounting.accounting.summary.access.model.update.AccountingRecord;
|
||||||
import org.gcube.dataharvest.AccountingDataHarvesterPlugin;
|
import org.gcube.dataharvest.AccountingDashboardHarvesterPlugin;
|
||||||
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -36,7 +36,7 @@ public class VREUsersHarvester extends SocialNetworkingHarvester {
|
||||||
|
|
||||||
ArrayList<AccountingRecord> accountingRecords = new ArrayList<AccountingRecord>();
|
ArrayList<AccountingRecord> accountingRecords = new ArrayList<AccountingRecord>();
|
||||||
|
|
||||||
ScopeDescriptor scopeDescriptor = AccountingDataHarvesterPlugin.getScopeDescriptor();
|
ScopeDescriptor scopeDescriptor = AccountingDashboardHarvesterPlugin.getScopeDescriptor();
|
||||||
|
|
||||||
AccountingRecord ar = new AccountingRecord(scopeDescriptor, instant, getDimension(HarvestedDataKey.USERS), (long) measure);
|
AccountingRecord ar = new AccountingRecord(scopeDescriptor, instant, getDimension(HarvestedDataKey.USERS), (long) measure);
|
||||||
logger.debug("{} : {}", ar.getDimension().getId(), ar.getMeasure());
|
logger.debug("{} : {}", ar.getDimension().getId(), ar.getMeasure());
|
||||||
|
|
|
@ -18,7 +18,7 @@ import org.gcube.common.storagehub.model.items.FolderItem;
|
||||||
import org.gcube.common.storagehub.model.items.Item;
|
import org.gcube.common.storagehub.model.items.Item;
|
||||||
import org.gcube.common.storagehub.model.items.nodes.Accounting;
|
import org.gcube.common.storagehub.model.items.nodes.Accounting;
|
||||||
import org.gcube.common.storagehub.model.items.nodes.accounting.AccountEntry;
|
import org.gcube.common.storagehub.model.items.nodes.accounting.AccountEntry;
|
||||||
import org.gcube.dataharvest.AccountingDataHarvesterPlugin;
|
import org.gcube.dataharvest.AccountingDashboardHarvesterPlugin;
|
||||||
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
||||||
import org.gcube.dataharvest.utils.DateUtils;
|
import org.gcube.dataharvest.utils.DateUtils;
|
||||||
import org.gcube.dataharvest.utils.Utils;
|
import org.gcube.dataharvest.utils.Utils;
|
||||||
|
@ -87,7 +87,7 @@ public class DataMethodDownloadHarvester extends SoBigDataHarvester {
|
||||||
DateUtils.format(start), DateUtils.format(end), vreFolderItem.getName());
|
DateUtils.format(start), DateUtils.format(end), vreFolderItem.getName());
|
||||||
|
|
||||||
|
|
||||||
ScopeDescriptor defaultScopeDescriptor = AccountingDataHarvesterPlugin.getScopeDescriptor();
|
ScopeDescriptor defaultScopeDescriptor = AccountingDashboardHarvesterPlugin.getScopeDescriptor();
|
||||||
|
|
||||||
|
|
||||||
AccountingRecord defaultHarvesteData = new AccountingRecord(defaultScopeDescriptor, instant, getDimension(HarvestedDataKey.DATA_METHOD_DOWNLOAD), (long) count);
|
AccountingRecord defaultHarvesteData = new AccountingRecord(defaultScopeDescriptor, instant, getDimension(HarvestedDataKey.DATA_METHOD_DOWNLOAD), (long) count);
|
||||||
|
@ -116,7 +116,7 @@ public class DataMethodDownloadHarvester extends SoBigDataHarvester {
|
||||||
if(context != null && !context.isEmpty()) {
|
if(context != null && !context.isEmpty()) {
|
||||||
logger.debug("Found context '{}' matching with normalized VRE name {} ", context, normalizedName);
|
logger.debug("Found context '{}' matching with normalized VRE name {} ", context, normalizedName);
|
||||||
|
|
||||||
ScopeDescriptor scopeDescriptor = AccountingDataHarvesterPlugin.getScopeDescriptor(context);
|
ScopeDescriptor scopeDescriptor = AccountingDashboardHarvesterPlugin.getScopeDescriptor(context);
|
||||||
AccountingRecord ar = new AccountingRecord(scopeDescriptor, instant, getDimension(HarvestedDataKey.DATA_METHOD_DOWNLOAD), (long) count);
|
AccountingRecord ar = new AccountingRecord(scopeDescriptor, instant, getDimension(HarvestedDataKey.DATA_METHOD_DOWNLOAD), (long) count);
|
||||||
logger.debug("{} : {}", ar.getDimension().getId(), ar.getMeasure());
|
logger.debug("{} : {}", ar.getDimension().getId(), ar.getMeasure());
|
||||||
accountingRecords.add(ar);
|
accountingRecords.add(ar);
|
||||||
|
|
|
@ -12,7 +12,7 @@ import java.util.SortedSet;
|
||||||
import org.gcube.accounting.accounting.summary.access.model.ScopeDescriptor;
|
import org.gcube.accounting.accounting.summary.access.model.ScopeDescriptor;
|
||||||
import org.gcube.accounting.accounting.summary.access.model.internal.Dimension;
|
import org.gcube.accounting.accounting.summary.access.model.internal.Dimension;
|
||||||
import org.gcube.accounting.accounting.summary.access.model.update.AccountingRecord;
|
import org.gcube.accounting.accounting.summary.access.model.update.AccountingRecord;
|
||||||
import org.gcube.dataharvest.AccountingDataHarvesterPlugin;
|
import org.gcube.dataharvest.AccountingDashboardHarvesterPlugin;
|
||||||
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
||||||
import org.gcube.dataharvest.utils.DateUtils;
|
import org.gcube.dataharvest.utils.DateUtils;
|
||||||
import org.gcube.dataharvest.utils.Utils;
|
import org.gcube.dataharvest.utils.Utils;
|
||||||
|
@ -153,7 +153,7 @@ public class ResourceCatalogueHarvester extends SoBigDataHarvester {
|
||||||
|
|
||||||
logger.trace("The context {} has count ", catalogueContext, catalogueContextCount);
|
logger.trace("The context {} has count ", catalogueContext, catalogueContextCount);
|
||||||
|
|
||||||
ScopeDescriptor catalogueScopeDescriptor = AccountingDataHarvesterPlugin.getScopeDescriptor(catalogueContext);
|
ScopeDescriptor catalogueScopeDescriptor = AccountingDashboardHarvesterPlugin.getScopeDescriptor(catalogueContext);
|
||||||
Dimension dimension = getDimension(harvestKey);
|
Dimension dimension = getDimension(harvestKey);
|
||||||
|
|
||||||
AccountingRecord ar = new AccountingRecord(catalogueScopeDescriptor, instant, dimension, (long) catalogueContextCount);
|
AccountingRecord ar = new AccountingRecord(catalogueScopeDescriptor, instant, dimension, (long) catalogueContextCount);
|
||||||
|
@ -161,7 +161,7 @@ public class ResourceCatalogueHarvester extends SoBigDataHarvester {
|
||||||
|
|
||||||
for(String key : counter.keySet()) {
|
for(String key : counter.keySet()) {
|
||||||
logger.trace("The group {} has count {}", key, counter.get(key));
|
logger.trace("The group {} has count {}", key, counter.get(key));
|
||||||
ScopeDescriptor sd = AccountingDataHarvesterPlugin.getScopeDescriptor(mapCatalogueGroupToVRE.get(key));
|
ScopeDescriptor sd = AccountingDashboardHarvesterPlugin.getScopeDescriptor(mapCatalogueGroupToVRE.get(key));
|
||||||
AccountingRecord accountingRecord = new AccountingRecord(sd, instant, dimension, (long) counter.get(key));
|
AccountingRecord accountingRecord = new AccountingRecord(sd, instant, dimension, (long) counter.get(key));
|
||||||
accountingRecords.add(accountingRecord);
|
accountingRecords.add(accountingRecord);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ import java.util.SortedSet;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
|
|
||||||
import org.gcube.common.authorization.client.exceptions.ObjectNotFound;
|
import org.gcube.common.authorization.client.exceptions.ObjectNotFound;
|
||||||
import org.gcube.dataharvest.AccountingDataHarvesterPlugin;
|
import org.gcube.dataharvest.AccountingDashboardHarvesterPlugin;
|
||||||
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
||||||
import org.gcube.dataharvest.harvester.BasicHarvester;
|
import org.gcube.dataharvest.harvester.BasicHarvester;
|
||||||
import org.gcube.dataharvest.utils.Utils;
|
import org.gcube.dataharvest.utils.Utils;
|
||||||
|
@ -78,7 +78,7 @@ public abstract class SoBigDataHarvester extends BasicHarvester {
|
||||||
* @throws ObjectNotFound
|
* @throws ObjectNotFound
|
||||||
*/
|
*/
|
||||||
protected void initMappingMaps() throws ObjectNotFound, Exception {
|
protected void initMappingMaps() throws ObjectNotFound, Exception {
|
||||||
Properties properties = AccountingDataHarvesterPlugin.getProperties().get();
|
Properties properties = AccountingDashboardHarvesterPlugin.getProperties().get();
|
||||||
Set<String> keys = properties.stringPropertyNames();
|
Set<String> keys = properties.stringPropertyNames();
|
||||||
|
|
||||||
mapSystemTypeToDBEntry = new HashMap<String,String>();
|
mapSystemTypeToDBEntry = new HashMap<String,String>();
|
||||||
|
|
|
@ -18,7 +18,7 @@ import org.gcube.accounting.analytics.persistence.AccountingPersistenceQueryFact
|
||||||
import org.gcube.accounting.datamodel.AggregatedUsageRecord;
|
import org.gcube.accounting.datamodel.AggregatedUsageRecord;
|
||||||
import org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord;
|
import org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord;
|
||||||
import org.gcube.accounting.datamodel.usagerecords.ServiceUsageRecord;
|
import org.gcube.accounting.datamodel.usagerecords.ServiceUsageRecord;
|
||||||
import org.gcube.dataharvest.AccountingDataHarvesterPlugin;
|
import org.gcube.dataharvest.AccountingDashboardHarvesterPlugin;
|
||||||
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
import org.gcube.dataharvest.datamodel.HarvestedDataKey;
|
||||||
import org.gcube.dataharvest.harvester.BasicHarvester;
|
import org.gcube.dataharvest.harvester.BasicHarvester;
|
||||||
import org.gcube.dataharvest.utils.DateUtils;
|
import org.gcube.dataharvest.utils.DateUtils;
|
||||||
|
@ -109,7 +109,7 @@ public class TagMeMethodInvocationHarvester extends BasicHarvester {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ScopeDescriptor scopeDescriptor = AccountingDataHarvesterPlugin.getScopeDescriptor();
|
ScopeDescriptor scopeDescriptor = AccountingDashboardHarvesterPlugin.getScopeDescriptor();
|
||||||
Dimension dimension = getDimension(HarvestedDataKey.METHOD_INVOCATIONS);
|
Dimension dimension = getDimension(HarvestedDataKey.METHOD_INVOCATIONS);
|
||||||
|
|
||||||
AccountingRecord ar = new AccountingRecord(scopeDescriptor, instant, dimension, numberOfInvocation);
|
AccountingRecord ar = new AccountingRecord(scopeDescriptor, instant, dimension, numberOfInvocation);
|
||||||
|
|
|
@ -13,7 +13,7 @@ import java.util.TreeSet;
|
||||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||||
import org.gcube.common.authorization.library.provider.UserInfo;
|
import org.gcube.common.authorization.library.provider.UserInfo;
|
||||||
import org.gcube.common.scope.impl.ScopeBean;
|
import org.gcube.common.scope.impl.ScopeBean;
|
||||||
import org.gcube.dataharvest.AccountingDataHarvesterPlugin;
|
import org.gcube.dataharvest.AccountingDashboardHarvesterPlugin;
|
||||||
import org.gcube.resourcemanagement.support.server.managers.context.ContextManager;
|
import org.gcube.resourcemanagement.support.server.managers.context.ContextManager;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -52,7 +52,7 @@ public class ContextAuthorization {
|
||||||
|
|
||||||
public String generateTokenForContext(String context, Properties properties) throws Exception {
|
public String generateTokenForContext(String context, Properties properties) throws Exception {
|
||||||
if(properties==null) {
|
if(properties==null) {
|
||||||
properties = AccountingDataHarvesterPlugin.getProperties().get();
|
properties = AccountingDashboardHarvesterPlugin.getProperties().get();
|
||||||
}
|
}
|
||||||
logger.info("Going to generate Token for Context {}", context);
|
logger.info("Going to generate Token for Context {}", context);
|
||||||
UserInfo userInfo = new UserInfo(properties.getProperty(USERNAME, DEFAULT_USERNAME),
|
UserInfo userInfo = new UserInfo(properties.getProperty(USERNAME, DEFAULT_USERNAME),
|
||||||
|
@ -74,7 +74,7 @@ public class ContextAuthorization {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Properties properties = AccountingDataHarvesterPlugin.getProperties().get();
|
Properties properties = AccountingDashboardHarvesterPlugin.getProperties().get();
|
||||||
|
|
||||||
LinkedHashMap<String,ScopeBean> map = ContextManager.readContexts();
|
LinkedHashMap<String,ScopeBean> map = ContextManager.readContexts();
|
||||||
for(String scope : map.keySet()) {
|
for(String scope : map.keySet()) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
org.gcube.dataharvest.DataHarvestPluginDeclaration
|
org.gcube.dataharvest.AccountingDashboardHarvesterPluginDeclaration
|
|
@ -34,9 +34,9 @@ import org.gcube.dataharvest.utils.ContextAuthorization;
|
||||||
import org.gcube.dataharvest.utils.ContextTest;
|
import org.gcube.dataharvest.utils.ContextTest;
|
||||||
import org.gcube.dataharvest.utils.DateUtils;
|
import org.gcube.dataharvest.utils.DateUtils;
|
||||||
import org.gcube.resourcemanagement.support.server.managers.context.ContextManager;
|
import org.gcube.resourcemanagement.support.server.managers.context.ContextManager;
|
||||||
import org.gcube.vremanagement.executor.api.rest.SmartExecutor;
|
|
||||||
import org.gcube.vremanagement.executor.api.types.LaunchParameter;
|
import org.gcube.vremanagement.executor.api.types.LaunchParameter;
|
||||||
import org.gcube.vremanagement.executor.api.types.Scheduling;
|
import org.gcube.vremanagement.executor.api.types.Scheduling;
|
||||||
|
import org.gcube.vremanagement.executor.client.SmartExecutorClient;
|
||||||
import org.gcube.vremanagement.executor.client.SmartExecutorClientFactory;
|
import org.gcube.vremanagement.executor.client.SmartExecutorClientFactory;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.quartz.CronExpression;
|
import org.quartz.CronExpression;
|
||||||
|
@ -93,20 +93,20 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
|
|
||||||
ContextTest.setContextByName(ROOT);
|
ContextTest.setContextByName(ROOT);
|
||||||
|
|
||||||
DataHarvestPluginDeclaration dataHarvestPluginDeclaration = new DataHarvestPluginDeclaration();
|
AccountingDashboardHarvesterPluginDeclaration dataHarvestPluginDeclaration = new AccountingDashboardHarvesterPluginDeclaration();
|
||||||
|
|
||||||
AccountingDataHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDataHarvesterPlugin(
|
AccountingDashboardHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDashboardHarvesterPlugin(
|
||||||
dataHarvestPluginDeclaration);
|
dataHarvestPluginDeclaration);
|
||||||
|
|
||||||
Map<String,Object> inputs = new HashMap<>();
|
Map<String,Object> inputs = new HashMap<>();
|
||||||
|
|
||||||
AggregationType aggregationType = AggregationType.MONTHLY;
|
AggregationType aggregationType = AggregationType.MONTHLY;
|
||||||
|
|
||||||
inputs.put(AccountingDataHarvesterPlugin.MEASURE_TYPE_INPUT_PARAMETER, aggregationType.name());
|
inputs.put(AccountingDashboardHarvesterPlugin.MEASURE_TYPE_INPUT_PARAMETER, aggregationType.name());
|
||||||
inputs.put(AccountingDataHarvesterPlugin.GET_VRE_USERS_INPUT_PARAMETER, true);
|
inputs.put(AccountingDashboardHarvesterPlugin.GET_VRE_USERS_INPUT_PARAMETER, true);
|
||||||
inputs.put(AccountingDataHarvesterPlugin.RERUN_INPUT_PARAMETER, true);
|
inputs.put(AccountingDashboardHarvesterPlugin.RERUN_INPUT_PARAMETER, true);
|
||||||
inputs.put(AccountingDataHarvesterPlugin.DRY_RUN_INPUT_PARAMETER, false);
|
inputs.put(AccountingDashboardHarvesterPlugin.DRY_RUN_INPUT_PARAMETER, false);
|
||||||
inputs.put(AccountingDataHarvesterPlugin.PARTIAL_HARVESTING, true);
|
inputs.put(AccountingDashboardHarvesterPlugin.PARTIAL_HARVESTING, true);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Calendar from = DateUtils.getStartCalendar(2016, Calendar.SEPTEMBER, 1);
|
Calendar from = DateUtils.getStartCalendar(2016, Calendar.SEPTEMBER, 1);
|
||||||
|
@ -130,17 +130,17 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
|
|
||||||
ContextTest.setContextByName(ROOT);
|
ContextTest.setContextByName(ROOT);
|
||||||
|
|
||||||
SmartExecutor smartExecutor = SmartExecutorClientFactory.create(DataHarvestPluginDeclaration.NAME);
|
SmartExecutorClient smartExecutor = SmartExecutorClientFactory.getClient(AccountingDashboardHarvesterPluginDeclaration.NAME);
|
||||||
Assert.assertNotNull(smartExecutor);
|
Assert.assertNotNull(smartExecutor);
|
||||||
|
|
||||||
Map<String,Object> inputs = new HashMap<>();
|
Map<String,Object> inputs = new HashMap<>();
|
||||||
|
|
||||||
AggregationType aggregationType = AggregationType.MONTHLY;
|
AggregationType aggregationType = AggregationType.MONTHLY;
|
||||||
|
|
||||||
inputs.put(AccountingDataHarvesterPlugin.MEASURE_TYPE_INPUT_PARAMETER, aggregationType.name());
|
inputs.put(AccountingDashboardHarvesterPlugin.MEASURE_TYPE_INPUT_PARAMETER, aggregationType.name());
|
||||||
inputs.put(AccountingDataHarvesterPlugin.GET_VRE_USERS_INPUT_PARAMETER, true);
|
inputs.put(AccountingDashboardHarvesterPlugin.GET_VRE_USERS_INPUT_PARAMETER, true);
|
||||||
inputs.put(AccountingDataHarvesterPlugin.RERUN_INPUT_PARAMETER, true);
|
inputs.put(AccountingDashboardHarvesterPlugin.RERUN_INPUT_PARAMETER, true);
|
||||||
inputs.put(AccountingDataHarvesterPlugin.DRY_RUN_INPUT_PARAMETER, false);
|
inputs.put(AccountingDashboardHarvesterPlugin.DRY_RUN_INPUT_PARAMETER, false);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Calendar from = DateUtils.getStartCalendar(2016, Calendar.SEPTEMBER, 1);
|
Calendar from = DateUtils.getStartCalendar(2016, Calendar.SEPTEMBER, 1);
|
||||||
|
@ -153,7 +153,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
CronExpression cronExpression = new CronExpression("0 0 10 3 1/1 ? *");
|
CronExpression cronExpression = new CronExpression("0 0 10 3 1/1 ? *");
|
||||||
Scheduling scheduling = new Scheduling(cronExpression);
|
Scheduling scheduling = new Scheduling(cronExpression);
|
||||||
scheduling.setGlobal(false);
|
scheduling.setGlobal(false);
|
||||||
LaunchParameter launchParameter = new LaunchParameter(DataHarvestPluginDeclaration.NAME, inputs,
|
LaunchParameter launchParameter = new LaunchParameter(AccountingDashboardHarvesterPluginDeclaration.NAME, inputs,
|
||||||
scheduling);
|
scheduling);
|
||||||
smartExecutor.launch(launchParameter);
|
smartExecutor.launch(launchParameter);
|
||||||
|
|
||||||
|
@ -170,19 +170,19 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
|
|
||||||
ContextTest.setContextByName(ROOT);
|
ContextTest.setContextByName(ROOT);
|
||||||
|
|
||||||
DataHarvestPluginDeclaration dataHarvestPluginDeclaration = new DataHarvestPluginDeclaration();
|
AccountingDashboardHarvesterPluginDeclaration dataHarvestPluginDeclaration = new AccountingDashboardHarvesterPluginDeclaration();
|
||||||
|
|
||||||
AccountingDataHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDataHarvesterPlugin(
|
AccountingDashboardHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDashboardHarvesterPlugin(
|
||||||
dataHarvestPluginDeclaration);
|
dataHarvestPluginDeclaration);
|
||||||
|
|
||||||
Map<String,Object> inputs = new HashMap<>();
|
Map<String,Object> inputs = new HashMap<>();
|
||||||
|
|
||||||
AggregationType aggregationType = AggregationType.MONTHLY;
|
AggregationType aggregationType = AggregationType.MONTHLY;
|
||||||
|
|
||||||
inputs.put(AccountingDataHarvesterPlugin.MEASURE_TYPE_INPUT_PARAMETER, aggregationType.name());
|
inputs.put(AccountingDashboardHarvesterPlugin.MEASURE_TYPE_INPUT_PARAMETER, aggregationType.name());
|
||||||
inputs.put(AccountingDataHarvesterPlugin.GET_VRE_USERS_INPUT_PARAMETER, true);
|
inputs.put(AccountingDashboardHarvesterPlugin.GET_VRE_USERS_INPUT_PARAMETER, true);
|
||||||
inputs.put(AccountingDataHarvesterPlugin.RERUN_INPUT_PARAMETER, true);
|
inputs.put(AccountingDashboardHarvesterPlugin.RERUN_INPUT_PARAMETER, true);
|
||||||
inputs.put(AccountingDataHarvesterPlugin.DRY_RUN_INPUT_PARAMETER, false);
|
inputs.put(AccountingDashboardHarvesterPlugin.DRY_RUN_INPUT_PARAMETER, false);
|
||||||
|
|
||||||
Calendar from = DateUtils.getStartCalendar(2016, Calendar.SEPTEMBER, 1);
|
Calendar from = DateUtils.getStartCalendar(2016, Calendar.SEPTEMBER, 1);
|
||||||
|
|
||||||
|
@ -190,8 +190,8 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
|
|
||||||
while(from.before(runbeforeDate)) {
|
while(from.before(runbeforeDate)) {
|
||||||
String fromDate = DateUtils.LAUNCH_DATE_FORMAT.format(from.getTime());
|
String fromDate = DateUtils.LAUNCH_DATE_FORMAT.format(from.getTime());
|
||||||
logger.trace("{} is {}", AccountingDataHarvesterPlugin.START_DATE_INPUT_PARAMETER, fromDate);
|
logger.trace("{} is {}", AccountingDashboardHarvesterPlugin.START_DATE_INPUT_PARAMETER, fromDate);
|
||||||
inputs.put(AccountingDataHarvesterPlugin.START_DATE_INPUT_PARAMETER, fromDate);
|
inputs.put(AccountingDashboardHarvesterPlugin.START_DATE_INPUT_PARAMETER, fromDate);
|
||||||
accountingDataHarvesterPlugin.launch(inputs);
|
accountingDataHarvesterPlugin.launch(inputs);
|
||||||
from.add(aggregationType.getCalendarField(), 1);
|
from.add(aggregationType.getCalendarField(), 1);
|
||||||
}
|
}
|
||||||
|
@ -210,12 +210,12 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
ContextTest.setContextByName(ROOT);
|
ContextTest.setContextByName(ROOT);
|
||||||
// AccountingDao dao = AccountingDao.get();
|
// AccountingDao dao = AccountingDao.get();
|
||||||
|
|
||||||
DataHarvestPluginDeclaration dataHarvestPluginDeclaration = new DataHarvestPluginDeclaration();
|
AccountingDashboardHarvesterPluginDeclaration dataHarvestPluginDeclaration = new AccountingDashboardHarvesterPluginDeclaration();
|
||||||
|
|
||||||
AccountingDataHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDataHarvesterPlugin(
|
AccountingDashboardHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDashboardHarvesterPlugin(
|
||||||
dataHarvestPluginDeclaration);
|
dataHarvestPluginDeclaration);
|
||||||
Properties properties = accountingDataHarvesterPlugin.getConfigParameters();
|
Properties properties = accountingDataHarvesterPlugin.getConfigParameters();
|
||||||
AccountingDataHarvesterPlugin.getProperties().set(properties);
|
AccountingDashboardHarvesterPlugin.getProperties().set(properties);
|
||||||
|
|
||||||
ContextAuthorization contextAuthorization = new ContextAuthorization();
|
ContextAuthorization contextAuthorization = new ContextAuthorization();
|
||||||
SortedSet<String> contexts = contextAuthorization.getContexts();
|
SortedSet<String> contexts = contextAuthorization.getContexts();
|
||||||
|
@ -266,7 +266,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(context.startsWith(AccountingDataHarvesterPlugin.SO_BIG_DATA_VO)
|
if(context.startsWith(AccountingDashboardHarvesterPlugin.SO_BIG_DATA_VO)
|
||||||
&& start.before(DateUtils.getStartCalendar(2018, Calendar.APRIL, 1).getTime())) {
|
&& start.before(DateUtils.getStartCalendar(2018, Calendar.APRIL, 1).getTime())) {
|
||||||
logger.info("Not Harvesting VREs Accesses for {} from {} to {}", context,
|
logger.info("Not Harvesting VREs Accesses for {} from {} to {}", context,
|
||||||
DateUtils.format(start), DateUtils.format(end));
|
DateUtils.format(start), DateUtils.format(end));
|
||||||
|
@ -330,9 +330,9 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
DateUtils.format(end));
|
DateUtils.format(end));
|
||||||
}
|
}
|
||||||
|
|
||||||
if((context.startsWith(AccountingDataHarvesterPlugin.SO_BIG_DATA_VO)
|
if((context.startsWith(AccountingDashboardHarvesterPlugin.SO_BIG_DATA_VO)
|
||||||
|| context.startsWith(AccountingDataHarvesterPlugin.SO_BIG_DATA_EU_VRE)
|
|| context.startsWith(AccountingDashboardHarvesterPlugin.SO_BIG_DATA_EU_VRE)
|
||||||
|| context.startsWith(AccountingDataHarvesterPlugin.SO_BIG_DATA_IT_VRE))
|
|| context.startsWith(AccountingDashboardHarvesterPlugin.SO_BIG_DATA_IT_VRE))
|
||||||
&& start.before(DateUtils.getStartCalendar(2018, Calendar.APRIL, 1).getTime())) {
|
&& start.before(DateUtils.getStartCalendar(2018, Calendar.APRIL, 1).getTime())) {
|
||||||
logger.info("--- Not Harvesting (SoBigData Check) for {} from {} to {}", context,
|
logger.info("--- Not Harvesting (SoBigData Check) for {} from {} to {}", context,
|
||||||
DateUtils.format(start), DateUtils.format(end));
|
DateUtils.format(start), DateUtils.format(end));
|
||||||
|
@ -413,7 +413,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
Date start = DateUtils.getPreviousPeriod(measureType, false).getTime();
|
Date start = DateUtils.getPreviousPeriod(measureType, false).getTime();
|
||||||
Date end = DateUtils.getEndDateFromStartDate(measureType, start, 1, false);
|
Date end = DateUtils.getEndDateFromStartDate(measureType, start, 1, false);
|
||||||
|
|
||||||
AccountingDataHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDataHarvesterPlugin(null);
|
AccountingDashboardHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDashboardHarvesterPlugin(null);
|
||||||
accountingDataHarvesterPlugin.getConfigParameters();
|
accountingDataHarvesterPlugin.getConfigParameters();
|
||||||
|
|
||||||
ContextAuthorization contextAuthorization = new ContextAuthorization();
|
ContextAuthorization contextAuthorization = new ContextAuthorization();
|
||||||
|
@ -453,7 +453,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(context.startsWith(AccountingDataHarvesterPlugin.SO_BIG_DATA_VO)
|
if(context.startsWith(AccountingDashboardHarvesterPlugin.SO_BIG_DATA_VO)
|
||||||
&& start.before(DateUtils.getStartCalendar(2018, Calendar.APRIL, 1).getTime())) {
|
&& start.before(DateUtils.getStartCalendar(2018, Calendar.APRIL, 1).getTime())) {
|
||||||
logger.info("Not Harvesting VREs Accesses for {} from {} to {}", context,
|
logger.info("Not Harvesting VREs Accesses for {} from {} to {}", context,
|
||||||
DateUtils.format(start), DateUtils.format(end));
|
DateUtils.format(start), DateUtils.format(end));
|
||||||
|
@ -481,12 +481,12 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
ContextTest.setContextByName(ROOT);
|
ContextTest.setContextByName(ROOT);
|
||||||
// AccountingDao dao = AccountingDao.get();
|
// AccountingDao dao = AccountingDao.get();
|
||||||
|
|
||||||
DataHarvestPluginDeclaration dataHarvestPluginDeclaration = new DataHarvestPluginDeclaration();
|
AccountingDashboardHarvesterPluginDeclaration dataHarvestPluginDeclaration = new AccountingDashboardHarvesterPluginDeclaration();
|
||||||
|
|
||||||
AccountingDataHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDataHarvesterPlugin(
|
AccountingDashboardHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDashboardHarvesterPlugin(
|
||||||
dataHarvestPluginDeclaration);
|
dataHarvestPluginDeclaration);
|
||||||
Properties properties = accountingDataHarvesterPlugin.getConfigParameters();
|
Properties properties = accountingDataHarvesterPlugin.getConfigParameters();
|
||||||
AccountingDataHarvesterPlugin.getProperties().set(properties);
|
AccountingDashboardHarvesterPlugin.getProperties().set(properties);
|
||||||
|
|
||||||
ContextAuthorization contextAuthorization = new ContextAuthorization();
|
ContextAuthorization contextAuthorization = new ContextAuthorization();
|
||||||
|
|
||||||
|
@ -569,7 +569,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
for(ScopeDescriptor scopeDescriptor : scopeDescriptorSet) {
|
for(ScopeDescriptor scopeDescriptor : scopeDescriptorSet) {
|
||||||
scopeDescriptorMap.put(scopeDescriptor.getId(), scopeDescriptor);
|
scopeDescriptorMap.put(scopeDescriptor.getId(), scopeDescriptor);
|
||||||
}
|
}
|
||||||
AccountingDataHarvesterPlugin.scopeDescriptors.set(scopeDescriptorMap);
|
AccountingDashboardHarvesterPlugin.scopeDescriptors.set(scopeDescriptorMap);
|
||||||
|
|
||||||
Set<Dimension> dimensionSet = dao.getDimensions();
|
Set<Dimension> dimensionSet = dao.getDimensions();
|
||||||
Map<String,Dimension> dimensionMap = new HashMap<>();
|
Map<String,Dimension> dimensionMap = new HashMap<>();
|
||||||
|
@ -577,7 +577,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
dimensionMap.put(dimension.getId(), dimension);
|
dimensionMap.put(dimension.getId(), dimension);
|
||||||
}
|
}
|
||||||
|
|
||||||
AccountingDataHarvesterPlugin.dimensions.set(dimensionMap);
|
AccountingDashboardHarvesterPlugin.dimensions.set(dimensionMap);
|
||||||
|
|
||||||
return dao;
|
return dao;
|
||||||
}
|
}
|
||||||
|
@ -589,13 +589,13 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
ContextTest.setContext(tagMeToken);
|
ContextTest.setContext(tagMeToken);
|
||||||
|
|
||||||
ScopeBean scopeBean = new ScopeBean(contextFullName);
|
ScopeBean scopeBean = new ScopeBean(contextFullName);
|
||||||
ScopeDescriptor actualScopeDescriptor = AccountingDataHarvesterPlugin.scopeDescriptors.get()
|
ScopeDescriptor actualScopeDescriptor = AccountingDashboardHarvesterPlugin.scopeDescriptors.get()
|
||||||
.get(contextFullName);
|
.get(contextFullName);
|
||||||
if(actualScopeDescriptor == null) {
|
if(actualScopeDescriptor == null) {
|
||||||
actualScopeDescriptor = new ScopeDescriptor(scopeBean.name(), contextFullName);
|
actualScopeDescriptor = new ScopeDescriptor(scopeBean.name(), contextFullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
AccountingDataHarvesterPlugin.scopeDescriptor.set(actualScopeDescriptor);
|
AccountingDashboardHarvesterPlugin.scopeDescriptor.set(actualScopeDescriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Test
|
// @Test
|
||||||
|
@ -640,11 +640,11 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
try {
|
try {
|
||||||
ContextTest.setContextByName(ROOT);
|
ContextTest.setContextByName(ROOT);
|
||||||
|
|
||||||
DataHarvestPluginDeclaration dataHarvestPluginDeclaration = new DataHarvestPluginDeclaration();
|
AccountingDashboardHarvesterPluginDeclaration dataHarvestPluginDeclaration = new AccountingDashboardHarvesterPluginDeclaration();
|
||||||
AccountingDataHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDataHarvesterPlugin(
|
AccountingDashboardHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDashboardHarvesterPlugin(
|
||||||
dataHarvestPluginDeclaration);
|
dataHarvestPluginDeclaration);
|
||||||
Properties properties = accountingDataHarvesterPlugin.getConfigParameters();
|
Properties properties = accountingDataHarvesterPlugin.getConfigParameters();
|
||||||
AccountingDataHarvesterPlugin.getProperties().set(properties);
|
AccountingDashboardHarvesterPlugin.getProperties().set(properties);
|
||||||
|
|
||||||
// AccountingDao dao = AccountingDao.get();
|
// AccountingDao dao = AccountingDao.get();
|
||||||
|
|
||||||
|
@ -684,7 +684,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
|
|
||||||
SortedSet<String> contexts = getContexts();
|
SortedSet<String> contexts = getContexts();
|
||||||
|
|
||||||
AccountingDataHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDataHarvesterPlugin(null);
|
AccountingDashboardHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDashboardHarvesterPlugin(null);
|
||||||
accountingDataHarvesterPlugin.getConfigParameters();
|
accountingDataHarvesterPlugin.getConfigParameters();
|
||||||
|
|
||||||
ResourceCatalogueHarvester resourceCatalogueHarvester = new ResourceCatalogueHarvester(start, end,
|
ResourceCatalogueHarvester resourceCatalogueHarvester = new ResourceCatalogueHarvester(start, end,
|
||||||
|
@ -713,7 +713,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
Date start = DateUtils.getPreviousPeriod(measureType, false).getTime();
|
Date start = DateUtils.getPreviousPeriod(measureType, false).getTime();
|
||||||
Date end = DateUtils.getEndDateFromStartDate(measureType, start, 1, false);
|
Date end = DateUtils.getEndDateFromStartDate(measureType, start, 1, false);
|
||||||
|
|
||||||
AccountingDataHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDataHarvesterPlugin(null);
|
AccountingDashboardHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDashboardHarvesterPlugin(null);
|
||||||
accountingDataHarvesterPlugin.getConfigParameters();
|
accountingDataHarvesterPlugin.getConfigParameters();
|
||||||
|
|
||||||
SortedSet<String> contexts = getContexts();
|
SortedSet<String> contexts = getContexts();
|
||||||
|
@ -744,7 +744,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
Date start = DateUtils.getPreviousPeriod(measureType, false).getTime();
|
Date start = DateUtils.getPreviousPeriod(measureType, false).getTime();
|
||||||
Date end = DateUtils.getEndDateFromStartDate(measureType, start, 1, false);
|
Date end = DateUtils.getEndDateFromStartDate(measureType, start, 1, false);
|
||||||
|
|
||||||
AccountingDataHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDataHarvesterPlugin(null);
|
AccountingDashboardHarvesterPlugin accountingDataHarvesterPlugin = new AccountingDashboardHarvesterPlugin(null);
|
||||||
accountingDataHarvesterPlugin.getConfigParameters();
|
accountingDataHarvesterPlugin.getConfigParameters();
|
||||||
|
|
||||||
ContextAuthorization contextAuthorization = new ContextAuthorization();
|
ContextAuthorization contextAuthorization = new ContextAuthorization();
|
||||||
|
@ -754,7 +754,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
ScopeBean scopeBean = new ScopeBean(context);
|
ScopeBean scopeBean = new ScopeBean(context);
|
||||||
logger.debug("FullName {} - Name {}", scopeBean.toString(), scopeBean.name());
|
logger.debug("FullName {} - Name {}", scopeBean.toString(), scopeBean.name());
|
||||||
|
|
||||||
if(context.startsWith(AccountingDataHarvesterPlugin.SO_BIG_DATA_VO)) {
|
if(context.startsWith(AccountingDashboardHarvesterPlugin.SO_BIG_DATA_VO)) {
|
||||||
if(scopeBean.is(Type.VRE)) {
|
if(scopeBean.is(Type.VRE)) {
|
||||||
if(context.startsWith(TAGME_VRE)) {
|
if(context.startsWith(TAGME_VRE)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -782,10 +782,10 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
|
|
||||||
ContextTest.setContextByName(ROOT);
|
ContextTest.setContextByName(ROOT);
|
||||||
|
|
||||||
DataHarvestPluginDeclaration dataHarvestPluginDeclaration = new DataHarvestPluginDeclaration();
|
AccountingDashboardHarvesterPluginDeclaration dataHarvestPluginDeclaration = new AccountingDashboardHarvesterPluginDeclaration();
|
||||||
AccountingDataHarvesterPlugin adhp = new AccountingDataHarvesterPlugin(dataHarvestPluginDeclaration);
|
AccountingDashboardHarvesterPlugin adhp = new AccountingDashboardHarvesterPlugin(dataHarvestPluginDeclaration);
|
||||||
Properties properties = adhp.getConfigParameters();
|
Properties properties = adhp.getConfigParameters();
|
||||||
AccountingDataHarvesterPlugin.getProperties().set(properties);
|
AccountingDashboardHarvesterPlugin.getProperties().set(properties);
|
||||||
|
|
||||||
ContextAuthorization contextAuthorization = new ContextAuthorization();
|
ContextAuthorization contextAuthorization = new ContextAuthorization();
|
||||||
|
|
||||||
|
@ -797,7 +797,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
for(ScopeDescriptor scopeDescriptor : scopeDescriptorSet) {
|
for(ScopeDescriptor scopeDescriptor : scopeDescriptorSet) {
|
||||||
scopeDescriptorMap.put(scopeDescriptor.getId(), scopeDescriptor);
|
scopeDescriptorMap.put(scopeDescriptor.getId(), scopeDescriptor);
|
||||||
}
|
}
|
||||||
AccountingDataHarvesterPlugin.scopeDescriptors.set(scopeDescriptorMap);
|
AccountingDashboardHarvesterPlugin.scopeDescriptors.set(scopeDescriptorMap);
|
||||||
|
|
||||||
Set<Dimension> dimensionSet = dao.getDimensions();
|
Set<Dimension> dimensionSet = dao.getDimensions();
|
||||||
Map<String,Dimension> dimensionMap = new HashMap<>();
|
Map<String,Dimension> dimensionMap = new HashMap<>();
|
||||||
|
@ -805,7 +805,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
dimensionMap.put(dimension.getId(), dimension);
|
dimensionMap.put(dimension.getId(), dimension);
|
||||||
}
|
}
|
||||||
|
|
||||||
AccountingDataHarvesterPlugin.dimensions.set(dimensionMap);
|
AccountingDashboardHarvesterPlugin.dimensions.set(dimensionMap);
|
||||||
|
|
||||||
// ArrayList<HarvestedData> data = new ArrayList<HarvestedData>();
|
// ArrayList<HarvestedData> data = new ArrayList<HarvestedData>();
|
||||||
ArrayList<AccountingRecord> accountingRecords = new ArrayList<AccountingRecord>();
|
ArrayList<AccountingRecord> accountingRecords = new ArrayList<AccountingRecord>();
|
||||||
|
@ -818,7 +818,7 @@ public class AccountingDataHarvesterPluginTest extends ContextTest {
|
||||||
ScopeBean scopeBean = new ScopeBean(context);
|
ScopeBean scopeBean = new ScopeBean(context);
|
||||||
ScopeDescriptor scopeDescriptor = new ScopeDescriptor(scopeBean.name(), context);
|
ScopeDescriptor scopeDescriptor = new ScopeDescriptor(scopeBean.name(), context);
|
||||||
|
|
||||||
Dimension dimension = AccountingDataHarvesterPlugin.getDimension(HarvestedDataKey.ACCESSES.getKey());
|
Dimension dimension = AccountingDashboardHarvesterPlugin.getDimension(HarvestedDataKey.ACCESSES.getKey());
|
||||||
|
|
||||||
Calendar calendar = DateUtils.getStartCalendar(2018, Calendar.JULY, 1);
|
Calendar calendar = DateUtils.getStartCalendar(2018, Calendar.JULY, 1);
|
||||||
calendar.set(Calendar.DAY_OF_MONTH, 15);
|
calendar.set(Calendar.DAY_OF_MONTH, 15);
|
||||||
|
|
|
@ -4,7 +4,7 @@ import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import org.gcube.dataharvest.AccountingDataHarvesterPlugin;
|
import org.gcube.dataharvest.AccountingDashboardHarvesterPlugin;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -21,9 +21,9 @@ public class ContextAuthorizationTest extends ContextTest {
|
||||||
|
|
||||||
private void getConfigParameters() throws IOException {
|
private void getConfigParameters() throws IOException {
|
||||||
properties = new Properties();
|
properties = new Properties();
|
||||||
InputStream input = AccountingDataHarvesterPlugin.class.getClassLoader().getResourceAsStream(PROPERTY_FILENAME);
|
InputStream input = AccountingDashboardHarvesterPlugin.class.getClassLoader().getResourceAsStream(PROPERTY_FILENAME);
|
||||||
properties.load(input);
|
properties.load(input);
|
||||||
AccountingDataHarvesterPlugin.getProperties().set(properties);
|
AccountingDashboardHarvesterPlugin.getProperties().set(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Test
|
// @Test
|
||||||
|
|
Loading…
Reference in New Issue