From aa5147bb488735e822fc8c207485f9d384926d9f Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Thu, 3 Sep 2020 17:34:52 +0200 Subject: [PATCH 1/8] gCube Project Template --- CHANGELOG.md | 9 ++ FUNDING.md | 26 ++++ LICENSE.md | 312 ++++++++++++++++++++++++++++++++++++++++++ README.md | 51 +++++++ distro/LICENSE | 1 - distro/README | 65 --------- distro/changelog.xml | 8 -- distro/descriptor.xml | 30 ---- distro/profile.xml | 29 ---- pom.xml | 8 +- 10 files changed, 399 insertions(+), 140 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 FUNDING.md create mode 100644 LICENSE.md create mode 100644 README.md delete mode 100644 distro/LICENSE delete mode 100644 distro/README delete mode 100644 distro/changelog.xml delete mode 100644 distro/descriptor.xml delete mode 100644 distro/profile.xml diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..65fc15e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +# Changelog for org.gcube.spatial.data.sdi-service + +## [v1.4.2-SNAPSHOT] 2020-05-15 + +### Fixes + +- Integration with gcube distribution (https://support.d4science.org/issues/19612) diff --git a/FUNDING.md b/FUNDING.md new file mode 100644 index 0000000..9e48b94 --- /dev/null +++ b/FUNDING.md @@ -0,0 +1,26 @@ +# Acknowledgments + +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](https://cordis.europa.eu/project/id/004260) (grant no. 004260). +- the Seventh Framework Programme for research, technological development and demonstration + - [D4Science](https://cordis.europa.eu/project/id/212488) (grant no. 212488); + - [D4Science-II](https://cordis.europa.eu/project/id/239019) (grant no.239019); + - [ENVRI](https://cordis.europa.eu/project/id/283465) (grant no. 283465); + - [iMarine](https://cordis.europa.eu/project/id/283644) (grant no. 283644); + - [EUBrazilOpenBio](https://cordis.europa.eu/project/id/288754) (grant no. 288754). +- the H2020 research and innovation programme + - [SoBigData](https://cordis.europa.eu/project/id/654024) (grant no. 654024); + - [PARTHENOS](https://cordis.europa.eu/project/id/654119) (grant no. 654119); + - [EGI-Engage](https://cordis.europa.eu/project/id/654142) (grant no. 654142); + - [ENVRI PLUS](https://cordis.europa.eu/project/id/654182) (grant no. 654182); + - [BlueBRIDGE](https://cordis.europa.eu/project/id/675680) (grant no. 675680); + - [PerformFISH](https://cordis.europa.eu/project/id/727610) (grant no. 727610); + - [AGINFRA PLUS](https://cordis.europa.eu/project/id/731001) (grant no. 731001); + - [DESIRA](https://cordis.europa.eu/project/id/818194) (grant no. 818194); + - [ARIADNEplus](https://cordis.europa.eu/project/id/823914) (grant no. 823914); + - [RISIS 2](https://cordis.europa.eu/project/id/824091) (grant no. 824091); + - [EOSC-Pillar](https://cordis.europa.eu/project/id/857650) (grant no. 857650); + - [Blue Cloud](https://cordis.europa.eu/project/id/862409) (grant no. 862409); + - [SoBigData-PlusPlus](https://cordis.europa.eu/project/id/871042) (grant no. 871042); diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..3af0507 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,312 @@ +# European Union Public Licence V. 1.1 + + +EUPL © the European Community 2007 + + +This European Union Public Licence (the “EUPL”) applies to the Work or Software +(as defined below) which is provided under the terms of this Licence. Any use of +the Work, other than as authorised under this Licence is prohibited (to the +extent such use is covered by a right of the copyright holder of the Work). + +The Original Work is provided under the terms of this Licence when the Licensor +(as defined below) has placed the following notice immediately following the +copyright notice for the Original Work: + +Licensed under the EUPL V.1.1 + +or has expressed by any other mean his willingness to license under the EUPL. + + + +## 1. Definitions + +In this Licence, the following terms have the following meaning: + +- The Licence: this Licence. + +- The Original Work or the Software: the software distributed and/or + communicated by the Licensor under this Licence, available as Source Code and + also as Executable Code as the case may be. + +- Derivative Works: the works or software that could be created by the Licensee, + based upon the Original Work or modifications thereof. This Licence does not + define the extent of modification or dependence on the Original Work required + in order to classify a work as a Derivative Work; this extent is determined by + copyright law applicable in the country mentioned in Article 15. + +- The Work: the Original Work and/or its Derivative Works. + +- The Source Code: the human-readable form of the Work which is the most + convenient for people to study and modify. + +- The Executable Code: any code which has generally been compiled and which is + meant to be interpreted by a computer as a program. + +- The Licensor: the natural or legal person that distributes and/or communicates + the Work under the Licence. + +- Contributor(s): any natural or legal person who modifies the Work under the + Licence, or otherwise contributes to the creation of a Derivative Work. + +- The Licensee or “You”: any natural or legal person who makes any usage of the + Software under the terms of the Licence. + +- Distribution and/or Communication: any act of selling, giving, lending, + renting, distributing, communicating, transmitting, or otherwise making + available, on-line or off-line, copies of the Work or providing access to its + essential functionalities at the disposal of any other natural or legal + person. + + + +## 2. Scope of the rights granted by the Licence + +The Licensor hereby grants You a world-wide, royalty-free, non-exclusive, +sub-licensable licence to do the following, for the duration of copyright vested +in the Original Work: + +- use the Work in any circumstance and for all usage, reproduce the Work, modify +- the Original Work, and make Derivative Works based upon the Work, communicate +- to the public, including the right to make available or display the Work or +- copies thereof to the public and perform publicly, as the case may be, the +- Work, distribute the Work or copies thereof, lend and rent the Work or copies +- thereof, sub-license rights in the Work or copies thereof. + +Those rights can be exercised on any media, supports and formats, whether now +known or later invented, as far as the applicable law permits so. + +In the countries where moral rights apply, the Licensor waives his right to +exercise his moral right to the extent allowed by law in order to make effective +the licence of the economic rights here above listed. + +The Licensor grants to the Licensee royalty-free, non exclusive usage rights to +any patents held by the Licensor, to the extent necessary to make use of the +rights granted on the Work under this Licence. + + + +## 3. Communication of the Source Code + +The Licensor may provide the Work either in its Source Code form, or as +Executable Code. If the Work is provided as Executable Code, the Licensor +provides in addition a machine-readable copy of the Source Code of the Work +along with each copy of the Work that the Licensor distributes or indicates, in +a notice following the copyright notice attached to the Work, a repository where +the Source Code is easily and freely accessible for as long as the Licensor +continues to distribute and/or communicate the Work. + + + +## 4. Limitations on copyright + +Nothing in this Licence is intended to deprive the Licensee of the benefits from +any exception or limitation to the exclusive rights of the rights owners in the +Original Work or Software, of the exhaustion of those rights or of other +applicable limitations thereto. + + + +## 5. Obligations of the Licensee + +The grant of the rights mentioned above is subject to some restrictions and +obligations imposed on the Licensee. Those obligations are the following: + +Attribution right: the Licensee shall keep intact all copyright, patent or +trademarks notices and all notices that refer to the Licence and to the +disclaimer of warranties. The Licensee must include a copy of such notices and a +copy of the Licence with every copy of the Work he/she distributes and/or +communicates. The Licensee must cause any Derivative Work to carry prominent +notices stating that the Work has been modified and the date of modification. + +Copyleft clause: If the Licensee distributes and/or communicates copies of the +Original Works or Derivative Works based upon the Original Work, this +Distribution and/or Communication will be done under the terms of this Licence +or of a later version of this Licence unless the Original Work is expressly +distributed only under this version of the Licence. The Licensee (becoming +Licensor) cannot offer or impose any additional terms or conditions on the Work +or Derivative Work that alter or restrict the terms of the Licence. + +Compatibility clause: If the Licensee Distributes and/or Communicates Derivative +Works or copies thereof based upon both the Original Work and another work +licensed under a Compatible Licence, this Distribution and/or Communication can +be done under the terms of this Compatible Licence. For the sake of this clause, +“Compatible Licence” refers to the licences listed in the appendix attached to +this Licence. Should the Licensee’s obligations under the Compatible Licence +conflict with his/her obligations under this Licence, the obligations of the +Compatible Licence shall prevail. + +Provision of Source Code: When distributing and/or communicating copies of the +Work, the Licensee will provide a machine-readable copy of the Source Code or +indicate a repository where this Source will be easily and freely available for +as long as the Licensee continues to distribute and/or communicate the Work. + +Legal Protection: This Licence does not grant permission to use the trade names, +trademarks, service marks, or names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the copyright notice. + + + +## 6. Chain of Authorship + +The original Licensor warrants that the copyright in the Original Work granted +hereunder is owned by him/her or licensed to him/her and that he/she has the +power and authority to grant the Licence. + +Each Contributor warrants that the copyright in the modifications he/she brings +to the Work are owned by him/her or licensed to him/her and that he/she has the +power and authority to grant the Licence. + +Each time You accept the Licence, the original Licensor and subsequent +Contributors grant You a licence to their contributions to the Work, under the +terms of this Licence. + + + +## 7. Disclaimer of Warranty + +The Work is a work in progress, which is continuously improved by numerous +contributors. It is not a finished work and may therefore contain defects or +“bugs” inherent to this type of software development. + +For the above reason, the Work is provided under the Licence on an “as is” basis +and without warranties of any kind concerning the Work, including without +limitation merchantability, fitness for a particular purpose, absence of defects +or errors, accuracy, non-infringement of intellectual property rights other than +copyright as stated in Article 6 of this Licence. + +This disclaimer of warranty is an essential part of the Licence and a condition +for the grant of any rights to the Work. + + + +## 8. Disclaimer of Liability + +Except in the cases of wilful misconduct or damages directly caused to natural +persons, the Licensor will in no event be liable for any direct or indirect, +material or moral, damages of any kind, arising out of the Licence or of the use +of the Work, including without limitation, damages for loss of goodwill, work +stoppage, computer failure or malfunction, loss of data or any commercial +damage, even if the Licensor has been advised of the possibility of such +damage. However, the Licensor will be liable under statutory product liability +laws as far such laws apply to the Work. + + + +## 9. Additional agreements + +While distributing the Original Work or Derivative Works, You may choose to +conclude an additional agreement to offer, and charge a fee for, acceptance of +support, warranty, indemnity, or other liability obligations and/or services +consistent with this Licence. However, in accepting such obligations, You may +act only on your own behalf and on your sole responsibility, not on behalf of +the original Licensor or any other Contributor, and only if You agree to +indemnify, defend, and hold each Contributor harmless for any liability incurred +by, or claims asserted against such Contributor by the fact You have accepted +any such warranty or additional liability. + + + +## 10. Acceptance of the Licence + +The provisions of this Licence can be accepted by clicking on an icon “I agree” +placed under the bottom of a window displaying the text of this Licence or by +affirming consent in any other similar way, in accordance with the rules of +applicable law. Clicking on that icon indicates your clear and irrevocable +acceptance of this Licence and all of its terms and conditions. + +Similarly, you irrevocably accept this Licence and all of its terms and +conditions by exercising any rights granted to You by Article 2 of this Licence, +such as the use of the Work, the creation by You of a Derivative Work or the +Distribution and/or Communication by You of the Work or copies thereof. + + + +## 11. Information to the public + +In case of any Distribution and/or Communication of the Work by means of +electronic communication by You (for example, by offering to download the Work +from a remote location) the distribution channel or media (for example, a +website) must at least provide to the public the information requested by the +applicable law regarding the Licensor, the Licence and the way it may be +accessible, concluded, stored and reproduced by the Licensee. + + + +## 12. Termination of the Licence + +The Licence and the rights granted hereunder will terminate automatically upon +any breach by the Licensee of the terms of the Licence. + +Such a termination will not terminate the licences of any person who has +received the Work from the Licensee under the Licence, provided such persons +remain in full compliance with the Licence. + + + +## 13. Miscellaneous + +Without prejudice of Article 9 above, the Licence represents the complete +agreement between the Parties as to the Work licensed hereunder. + +If any provision of the Licence is invalid or unenforceable under applicable +law, this will not affect the validity or enforceability of the Licence as a +whole. Such provision will be construed and/or reformed so as necessary to make +it valid and enforceable. + +The European Commission may publish other linguistic versions and/or new +versions of this Licence, so far this is required and reasonable, without +reducing the scope of the rights granted by the Licence. New versions of the +Licence will be published with a unique version number. + +All linguistic versions of this Licence, approved by the European Commission, +have identical value. Parties can take advantage of the linguistic version of +their choice. + + + +## 14. Jurisdiction + +Any litigation resulting from the interpretation of this License, arising +between the European Commission, as a Licensor, and any Licensee, will be +subject to the jurisdiction of the Court of Justice of the European Communities, +as laid down in article 238 of the Treaty establishing the European Community. + +Any litigation arising between Parties, other than the European Commission, and +resulting from the interpretation of this License, will be subject to the +exclusive jurisdiction of the competent court where the Licensor resides or +conducts its primary business. + + + +## 15. Applicable Law + +This Licence shall be governed by the law of the European Union country where +the Licensor resides or has his registered office. + +This licence shall be governed by the Belgian law if: + +- a litigation arises between the European Commission, as a Licensor, and any +- Licensee; the Licensor, other than the European Commission, has no residence +- or registered office inside a European Union country. + + + +## Appendix + + + +“Compatible Licences” according to article 5 EUPL are: + + +- GNU General Public License (GNU GPL) v. 2 + +- Open Software License (OSL) v. 2.1, v. 3.0 + +- Common Public License v. 1.0 + +- Eclipse Public License v. 1.0 + +- Cecill v. 2.0 + diff --git a/README.md b/README.md new file mode 100644 index 0000000..5df5bc0 --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +Spatial Data Infrastucture - WS-Thredds +-------------------------------------------------- + +WS-Thredds is one of the subsystems forming the gCube Spatial Data Infrastructure Facilities. It aims to provide gCube Applications simplified feature in order to manage GeoSpatial Data and Metadata. + +## Built with +* [OpenJDK](https://openjdk.java.net/) - The JDK used +* [JAX-RS](https://github.com/eclipse-ee4j/jaxrs-api) - Java™ API for RESTful Web Services +* [Jersey](https://jersey.github.io/) - JAX-RS runtime +* [Maven](https://maven.apache.org/) - Dependency Management + +## Documentation + +Documentation can be found [here](https://gcube.wiki.gcube-system.org/gcube/SDI-Service). + +## Change log + +See [CHANGELOG.md](CHANGELOG.md). + +## 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); + diff --git a/distro/LICENSE b/distro/LICENSE deleted file mode 100644 index 2d9616a..0000000 --- a/distro/LICENSE +++ /dev/null @@ -1 +0,0 @@ -${gcube.license} \ No newline at end of file diff --git a/distro/README b/distro/README deleted file mode 100644 index 9ac47a3..0000000 --- a/distro/README +++ /dev/null @@ -1,65 +0,0 @@ -The gCube System - ${name} --------------------------------------------------- - -${description} - - -${gcube.description} - -${gcube.funding} - - -Version --------------------------------------------------- - -${version} (${buildDate}) - -Please see the file named "changelog.xml" in this directory for the release notes. - - - -Authors --------------------------------------------------- - -* Fabio Sinibaldi (fabio.sinibaldi-AT-isti.cnr.it) Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" - CNR, Pisa (Italy). - -Maintainers ------------ - -* Fabio Sinibaldi (fabio.sinibaldi-AT-isti.cnr.it) Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" - CNR, Pisa (Italy). - - -Download information --------------------------------------------------- - -Source code is available from SVN: - ${scm.url} - -Binaries can be downloaded from the gCube website: - ${gcube.website} - -Installation --------------------------------------------------- - -Installation documentation is available on-line in the gCube Wiki: - ${gcube.wikiRoot}/Tabular_Data_Manager - -Documentation --------------------------------------------------- - -Documentation is available on-line in the gCube Wiki: - ${gcube.wikiRoot}/Tabular_Data_Manager - ${gcube.wikiRoot}/Tabular_Data_Manager - - -Support --------------------------------------------------- - -Bugs and support requests can be reported in the gCube issue tracking tool: - ${gcube.issueTracking} - - -Licensing --------------------------------------------------- - -This software is licensed under the terms you may find in the file named "LICENSE" in this directory. \ No newline at end of file diff --git a/distro/changelog.xml b/distro/changelog.xml deleted file mode 100644 index b2f8291..0000000 --- a/distro/changelog.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - First Release - - - Cleanup folder fix - - \ No newline at end of file diff --git a/distro/descriptor.xml b/distro/descriptor.xml deleted file mode 100644 index dc46ade..0000000 --- a/distro/descriptor.xml +++ /dev/null @@ -1,30 +0,0 @@ - - servicearchive - - tar.gz - - / - - - ${distroDirectory} - / - true - - README - LICENSE - changelog.xml - - 755 - true - - - - - target/${build.finalName}.${project.packaging} - /${artifactId} - - - \ No newline at end of file diff --git a/distro/profile.xml b/distro/profile.xml deleted file mode 100644 index 703fb88..0000000 --- a/distro/profile.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - Service - - ${description} - Portlets - ${artifactId} - 1.0.0 - - - ${description} - ${artifactId} - ${version} - - ${groupId} - ${artifactId} - ${version} - - library - - ${build.finalName}.jar - - - - - - - diff --git a/pom.xml b/pom.xml index 96878d6..ebe28bc 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.gcube.spatial.data ws-thredds - 0.2.2 + 0.2.3-SNAPSHOT ws-thredds prototype of WS integration with data-transfer for Thredds pubblication @@ -56,12 +56,6 @@ [1.2.0-SNAPSHOT,2.0.0-SNAPSHOT) - - - org.gcube.common From 37ca2485af304c5093fd0ee72589798c4d83e44c Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Wed, 10 Mar 2021 15:49:11 +0100 Subject: [PATCH 2/8] 1.0.0 --- .classpath | 36 ------------- .settings/org.eclipse.jdt.core.prefs | 5 -- CHANGELOG.md | 4 +- pom.xml | 2 +- .../ws/thredds/engine/impl/Process.java | 11 ++-- .../engine/impl/ProcessDescriptor.java | 2 + .../ws/thredds/engine/impl/Security.java | 52 +++++++++++++++++++ .../thredds/engine/impl/SynchEngineImpl.java | 5 ++ .../engine/impl/WorkspaceFolderManager.java | 32 +++++++++--- .../impl/threads/SynchronizationThread.java | 2 +- .../thredds/faults/GenericWebException.java | 49 +++++++++++++++++ 11 files changed, 144 insertions(+), 56 deletions(-) delete mode 100644 .classpath delete mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 src/main/java/org/gcube/usecases/ws/thredds/engine/impl/Security.java create mode 100644 src/main/java/org/gcube/usecases/ws/thredds/faults/GenericWebException.java diff --git a/.classpath b/.classpath deleted file mode 100644 index fae1a2b..0000000 --- a/.classpath +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 714351a..0000000 --- a/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,5 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/CHANGELOG.md b/CHANGELOG.md index 65fc15e..91e4ae5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for org.gcube.spatial.data.sdi-service -## [v1.4.2-SNAPSHOT] 2020-05-15 +## [v1.0.0-SNAPSHOT] 2020-05-15 + + ### Fixes diff --git a/pom.xml b/pom.xml index ebe28bc..71ccb5d 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.gcube.spatial.data ws-thredds - 0.2.3-SNAPSHOT + 1.0.0-SNAPSHOT ws-thredds prototype of WS integration with data-transfer for Thredds pubblication diff --git a/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/Process.java b/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/Process.java index d3134d6..c2bba7b 100644 --- a/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/Process.java +++ b/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/Process.java @@ -59,14 +59,15 @@ public class Process { private CompletionCallback callback=null; public Process(String folderId,CompletionCallback callback) throws WorkspaceInteractionException, InternalException { - log.debug("Created Process with id {} ",processId); + String operator=Security.getToken(); + log.debug("Created Process with id {}, operator {} ",processId,operator); // this.folderId=folderId; manager=new WorkspaceFolderManager(folderId); manager.lock(processId); SynchFolderConfiguration folderConfig=manager.getSynchConfiguration(); - try { - descriptor=new ProcessDescriptor(folderId, manager.getTheFolder().get().getPath(),System.currentTimeMillis(),processId,folderConfig); + try { + descriptor=new ProcessDescriptor(folderId, manager.getTheFolder().get().getPath(),System.currentTimeMillis(),processId,operator,folderConfig); }catch(Exception e) { throw new WorkspaceInteractionException("Unable to read path from folder "+folderId,e); } @@ -225,7 +226,7 @@ public class Process { } String relativePath=toScanFolder.get().getMetadata().getMap().get(Constants.WorkspaceProperties.REMOTE_PATH)+""; - ThreddsController folderController=new ThreddsController(relativePath,config.getTargetToken()); + ThreddsController folderController=new ThreddsController(relativePath,ownerProcess.getDescriptor().getOperator()); RemoteFileDescriptor folderDesc=null; try{ @@ -305,7 +306,7 @@ public class Process { }catch(ItemNotFoundException e) { log.info("Creating folder {} under {} ",item,folderPath); folder=toScanFolder.newFolder(item, "Imported from thredds"); - WorkspaceUtils.initProperties(folder,relativePath+"/"+item , config.getFilter(), config.getTargetToken(),config.getToCreateCatalogName(),config.getValidateMetadata(),config.getRootFolderId()); + WorkspaceUtils.initProperties(folder,relativePath+"/"+item , config.getFilter(), ownerProcess.getDescriptor().getOperator(),config.getToCreateCatalogName(),config.getValidateMetadata(),config.getRootFolderId()); generateRequests(ownerProcess, service, folder); } diff --git a/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/ProcessDescriptor.java b/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/ProcessDescriptor.java index e7bc75a..d84d293 100644 --- a/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/ProcessDescriptor.java +++ b/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/ProcessDescriptor.java @@ -14,6 +14,8 @@ public class ProcessDescriptor implements Cloneable{ private long launchTime; private String processId; + private String operator; + private SynchFolderConfiguration synchConfiguration; @Override diff --git a/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/Security.java b/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/Security.java new file mode 100644 index 0000000..82840a2 --- /dev/null +++ b/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/Security.java @@ -0,0 +1,52 @@ +package org.gcube.usecases.ws.thredds.engine.impl; + +import static org.gcube.common.authorization.client.Constants.authorizationService; + +import org.gcube.common.authorization.client.exceptions.ObjectNotFound; +import org.gcube.common.authorization.library.AuthorizationEntry; +import org.gcube.common.authorization.library.provider.SecurityTokenProvider; +import org.gcube.common.scope.api.ScopeProvider; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class Security { + + public static String getCurrentScope(){ + try{ + String token=SecurityTokenProvider.instance.get(); + log.debug("Token is : "+token); + if(token==null) throw new Exception("Security Token is null"); + AuthorizationEntry entry = authorizationService().get(token); + return entry.getContext(); + }catch(Exception e ){ + log.debug("Unable to resolve token, checking scope provider..",e); + return ScopeProvider.instance.get(); + } +} + + + public static String getContext(String token) throws ObjectNotFound, Exception { + log.debug("Resolving token {} ",token); + AuthorizationEntry entry = authorizationService().get(token); + return entry.getContext(); + } + + public static String getToken() { + return SecurityTokenProvider.instance.get(); + } + + +public static String getCurrentCaller(){ + try{ + String token=SecurityTokenProvider.instance.get(); + log.debug("Token is : "+token); + if(token==null) throw new Exception("Security Token is null"); + AuthorizationEntry entry = authorizationService().get(token); + return entry.getClientInfo().getId(); + }catch(Exception e ){ + log.debug("Unable to resolve token, checking scope provider..",e); + return "Unidentified data-transfer user"; + } +} +} diff --git a/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/SynchEngineImpl.java b/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/SynchEngineImpl.java index 86d371a..f78dcf2 100644 --- a/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/SynchEngineImpl.java +++ b/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/SynchEngineImpl.java @@ -138,6 +138,11 @@ public class SynchEngineImpl implements SyncEngine{ if (!manager.isSynched()) throw new WorkspaceNotSynchedException("Folder "+folderId+" is not configured for synchronization."); if(manager.isLocked()) throw new WorkspaceLockedException("Folder "+folderId+"is locked by an external process."); if(!manager.isRoot()) throw new WorkspaceFolderNotRootException("Unable to launch synch operation. Folder "+folderId+" is not root configuration"); + + //TODO check context + //TODO set operating context +// if(manager.getSynchConfiguration().get) + Process toLaunch=new Process(folderId,completionCallback); localProcesses.put(folderId, toLaunch); initializationExecutor.submit(new ProcessInitializationThread(toLaunch,synchronizationExecutor)); diff --git a/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/WorkspaceFolderManager.java b/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/WorkspaceFolderManager.java index dae4da4..80fda61 100644 --- a/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/WorkspaceFolderManager.java +++ b/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/WorkspaceFolderManager.java @@ -51,9 +51,27 @@ public class WorkspaceFolderManager { private StorageHubClient sc; + + private String operator=null; + + private String getToken() { + if(operator==null) { + log.warn("******************Using config operator**********"); + return config.getTargetToken(); + } + else return operator; + } + + + + public WorkspaceFolderManager(String folderId) throws WorkspaceInteractionException { try{ // ws = HomeLibrary.getHomeManagerFactory().getHomeManager().getHome().getWorkspace(); + String operator=Security.getToken(); + log.debug("Setting operator "+operator); + this.operator=operator; + sc=WorkspaceUtils.getClient(); theFolder=sc.open(folderId).asFolder(); this.folderId=folderId; @@ -70,7 +88,7 @@ public class WorkspaceFolderManager { public ThreddsController getThreddsController() throws WorkspaceNotSynchedException, WorkspaceInteractionException, InternalException { if(threddsController==null) { SynchFolderConfiguration config=getSynchConfiguration(); - threddsController=new ThreddsController(config.getRemotePath(),config.getTargetToken()); + threddsController=new ThreddsController(config.getRemotePath(),getToken()); } return threddsController; } @@ -79,7 +97,7 @@ public class WorkspaceFolderManager { try { FolderContainer root=sc.open(getSynchConfiguration().getRootFolderId()).asFolder(); SynchFolderConfiguration rootConfig=WorkspaceUtils.loadConfiguration(root); - return new ThreddsController(rootConfig.getRemotePath(),rootConfig.getTargetToken()); + return new ThreddsController(rootConfig.getRemotePath(),getToken()); }catch(StorageHubException e) { throw new WorkspaceInteractionException(e); } @@ -116,7 +134,7 @@ public class WorkspaceFolderManager { SynchFolderConfiguration config=getSynchConfiguration(); try{ - checkFolder(theFolder,recursively,config,null,theFolder.getId(),WorkspaceUtils.safelyGetLastUpdate(theFolder.get())); + checkFolder(theFolder,recursively,config,null,theFolder.getId(),WorkspaceUtils.safelyGetLastUpdate(theFolder.get()),getToken()); return new SyncFolderDescriptor(this.folderId,this.theFolder.get().getPath(),config); }catch(StorageHubException e) { throw new WorkspaceInteractionException(e); @@ -151,7 +169,7 @@ public class WorkspaceFolderManager { try { String catalogName=toSet.getToCreateCatalogName(); - ThreddsController controller= new ThreddsController(toSet.getRemotePath(),toSet.getTargetToken()); + ThreddsController controller= new ThreddsController(toSet.getRemotePath(),getToken()); if(!controller.existsThreddsFile(null)) { log.info("Folder not found, creating it.."); controller.createEmptyFolder(null); @@ -241,7 +259,7 @@ public class WorkspaceFolderManager { - private static void checkFolder(FolderContainer folder,boolean recursive, SynchFolderConfiguration rootConfig, String relativePathFromRootFolder, String rootFolderId,Date lastUpdatedRoutine) throws StorageHubException, InternalException { + private static void checkFolder(FolderContainer folder,boolean recursive, SynchFolderConfiguration rootConfig, String relativePathFromRootFolder, String rootFolderId,Date lastUpdatedRoutine, String toUseToken) throws StorageHubException, InternalException { // Check folder configuration log.trace("Checking folder {} ",folder.get().getPath()); log.debug("Configuration is {}, relativePath is {} ",rootConfig,relativePathFromRootFolder); @@ -252,7 +270,7 @@ public class WorkspaceFolderManager { - ThreddsController controller=new ThreddsController(currentRemotePath, rootConfig.getTargetToken()); + ThreddsController controller=new ThreddsController(currentRemotePath, toUseToken); HashSet currentFolderExistingItem=new HashSet(); @@ -269,7 +287,7 @@ public class WorkspaceFolderManager { String itemRemotePath=currentRemotePath+"/"+itemName; if(item.getType().equals(ContainerType.FOLDER)) { if(recursive) - checkFolder((FolderContainer) item,recursive,rootConfig,itemRelativePath,rootFolderId,lastUpdatedRoutine); + checkFolder((FolderContainer) item,recursive,rootConfig,itemRelativePath,rootFolderId,lastUpdatedRoutine,toUseToken); else WorkspaceUtils.initProperties(item, itemRemotePath, rootConfig.getFilter(), rootConfig.getTargetToken(),rootConfig.getToCreateCatalogName(),rootConfig.getValidateMetadata(),rootFolderId); }else if(rootConfig.matchesFilter(itemName)) { if(!WorkspaceUtils.isConfigured(item.get())) diff --git a/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/threads/SynchronizationThread.java b/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/threads/SynchronizationThread.java index d79f756..f2b7176 100644 --- a/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/threads/SynchronizationThread.java +++ b/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/threads/SynchronizationThread.java @@ -73,7 +73,7 @@ public class SynchronizationThread implements Runnable { FolderContainer parentFolder=client.open(parentFolderItem.getId()).asFolder(); checkCancelledProcess(); SynchFolderConfiguration synchConfig=WorkspaceUtils.loadConfiguration(parentFolder); - ThreddsController controller=new ThreddsController(synchConfig.getRemotePath(), synchConfig.getTargetToken()); + ThreddsController controller=new ThreddsController(synchConfig.getRemotePath(), theRequest.getProcess().getDescriptor().getOperator()); if(theRequest instanceof TransferToThreddsRequest) { TransferToThreddsRequest request=(TransferToThreddsRequest) theRequest; diff --git a/src/main/java/org/gcube/usecases/ws/thredds/faults/GenericWebException.java b/src/main/java/org/gcube/usecases/ws/thredds/faults/GenericWebException.java new file mode 100644 index 0000000..33f3c36 --- /dev/null +++ b/src/main/java/org/gcube/usecases/ws/thredds/faults/GenericWebException.java @@ -0,0 +1,49 @@ +package org.gcube.usecases.ws.thredds.faults; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +@Getter +@Setter +@ToString(callSuper = true) +public class GenericWebException extends Exception{ + + + + /** + * + */ + private static final long serialVersionUID = 5200927893712698886L; + + private String remoteMessage=null; + + private Integer responseHTTPCode=0; + + public GenericWebException() { + super(); + // TODO Auto-generated constructor stub + } + + public GenericWebException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + // TODO Auto-generated constructor stub + } + + public GenericWebException(String message, Throwable cause) { + super(message, cause); + // TODO Auto-generated constructor stub + } + + public GenericWebException(String message) { + super(message); + // TODO Auto-generated constructor stub + } + + public GenericWebException(Throwable cause) { + super(cause); + // TODO Auto-generated constructor stub + } + + +} From 001390f6acc2e409ce1dc3101caeb3f98de123ba Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Wed, 10 Mar 2021 16:06:24 +0100 Subject: [PATCH 3/8] removed snapshot dependencies --- .settings/.gitignore | 1 + pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .settings/.gitignore diff --git a/.settings/.gitignore b/.settings/.gitignore new file mode 100644 index 0000000..3b1537c --- /dev/null +++ b/.settings/.gitignore @@ -0,0 +1 @@ +/org.eclipse.jdt.core.prefs diff --git a/pom.xml b/pom.xml index 71ccb5d..95a7673 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ org.gcube.spatial.data sdi-library - [1.0.0-SNAPSHOT,2.0.0-SNAPSHOT) + [1.0.0,2.0.0) com.fasterxml.jackson.core @@ -53,7 +53,7 @@ org.gcube.data.transfer data-transfer-library - [1.2.0-SNAPSHOT,2.0.0-SNAPSHOT) + [1.2.0,2.0.0) From 435599de5eb6d73f050fb43aefa840105c2249f3 Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Wed, 10 Mar 2021 17:59:10 +0100 Subject: [PATCH 4/8] Check context on doSync --- .../ws/thredds/engine/impl/Security.java | 61 ++++++++++--------- .../thredds/engine/impl/SynchEngineImpl.java | 12 +++- 2 files changed, 42 insertions(+), 31 deletions(-) diff --git a/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/Security.java b/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/Security.java index 82840a2..6212533 100644 --- a/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/Security.java +++ b/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/Security.java @@ -13,40 +13,45 @@ import lombok.extern.slf4j.Slf4j; public class Security { public static String getCurrentScope(){ - try{ - String token=SecurityTokenProvider.instance.get(); - log.debug("Token is : "+token); - if(token==null) throw new Exception("Security Token is null"); - AuthorizationEntry entry = authorizationService().get(token); - return entry.getContext(); - }catch(Exception e ){ - log.debug("Unable to resolve token, checking scope provider..",e); - return ScopeProvider.instance.get(); + try{ + String token=SecurityTokenProvider.instance.get(); + log.debug("Token is : "+token); + if(token==null) throw new Exception("Security Token is null"); + AuthorizationEntry entry = authorizationService().get(token); + return entry.getContext(); + }catch(Exception e ){ + log.debug("Unable to resolve token, checking scope provider..",e); + return ScopeProvider.instance.get(); + } } -} - - public static String getContext(String token) throws ObjectNotFound, Exception { - log.debug("Resolving token {} ",token); - AuthorizationEntry entry = authorizationService().get(token); - return entry.getContext(); + + public static String getContext(String token) { + try{ + log.debug("Resolving token {} ",token); + AuthorizationEntry entry = authorizationService().get(token); + return entry.getContext(); + }catch(Exception e) { + log.warn("Unable to resolve "+token,e); + return null; + } } - + public static String getToken() { return SecurityTokenProvider.instance.get(); } - -public static String getCurrentCaller(){ - try{ - String token=SecurityTokenProvider.instance.get(); - log.debug("Token is : "+token); - if(token==null) throw new Exception("Security Token is null"); - AuthorizationEntry entry = authorizationService().get(token); - return entry.getClientInfo().getId(); - }catch(Exception e ){ - log.debug("Unable to resolve token, checking scope provider..",e); - return "Unidentified data-transfer user"; + + public static String getCurrentCaller(){ + try{ + String token=SecurityTokenProvider.instance.get(); + log.debug("Token is : "+token); + if(token==null) throw new Exception("Security Token is null"); + AuthorizationEntry entry = authorizationService().get(token); + return entry.getClientInfo().getId(); + }catch(Exception e ){ + log.debug("Unable to resolve token, checking scope provider..",e); + return "Unidentified data-transfer user"; + } } } -} diff --git a/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/SynchEngineImpl.java b/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/SynchEngineImpl.java index f78dcf2..fc5b448 100644 --- a/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/SynchEngineImpl.java +++ b/src/main/java/org/gcube/usecases/ws/thredds/engine/impl/SynchEngineImpl.java @@ -11,6 +11,7 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; +import org.gcube.common.authorization.library.provider.SecurityTokenProvider; import org.gcube.data.transfer.model.plugins.thredds.DataSetScan; import org.gcube.data.transfer.model.plugins.thredds.ThreddsCatalog; import org.gcube.data.transfer.model.plugins.thredds.ThreddsInfo; @@ -139,9 +140,14 @@ public class SynchEngineImpl implements SyncEngine{ if(manager.isLocked()) throw new WorkspaceLockedException("Folder "+folderId+"is locked by an external process."); if(!manager.isRoot()) throw new WorkspaceFolderNotRootException("Unable to launch synch operation. Folder "+folderId+" is not root configuration"); - //TODO check context - //TODO set operating context -// if(manager.getSynchConfiguration().get) + String callerContext=Security.getCurrentScope(); + log.debug("Checking context. Caller is {} ",callerContext); + + String configurationContext=Security.getContext(manager.getSynchConfiguration().getTargetToken()); + + if(!callerContext.equals(configurationContext)) + throw new WorkspaceInteractionException("Cannot sync folder from context "+callerContext+". Expected context is "+configurationContext); + Process toLaunch=new Process(folderId,completionCallback); localProcesses.put(folderId, toLaunch); From 26add76452d597a87881e0fe5da9e59a91520b64 Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Mon, 15 Mar 2021 11:35:52 +0100 Subject: [PATCH 5/8] release --- CHANGELOG.md | 5 +++-- pom.xml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91e4ae5..09b9e66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -# Changelog for org.gcube.spatial.data.sdi-service +# Changelog for org.gcube.spatial.data.ws-thredds -## [v1.0.0-SNAPSHOT] 2020-05-15 +## [v1.0.0] 2020-05-15 +Internal improvements on token management ### Fixes diff --git a/pom.xml b/pom.xml index 95a7673..37b62bb 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.gcube.spatial.data ws-thredds - 1.0.0-SNAPSHOT + 1.0.0 ws-thredds prototype of WS integration with data-transfer for Thredds pubblication From 1eea6c06b989916fdd3afcd84ed4281a901402bd Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Mon, 15 Mar 2021 12:18:44 +0100 Subject: [PATCH 6/8] triggerin snapshot build --- CHANGELOG.md | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09b9e66..7242ef3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for org.gcube.spatial.data.ws-thredds -## [v1.0.0] 2020-05-15 +## [v1.0.0-SNAPSHOT] 2020-05-15 Internal improvements on token management diff --git a/pom.xml b/pom.xml index 37b62bb..95a7673 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.gcube.spatial.data ws-thredds - 1.0.0 + 1.0.0-SNAPSHOT ws-thredds prototype of WS integration with data-transfer for Thredds pubblication From 5d7d0a9d44d0f5b268e534b32e57051ef96136c0 Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Tue, 16 Mar 2021 18:36:50 +0100 Subject: [PATCH 7/8] reduced upperbound --- pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 95a7673..1dee721 100644 --- a/pom.xml +++ b/pom.xml @@ -41,13 +41,13 @@ org.gcube.spatial.data sdi-library - [1.0.0,2.0.0) - - - com.fasterxml.jackson.core - jackson-annotations - - + [1.0.0,1.3.0) + + + + + + From 9222f500b2e4231c170a854916e30794c0e1d96e Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Tue, 23 Mar 2021 18:04:54 +0100 Subject: [PATCH 8/8] tests log --- pom.xml | 18 ++++++++++++++++-- .../gcube/usecases/ws/thredds/TokenSetter.java | 7 +------ src/main/resources/logback.xml | 0 .../usecases/ws/thredds/DTSynchUseCase.java | 7 +++++-- .../gcube/usecases/ws/thredds/TestCommons.java | 4 ++-- src/{main => test}/resources/log4j.properties | 4 ++-- src/test/resources/logback.xml | 14 ++++++++++++++ 7 files changed, 40 insertions(+), 14 deletions(-) delete mode 100644 src/main/resources/logback.xml rename src/{main => test}/resources/log4j.properties (80%) create mode 100644 src/test/resources/logback.xml diff --git a/pom.xml b/pom.xml index 1dee721..f399184 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ org.gcube.distribution maven-portal-bom - 3.4.0 + 3.6.0 pom import @@ -41,7 +41,7 @@ org.gcube.spatial.data sdi-library - [1.0.0,1.3.0) + [1.0.0,2.0.0) @@ -67,6 +67,20 @@ slf4j-log4j12 + + + ch.qos.logback + logback-classic + 1.2.3 + test + + + junit + junit + 4.12 + test + + diff --git a/src/main/java/org/gcube/usecases/ws/thredds/TokenSetter.java b/src/main/java/org/gcube/usecases/ws/thredds/TokenSetter.java index 4253f33..78de3c8 100644 --- a/src/main/java/org/gcube/usecases/ws/thredds/TokenSetter.java +++ b/src/main/java/org/gcube/usecases/ws/thredds/TokenSetter.java @@ -21,7 +21,6 @@ public class TokenSetter { public static synchronized void set(String scope){ - try{ if(props==null) { props=new Properties(); try { @@ -30,12 +29,8 @@ public class TokenSetter { throw new RuntimeException("YOU NEED TO SET TOKEN FILE IN CONFIGURATION"); } } - if(!props.containsKey(scope)) throw new Exception("No token found for scope : "+scope); + if(!props.containsKey(scope)) throw new RuntimeException("No token found for scope : "+scope); SecurityTokenProvider.instance.set(props.getProperty(scope)); - }catch(Throwable e){ - log.trace("Unable to set token for scope "+scope,e); - } - ScopeProvider.instance.set(scope); } diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/java/org/gcube/usecases/ws/thredds/DTSynchUseCase.java b/src/test/java/org/gcube/usecases/ws/thredds/DTSynchUseCase.java index 0675951..ac5275b 100644 --- a/src/test/java/org/gcube/usecases/ws/thredds/DTSynchUseCase.java +++ b/src/test/java/org/gcube/usecases/ws/thredds/DTSynchUseCase.java @@ -14,10 +14,13 @@ import org.gcube.usecases.ws.thredds.model.SynchFolderConfiguration; public class DTSynchUseCase { public static void main(String[] args) throws WorkspaceInteractionException, InternalException, ProcessNotFoundException { - TokenSetter.set("/d4science.research-infrastructures.eu"); +// TokenSetter.set("/d4science.research-infrastructures.eu"); +// String folderId="a8cd78d3-69e8-4d02-ac90-681b2d16d84d"; + + TokenSetter.set("/gcube/devsec/devVRE"); + String folderId="8ebe9ffb-e2cf-4b3e-ab91-cc6933d86625"; SyncEngine engine=SyncEngine.get(); - String folderId="a8cd78d3-69e8-4d02-ac90-681b2d16d84d"; // String folderId="8a6f9749-68d7-4a9a-a475-bd645050c3fd"; // sub folder for faster tests diff --git a/src/test/java/org/gcube/usecases/ws/thredds/TestCommons.java b/src/test/java/org/gcube/usecases/ws/thredds/TestCommons.java index 3200c5f..464309a 100644 --- a/src/test/java/org/gcube/usecases/ws/thredds/TestCommons.java +++ b/src/test/java/org/gcube/usecases/ws/thredds/TestCommons.java @@ -37,7 +37,7 @@ public class TestCommons { private static Map configs=new HashMap<>(); - private static String toUseConfig="default"; + private static String toUseConfig="simple"; static { @@ -46,7 +46,7 @@ public class TestCommons { // folderName="WS-Tests"; - configs.put("simple", new TestSet("Simple label ","/gcube", "Test1","public/netcdf/simpleFolder","***REMOVED***","simple")); + configs.put("simple", new TestSet("Simple label ","/gcube/devsec/devVRE", "Test1","public/netcdf/simpleFolder","***REMOVED***","simple")); configs.put("cmems", new TestSet("CMEMS","/gcube", "CMEMS","public/netcdf/CMEMS","***REMOVED***","cmems")); configs.put("default", new TestSet("Default Tests","/gcube","Thredds Catalog","public/netcdf","***REMOVED***","main")); diff --git a/src/main/resources/log4j.properties b/src/test/resources/log4j.properties similarity index 80% rename from src/main/resources/log4j.properties rename to src/test/resources/log4j.properties index 38535ae..5d16a34 100644 --- a/src/main/resources/log4j.properties +++ b/src/test/resources/log4j.properties @@ -1,6 +1,6 @@ # Root logger option -#log4j.rootLogger=INFO, SM -log4j.logger.org.gcube.usecases.ws=DEBUG,SM +log4j.rootLogger=DEBUG, SM +#log4j.logger.org.gcube.usecases.ws=DEBUG,SM diff --git a/src/test/resources/logback.xml b/src/test/resources/logback.xml new file mode 100644 index 0000000..b70dd26 --- /dev/null +++ b/src/test/resources/logback.xml @@ -0,0 +1,14 @@ + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + \ No newline at end of file