diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b0b23f2 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,8 @@ +This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +# Changelog for Document Store Backend Connector Library for PostgreSQL + + +## [v1.0.0-SNAPSHOT] + +- First Release diff --git a/README.md b/README.md index fdcef88..38016ba 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,71 @@ -# document-store-lib-postgresql +# Document Store Backend Connector Library for PostgreSQL + +Document Store Backend Connector Library for PostgreSQL + +## Built With + +* [OpenJDK](https://openjdk.java.net/) - The JDK used +* [Maven](https://maven.apache.org/) - Dependency Management + +## Documentation + +[Document Store Backend Connector Library for PostgreSQL](https://wiki.gcube-system.org/gcube/Document_Store_Library) + +## Change log + +See [Releases](https://code-repo.d4science.org/gCubeSystem/document-store-lib-postgresql/releases). + +## Authors + +* **Luca Frosini** ([ORCID](https://orcid.org/0000-0003-3183-2291)) - [ISTI-CNR Infrascience Group](http://nemis.isti.cnr.it/groups/infrascience) + +## How to Cite this Software + +Tell people how to cite this software. +* Cite an associated paper? +* Use a specific BibTeX entry for the software? + + + @Manual{, + title = {Document Store Backend Connector Library for PostgreSQL}, + author = {{Frosini, Luca}}, + organization = {ISTI - CNR}, + address = {Pisa, Italy}, + year = 2021, + url = {http://www.gcube-system.org/} + } + +## License + +This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LICENSE.md) file for details. + + +## About the gCube Framework +This software is part of the [gCubeFramework](https://www.gcube-system.org/ "gCubeFramework"): an +open-source software toolkit used for building and operating Hybrid Data +Infrastructures enabling the dynamic deployment of Virtual Research Environments +by favouring the realisation of reuse oriented policies. + +The projects leading to this software have received funding from a series of European Union programmes including: + +- the Sixth Framework Programme for Research and Technological Development + - DILIGENT (grant no. 004260). +- the Seventh Framework Programme for research, technological development and demonstration + - D4Science (grant no. 212488); + - D4Science-II (grant no.239019); + - ENVRI (grant no. 283465); + - iMarine(grant no. 283644); + - EUBrazilOpenBio (grant no. 288754). +- the H2020 research and innovation programme + - SoBigData (grant no. 654024); + - PARTHENOS (grant no. 654119); + - EGIEngage (grant no. 654142); + - ENVRIplus (grant no. 654182); + - BlueBRIDGE (grant no. 675680); + - PerformFish (grant no. 727610); + - AGINFRAplus (grant no. 731001); + - DESIRA (grant no. 818194); + - ARIADNEplus (grant no. 823914); + - RISIS2 (grant no. 824091); + -Document Store Backend Connector Library for PostgreSQL \ No newline at end of file diff --git a/pom.xml b/pom.xml index bc88605..8d380e3 100644 --- a/pom.xml +++ b/pom.xml @@ -1,13 +1,77 @@ - - 4.0.0 - - org.gcube.tools - maven-parent - 1.1.0 - - org.gcube.data.publishing - document-store-lib-postgresql - 1.0.0-SNAPSHOT - Document Store Backend Connector Library for PostgreSQL - Document Store Backend Connector Library for PostgreSQL + + 4.0.0 + + org.gcube.tools + maven-parent + 1.1.0 + + + org.gcube.data.publishing + document-store-lib-postgresql + 1.0.0-SNAPSHOT + Document Store Backend Connector Library for PostgreSQL + Document Store Backend Connector Library for PostgreSQL + + + UTF-8 + DataPublishing + + + + scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git + scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git + https://code-repo.d4science.org/gCubeSystem/${project.artifactId} + + + + + + org.gcube.distribution + gcube-bom + 2.0.1 + pom + import + + + + + + + org.gcube.data.publishing + document-store-lib + + + org.slf4j + slf4j-api + + + + junit + junit + 4.11 + test + + + ch.qos.logback + logback-classic + test + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + make-uberjar + package + + + + + + \ No newline at end of file diff --git a/src/main/java/org/gcube/documentstore/persistence/PersistencePostgreSQL.java b/src/main/java/org/gcube/documentstore/persistence/PersistencePostgreSQL.java new file mode 100644 index 0000000..d91d0a0 --- /dev/null +++ b/src/main/java/org/gcube/documentstore/persistence/PersistencePostgreSQL.java @@ -0,0 +1,57 @@ +/** + * + */ +package org.gcube.documentstore.persistence; + +import org.gcube.documentstore.records.Record; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Luca Frosini (ISTI - CNR) + */ +public class PersistencePostgreSQL extends PersistenceBackend { + + private static final Logger logger = LoggerFactory.getLogger(PersistencePostgreSQL.class); + + @Override + protected void prepareConnection(PersistenceBackendConfiguration configuration) throws Exception { + logger.trace("prepareConnection()"); + } + + @Override + protected void openConnection() throws Exception { + logger.trace("openConnection()"); + } + + @Override + protected void reallyAccount(Record record) throws Exception { + logger.trace("reallyAccount()"); + } + + @Override + protected void accountWithFallback(Record... records) throws Exception { + logger.trace("accountWithFallback()"); + } + + @Override + public void close() throws Exception { + logger.trace("close()"); + } + + @Override + protected void clean() throws Exception { + logger.trace("closeAndClean()"); + } + + @Override + protected void closeConnection() throws Exception { + logger.trace("closeConnection()"); + } + + @Override + public boolean isConnectionActive() throws Exception { + return true; + }; + +} diff --git a/src/main/resources/META-INF/services/org.gcube.documentstore.persistence.PersistenceBackend b/src/main/resources/META-INF/services/org.gcube.documentstore.persistence.PersistenceBackend new file mode 100644 index 0000000..5b50193 --- /dev/null +++ b/src/main/resources/META-INF/services/org.gcube.documentstore.persistence.PersistenceBackend @@ -0,0 +1 @@ +org.gcube.documentstore.persistence.PersistencePostgreSQL \ No newline at end of file