commit ea1ddcbe44df30d9ece034c1168c70f14d25d836 Author: Luca Frosini Date: Fri Jan 29 14:54:16 2016 +0000 Changed maven artifactID git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-aggregator-se-plugin@122656 82a268e6-3cf1-43bd-a215-b396298e98cf diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..dcb2dc5 --- /dev/null +++ b/.classpath @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..e0d0725 --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ + + + accounting-aggregator + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..29abf99 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..ec4300d --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/distro/INSTALL b/distro/INSTALL new file mode 100644 index 0000000..e0b544a --- /dev/null +++ b/distro/INSTALL @@ -0,0 +1 @@ +Used as a plugin of SmartExecutor \ No newline at end of file diff --git a/distro/LICENSE b/distro/LICENSE new file mode 100644 index 0000000..bd0c2b4 --- /dev/null +++ b/distro/LICENSE @@ -0,0 +1,8 @@ +gCube System - License +------------------------------------------------------------ + +The gCube/gCore software is licensed as Free Open Source software conveying to +the EUPL (http://ec.europa.eu/idabc/eupl). +The software and documentation is provided by its authors/distributors "as is" +and no expressed or implied warranty is given for its use, quality or fitness +for a particular case. diff --git a/distro/MAINTAINERS b/distro/MAINTAINERS new file mode 100644 index 0000000..ba9c41c --- /dev/null +++ b/distro/MAINTAINERS @@ -0,0 +1,2 @@ +Luca Frosini (luca.frosini@isti.cnr.it), CNR Pisa, +Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" \ No newline at end of file diff --git a/distro/README b/distro/README new file mode 100644 index 0000000..f406d70 --- /dev/null +++ b/distro/README @@ -0,0 +1,32 @@ +The gCube System - Smart Executor Service Client Library + +------------------------------------------------------------ + +This work has been partially supported by the following European projects: DILIGENT (FP6-2003-IST-2), +D4Science (FP7-INFRA-2007-1.2.2), D4Science-II (FP7-INFRA-2008-1.2.2), iMarine (FP7-INFRASTRUCTURES-2011-2), +and EUBrazilOpenBio (FP7-ICT-2011-EU-Brazil), Parthenos (H2020-INFRADEV-1-2014-1), BlueBridge (H2020-EINFRA-2015-1). + +Authors +------- + +* Luca Frosini (luca.frosini@isti.cnr.it), CNR Pisa, + Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo". + + +Version and Release Date +------------------------ + +v. 1.0.0 * First release + + +Description +----------- + +${description} + + +Licensing +--------- + +This software is licensed under the terms you may find in the file named "LICENSE" in this directory. + diff --git a/distro/changelog.xml b/distro/changelog.xml new file mode 100644 index 0000000..0be7c2f --- /dev/null +++ b/distro/changelog.xml @@ -0,0 +1,5 @@ + + + First Release + + \ No newline at end of file diff --git a/distro/descriptor.xml b/distro/descriptor.xml new file mode 100644 index 0000000..c468f13 --- /dev/null +++ b/distro/descriptor.xml @@ -0,0 +1,48 @@ + + servicearchive + + tar.gz + + / + + + ${distroDirectory} + / + true + + README + LICENSE + INSTALL + MAINTAINERS + changelog.xml + + 755 + true + + + target/apidocs + /${artifactId}/doc/api + true + 755 + + + + + ${distroDirectory}/profile.xml + ./ + true + + + target/${build.finalName}.jar + /${artifactId} + + + ${distroDirectory}/svnpath.txt + /${artifactId} + true + + + \ No newline at end of file diff --git a/distro/profile.xml b/distro/profile.xml new file mode 100644 index 0000000..a3c41bd --- /dev/null +++ b/distro/profile.xml @@ -0,0 +1,27 @@ + + + + Service + + Accounting + ${artifactId} + {description} + ${version} + + + {description} + ${artifactId} + ${version} + + ${groupId} + ${artifactId} + ${version} + + library + + ${build.finalName}.jar + + + + + \ No newline at end of file diff --git a/distro/svnpath.txt b/distro/svnpath.txt new file mode 100644 index 0000000..edacb04 --- /dev/null +++ b/distro/svnpath.txt @@ -0,0 +1 @@ +${scm.url} \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..e9375d5 --- /dev/null +++ b/pom.xml @@ -0,0 +1,114 @@ + + 4.0.0 + + org.gcube.tools + maven-parent + 1.0.0 + + org.gcube.accounting + accounting-aggregator-se-plugin + 1.0.0-SNAPSHOT + accounting-aggregator + Accountign Aggregator Smart Executor Plugin + + + + + org.gcube.distribution + maven-smartgears-bom + LATEST + pom + import + + + + + + UTF-8 + src/main/resources/META-INF/services + distro + + + + scm:https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/${project.artifactId} + scm:https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/${project.artifactId} + https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/${project.artifactId} + + + + + org.gcube.vremanagement + smart-executor-api + [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) + + + org.gcube.accounting + accounting-lib + + + org.slf4j + slf4j-api + provided + + + + + org.ektorp + org.ektorp + 1.3.0 + jar + + + org.codehaus.jackson + jackson-core-asl + 1.9.7 + jar + + + + + junit + junit + 4.11 + test + + + ch.qos.logback + logback-classic + 1.0.13 + test + + + + + + + maven-compiler-plugin + 2.3.2 + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-assembly-plugin + + + ${distroDirectory}/descriptor.xml + + + + + servicearchive + install + + single + + + + + + + \ No newline at end of file diff --git a/src/main/java/org/gcube/accounting/aggregator/plugin/AccountingAggregatorPlugin.java b/src/main/java/org/gcube/accounting/aggregator/plugin/AccountingAggregatorPlugin.java new file mode 100644 index 0000000..c5b6922 --- /dev/null +++ b/src/main/java/org/gcube/accounting/aggregator/plugin/AccountingAggregatorPlugin.java @@ -0,0 +1,49 @@ +package org.gcube.accounting.aggregator.plugin; + +import java.util.Map; + +import org.gcube.vremanagement.executor.plugin.Plugin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/ + */ +public class AccountingAggregatorPlugin extends Plugin { + + /** + * Logger + */ + private static Logger logger = LoggerFactory.getLogger(AccountingAggregatorPlugin.class); + + /** + * @param runningPluginEvolution + */ + public AccountingAggregatorPlugin(AccountingAggregatorPluginDeclaration pluginDeclaration) { + super(pluginDeclaration); + } + + /**{@inheritDoc}*/ + @Override + public void launch(Map inputs) throws Exception { + logger.debug("Launching {}", this.getClass().getSimpleName()); + + if(inputs == null || inputs.isEmpty()){ + logger.debug("{} inputs {}", this.getClass().getSimpleName(), inputs); + throw new Exception(); + } + + + + + + logger.debug("{} has finished", this.getClass().getSimpleName()); + } + + /**{@inheritDoc}*/ + @Override + protected void onStop() throws Exception { + logger.debug("{} onStop() function", this.getClass().getSimpleName()); + } + +} diff --git a/src/main/java/org/gcube/accounting/aggregator/plugin/AccountingAggregatorPluginDeclaration.java b/src/main/java/org/gcube/accounting/aggregator/plugin/AccountingAggregatorPluginDeclaration.java new file mode 100644 index 0000000..924ec2f --- /dev/null +++ b/src/main/java/org/gcube/accounting/aggregator/plugin/AccountingAggregatorPluginDeclaration.java @@ -0,0 +1,70 @@ +/** + * + */ +package org.gcube.accounting.aggregator.plugin; + +import java.util.HashMap; +import java.util.Map; + +import org.gcube.vremanagement.executor.plugin.Plugin; +import org.gcube.vremanagement.executor.plugin.PluginDeclaration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/ + * + */ +public class AccountingAggregatorPluginDeclaration implements PluginDeclaration { + /** + * Logger + */ + private static Logger logger = LoggerFactory.getLogger(AccountingAggregatorPlugin.class); + + /** + * Plugin name used by the Executor to retrieve this class + */ + public static final String NAME = "Accouting Aggregator Plugin"; + + public static final String DESCRIPTION = "This plugin is used to aggregate accounting record"; + + public static final String VERSION = "1.0.0"; + + /**{@inheritDoc}*/ + @Override + public void init() { + logger.debug(String.format("%s initialized", AccountingAggregatorPlugin.class.getSimpleName())); + } + + /**{@inheritDoc}*/ + @Override + public String getName() { + return NAME; + } + + /**{@inheritDoc}*/ + @Override + public String getDescription() { + return DESCRIPTION; + } + + /**{@inheritDoc}*/ + @Override + public String getVersion() { + return VERSION; + } + + /**{@inheritDoc}*/ + @Override + public Map getSupportedCapabilities() { + Map discoveredCapabilities = new HashMap(); + return discoveredCapabilities; + } + + /**{@inheritDoc}*/ + @Override + public Class> getPluginImplementation() { + return AccountingAggregatorPlugin.class; + } + +} diff --git a/src/main/resources/META-INF/services/org.gcube.vremanagement.executor.plugin.PluginDeclaration b/src/main/resources/META-INF/services/org.gcube.vremanagement.executor.plugin.PluginDeclaration new file mode 100644 index 0000000..468f772 --- /dev/null +++ b/src/main/resources/META-INF/services/org.gcube.vremanagement.executor.plugin.PluginDeclaration @@ -0,0 +1 @@ +org.gcube.accounting.aggregator.AccountingAggregatorPluginDeclaration \ No newline at end of file