DB connection is created at startup

This commit is contained in:
Luca Frosini 2022-07-18 15:48:14 +02:00
parent 4ad9d87ab0
commit b8d8585eab
1 changed files with 8 additions and 0 deletions

View File

@ -3,8 +3,11 @@ package org.gcube.informationsystem.resourceregistry;
import javax.ws.rs.ApplicationPath; import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import org.gcube.informationsystem.resourceregistry.dbinitialization.DatabaseEnvironment;
import org.gcube.informationsystem.resourceregistry.rest.Access; import org.gcube.informationsystem.resourceregistry.rest.Access;
import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.server.ResourceConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* @author Luca Frosini (ISTI - CNR) * @author Luca Frosini (ISTI - CNR)
@ -12,10 +15,15 @@ import org.glassfish.jersey.server.ResourceConfig;
@ApplicationPath("/") @ApplicationPath("/")
public class ResourceInitializer extends ResourceConfig { 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 static final String APPLICATION_JSON_CHARSET_UTF_8 = MediaType.APPLICATION_JSON + ";charset=UTF-8";
public ResourceInitializer() { public ResourceInitializer() {
packages(Access.class.getPackage().toString()); packages(Access.class.getPackage().toString());
logger.info("The server is going to use OrientDB at {}", DatabaseEnvironment.DB_URI);
} }
} }