Skip to content
Snippets Groups Projects
Commit 0701b238 authored by felmer's avatar felmer
Browse files

Merge branch 'master' of sissource.ethz.ch:sis/openbis

parents bd906dd2 b903356d
No related branches found
No related tags found
No related merge requests found
## MICROSERVICE SERVER ##
# Introduction #
This project holds is supposed to be used to developed Java micro services.
# 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).
# Build #
./gradlew distZip
The build will be found at ./build/distributions/microservice-server.zip
# Startup #
Unzip the build and execute
./bin/microservice-server
# Main packages #
## ch.ethz.sis.microservices.api ##
Supposed to contain only immutable DTOs annotated with lombok's @Data.
## ch.ethz.sis.microservices.server.json ##
JSON object mapper interface and implementations.
## ch.ethz.sis.microservices.server.logging ##
Logging interface and implementation.
## ch.ethz.sis.microservices.server.services ##
Service interface and implementation.
## ch.ethz.sis.microservices.server.startup ##
Main class and launcher.
## ch.ethz.sis.microservices.util ##
Utility classes.
# Configuration #
The json configuration file currently have two sections.
{
"port" : 8080,
"services" : []
}
The port used by the web server and a list of Services.
## ch.ethz.sis.microservices.server.services.store.FileInfoHandler ##
{
"className" : "ch.ethz.sis.microservices.server.services.store.FileInfoHandler",
"url" : "/file-information",
"parameters" : {
"openbis-url" : "http://localhost:8888/openbis/openbis/rmi-application-server-v3",
"datastore-url" : "http://localhost:8889/datastore_server/rmi-data-store-server-v3",
"services-timeout" : "10000",
"allowedExternalDMSCode" : "ADMIN-BS-MBPR28.D.ETHZ.CH-E96954A7",
"allowedContentCopyPath" : "/Users/localadmin/obis_data/"
}
}
## ch.ethz.sis.microservices.server.services.store.DownloadHandler ##
{
"className" : "ch.ethz.sis.microservices.server.services.store.DownloadHandler",
"url" : "/download",
"parameters" : {
"openbis-url" : "http://localhost:8888/openbis/openbis/rmi-application-server-v3",
"datastore-url" : "http://localhost:8889/datastore_server/rmi-data-store-server-v3",
"services-timeout" : "10000",
"allowedExternalDMSCode" : "ADMIN-BS-MBPR28.D.ETHZ.CH-E96954A7",
"allowedContentCopyPath" : "/Users/localadmin/obis_data/"
}
}
\ No newline at end of file
......@@ -25,7 +25,7 @@ dependencies {
}
mainClassName = "ch.ethz.sis.microservices.download.server.startup.Main"
mainClassName = "ch.ethz.sis.microservices.server.startup.Main"
distZip {
into(project.name) {
......
......@@ -27,7 +27,14 @@ public class Main
if (args.length < 1)
{
configFile = new File("./conf/config.json");
logger.info("No arguments given, starting with default config file: " + (configFile.getAbsolutePath()));
if(configFile.exists()) {
logger.info("No arguments given, starting with default config file: " + (configFile.getAbsolutePath()));
} else {
configFile = new File("./config.json");
if(configFile.exists()) {
logger.info("No arguments given, starting with default config file: " + (configFile.getAbsolutePath()));
}
}
} else
{
configFile = new File(args[0]);
......
package ch.ethz.sis.microservices.server.startup;
package ch.ethz.sis.microservices.util;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
......
......@@ -5,7 +5,7 @@ import java.util.Map;
import ch.ethz.sis.microservices.server.logging.LogManager;
import ch.ethz.sis.microservices.server.logging.log4j.Log4J2LogFactory;
import ch.ethz.sis.microservices.server.startup.HttpClient;
import ch.ethz.sis.microservices.util.HttpClient;
import ch.ethz.sis.openbis.generic.asapi.v3.IApplicationServerApi;
import ch.systemsx.cisd.common.spring.HttpInvokerUtils;
......
......@@ -25,7 +25,8 @@ import ch.systemsx.cisd.common.exceptions.UserFailureException;
*/
public final class UndefinedSpaceException extends UserFailureException
{
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
private final static String MESSAGE = "Space not specified, home space unknown";
......@@ -33,4 +34,5 @@ public final class UndefinedSpaceException extends UserFailureException
{
super(MESSAGE);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment