From b8d8585eab53489037554e4314301b797c423edb Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Mon, 18 Jul 2022 15:48:14 +0200 Subject: [PATCH] DB connection is created at startup --- .../resourceregistry/ResourceInitializer.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/ResourceInitializer.java b/src/main/java/org/gcube/informationsystem/resourceregistry/ResourceInitializer.java index ff36232..c484721 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/ResourceInitializer.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/ResourceInitializer.java @@ -3,8 +3,11 @@ package org.gcube.informationsystem.resourceregistry; import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.MediaType; +import org.gcube.informationsystem.resourceregistry.dbinitialization.DatabaseEnvironment; import org.gcube.informationsystem.resourceregistry.rest.Access; import org.glassfish.jersey.server.ResourceConfig; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @author Luca Frosini (ISTI - CNR) @@ -12,10 +15,15 @@ import org.glassfish.jersey.server.ResourceConfig; @ApplicationPath("/") public class ResourceInitializer extends ResourceConfig { + private static Logger logger = LoggerFactory.getLogger(ResourceInitializer.class); + public static final String APPLICATION_JSON_CHARSET_UTF_8 = MediaType.APPLICATION_JSON + ";charset=UTF-8"; + + public ResourceInitializer() { packages(Access.class.getPackage().toString()); + logger.info("The server is going to use OrientDB at {}", DatabaseEnvironment.DB_URI); } }