Commit 0bc0d086 authored by LAVENIER's avatar LAVENIER
Browse files

Merge branch 'release/1.6.1'

parents cb9150c7 322871bf
......@@ -3,7 +3,7 @@
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.6.0</version>
<version>1.6.1</version>
<packaging>pom</packaging>
<name>SUMARiS</name>
<description>SUMARiS :: Maven parent</description>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.6.0</version>
<version>1.6.1</version>
</parent>
<artifactId>sumaris-core-extraction</artifactId>
......
......@@ -22,6 +22,7 @@
package net.sumaris.core.extraction.cache;
import net.sf.ehcache.CacheManager;
import net.sumaris.core.dao.cache.CacheConfiguration;
import net.sumaris.core.dao.technical.ehcache.Caches;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -32,7 +33,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@ConditionalOnBean({org.springframework.cache.CacheManager.class})
@ConditionalOnBean({CacheConfiguration.class})
public class ExtractionCacheConfiguration {
/**
* Logger.
......@@ -40,9 +41,14 @@ public class ExtractionCacheConfiguration {
protected static final Logger log =
LoggerFactory.getLogger(ExtractionCacheConfiguration.class);
@Autowired
protected CacheManager cacheManager;
@Autowired
protected ExtractionCacheConfiguration(CacheConfiguration cacheConfiguration) {
this.cacheManager = cacheConfiguration.getCacheManager();
log.info("Adding {Extraction} caches...");
}
@Bean
public EhCacheFactoryBean aggregationTypeById() {
return Caches.createHeapCache(cacheManager, ExtractionCacheNames.AGGREGATION_TYPE_BY_ID, 1500, 1500, 100);
......
......@@ -119,7 +119,7 @@ public class ExtractionRestController {
@PostConstruct
public void init() {
log.info("Starting Extraction endpoint {{}}...", BASE_PATH);
log.info("Starting extraction endpoint {{}}...", BASE_PATH);
}
@GetMapping(
......
......@@ -3,7 +3,7 @@
<parent>
<artifactId>sumaris-pod</artifactId>
<groupId>net.sumaris</groupId>
<version>1.6.0</version>
<version>1.6.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -3,7 +3,7 @@
<parent>
<artifactId>sumaris-pod</artifactId>
<groupId>net.sumaris</groupId>
<version>1.6.0</version>
<version>1.6.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -22,6 +22,7 @@
package net.sumaris.rdf.cache;
import net.sf.ehcache.CacheManager;
import net.sumaris.core.dao.cache.CacheConfiguration;
import net.sumaris.core.dao.technical.ehcache.Caches;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -32,7 +33,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@ConditionalOnBean({org.springframework.cache.CacheManager.class})
@ConditionalOnBean({CacheConfiguration.class})
public class RdfCacheConfiguration {
/**
* Logger.
......@@ -40,9 +41,14 @@ public class RdfCacheConfiguration {
protected static final Logger log =
LoggerFactory.getLogger(RdfCacheConfiguration.class);
@Autowired
protected CacheManager cacheManager;
@Autowired
protected RdfCacheConfiguration(CacheConfiguration cacheConfiguration) {
this.cacheManager = cacheConfiguration.getCacheManager();
log.info("Adding {RDF} caches...");
}
@Bean
public EhCacheFactoryBean ontologyByNameCache() {
return Caches.createHeapCache(cacheManager, RdfCacheNames.ONTOLOGY_BY_NAME, 1500, 1500, 600);
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.6.0</version>
<version>1.6.1</version>
</parent>
<artifactId>sumaris-core-shared</artifactId>
......
......@@ -238,10 +238,10 @@ public class SumarisConfiguration extends PropertyPlaceholderConfigurer {
String dbTimeZone = applicationConfig.getOption(SumarisConfigurationOption.DB_TIMEZONE.getKey());
if (StringUtils.isNotBlank(dbTimeZone)) {
if (log.isInfoEnabled()) {
log.info(String.format("Using timezone [%s] for database", dbTimeZone));
log.info("Using timezone {{}} for database", dbTimeZone);
}
} else if (log.isInfoEnabled()) {
log.info(String.format("Using default timezone [%s] for database", System.getProperty("user.timezone")));
log.info("Using default timezone {{}} for database", System.getProperty("user.timezone"));
}
}
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.6.0</version>
<version>1.6.1</version>
</parent>
<artifactId>sumaris-core</artifactId>
......
......@@ -51,10 +51,14 @@ public class CacheConfiguration {
@PostConstruct
protected void init() {
if (this.cacheManager == null) {
log.info("Starting cache manager...");
this.cacheManager = ehcache();
}
log.info("Starting cache manager...");
if (this.cacheManager == null) this.cacheManager = ehcache();
log.info("Adding {Core} caches...");
}
public CacheManager getCacheManager() {
return this.cacheManager;
}
@Bean(name="ehcacheFactory")
......@@ -190,10 +194,9 @@ public class CacheConfiguration {
return Caches.createHeapCache(ehcache(), CacheNames.TABLE_META_BY_NAME, CacheDurations.DEFAULT, CacheDurations.DEFAULT, 500);
}
/* -- protected methods -- */
/* protected */
protected CacheManager ehcache() {
return cacheManager != null ? cacheManager : ehcacheFactory().getObject();
return (cacheManager != null) ? cacheManager : ehcacheFactory().getObject();
}
}
......@@ -4,7 +4,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.6.0</version>
<version>1.6.1</version>
</parent>
<artifactId>sumaris-server</artifactId>
......
......@@ -294,18 +294,18 @@ public class SumarisServerConfiguration extends SumarisConfiguration {
String timeZone = applicationConfig.getOption(SumarisConfigurationOption.TIMEZONE.getKey());
if (StringUtils.isNotBlank(timeZone)) {
log.info(String.format("Using timezone [%s]", timeZone));
log.info("Using timezone {{}}", timeZone);
TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
System.setProperty("user.timezone", timeZone);
} else {
log.info(String.format("Using default timezone [%s]", System.getProperty("user.timezone")));
log.info("Using default timezone {{}}", System.getProperty("user.timezone"));
}
String dbTimeZone = applicationConfig.getOption(SumarisConfigurationOption.DB_TIMEZONE.getKey());
if (StringUtils.isNotBlank(dbTimeZone)) {
log.info(String.format("Using timezone [%s] for database", dbTimeZone));
log.info("Using timezone {{}} for database", dbTimeZone);
} else {
log.info(String.format("Using default timezone [%s] for database", System.getProperty("user.timezone")));
log.info("Using default timezone {{}} for database", System.getProperty("user.timezone"));
}
}
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.6.0</version>
<version>1.6.1</version>
</parent>
<artifactId>sumaris-test-shared</artifactId>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment