This project holds is supposed to be used to developed Java micro services.
This project holds is supposed to be used to developed Java micro services.
# Configuration #
## Configuration ##
A json file with the configuration should be given during the startup as an argument, if not given the default "config.json" will be loaded (mostly used for distribution) and if not found "./conf/config.json" is loaded (mostly used for development).
A json file with the configuration should be given during the startup as an argument, if not given the default "config.json" will be loaded (mostly used for distribution) and if not found "./conf/config.json" is loaded (mostly used for development).
# Build #
## Build ##
./gradlew distZip
./gradlew distZip
The build will be found at ./build/distributions/microservice-server.zip
The build will be found at ./build/distributions/microservice-server.zip
# Startup #
## Startup ##
Unzip the build and execute
Unzip the build and execute
./bin/microservice-server
./bin/microservice-server
# Main packages #
## Main packages ##
## ch.ethz.sis.microservices.api ##
### ch.ethz.sis.microservices.api ###
Supposed to contain only immutable DTOs annotated with lombok's @Data.
Supposed to contain only immutable DTOs annotated with lombok's @Data.
## ch.ethz.sis.microservices.server.json ##
### ch.ethz.sis.microservices.server.json ###
JSON object mapper interface and implementations.
JSON object mapper interface and implementations.
## ch.ethz.sis.microservices.server.logging ##
### ch.ethz.sis.microservices.server.logging ###
Logging interface and implementation.
Logging interface and implementation.
## ch.ethz.sis.microservices.server.services ##
### ch.ethz.sis.microservices.server.services ###
Service interface and implementation.
Service interface and implementation.
## ch.ethz.sis.microservices.server.startup ##
### ch.ethz.sis.microservices.server.startup ###
Main class and launcher.
Main class and launcher.
## ch.ethz.sis.microservices.util ##
### ch.ethz.sis.microservices.util ###
Utility classes.
Utility classes.
# Configuration #
## Services description and configuration ##
The json configuration file currently have two sections.
The config.json configuration file currently has two sections:
port : The port where the web server starts.
services : A list of services.
To configure a service two parameters are mandatory:
className : Complete Java class name with packages.
url : URL for the service, since all services share the same web server port.
One parameter is optional:
parameters : Additional parameters for the service.
openbis-url : Server where is validated that the user sessionToken can retrieve the dataset.
datastore-url : Server where is validated that the user sessionToken can retrieve the file and that the file exists for the given dataset.
services-timeout : Timeout when making calls to openBIS or DSS.
allowedExternalDMSCode : Allowed External DMS code, with the current implementation only one EDMS is possible for the service.
allowedContentCopyPath : Allowed directory where dataset files should be present, trying to access outside of this directory giving relative paths will result in failure.