Commit 0e917e76 authored by Mingyang Zhu's avatar Mingyang Zhu
Browse files

upgrade core-common lib and apply getSuppressException method

parent bb035710
......@@ -39,7 +39,7 @@
<aws.version>1.11.637</aws.version>
<deployment.environment>dev</deployment.environment>
<version.number>0.0.4-SNAPSHOT</version.number>
<osdu.oscorecommon.version>0.9.0-rc4</osdu.oscorecommon.version>
<osdu.oscorecommon.version>0.9.1-SNAPSHOT</osdu.oscorecommon.version>
</properties>
<dependencies>
......
......@@ -37,7 +37,7 @@
<project.main.basedir>${project.parent.basedir}</project.main.basedir>
<springboot.version>2.1.7.RELEASE</springboot.version>
<osdu.corelibazure.version>0.9.0-rc1</osdu.corelibazure.version>
<osdu.oscorecommon.version>0.9.0-rc4</osdu.oscorecommon.version>
<osdu.oscorecommon.version>0.9.1-SNAPSHOT</osdu.oscorecommon.version>
<osdu.search-core.version>0.9.0-SNAPSHOT</osdu.search-core.version>
<spatial4j.version>0.7</spatial4j.version>
<jts-io-common.version>1.15.0</jts-io-common.version>
......
......@@ -17,16 +17,23 @@ package org.opengroup.osdu.search.provider.azure.cache.impl;
import javax.annotation.Resource;
import org.opengroup.osdu.core.common.cache.ICache;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.search.CursorSettings;
import org.opengroup.osdu.search.cache.CursorCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Optional;
@Component
public class CursorCacheImpl implements CursorCache {
@Resource(name = "cursorCache")
private ICache<String, CursorSettings> cache;
@Autowired
private JaxRsDpsLog log;
@Override
public void put(String s, CursorSettings o) {
this.cache.put(s, o);
......@@ -34,7 +41,7 @@ public class CursorCacheImpl implements CursorCache {
@Override
public CursorSettings get(String s) {
return this.cache.get(s);
return this.cache.getSuppressException(s, Optional.of(this.log));
}
@Override
......
......@@ -18,10 +18,14 @@ import javax.annotation.Resource;
import org.opengroup.osdu.azure.cache.ElasticCredentialsCache;
import org.opengroup.osdu.core.common.cache.ICache;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.search.ClusterSettings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import java.util.Optional;
@Component("clusterSettingsCache")
@ConditionalOnProperty(value = "cache.provider", havingValue = "redis")
public class ElasticCredentialsCacheImpl extends ElasticCredentialsCache {
......@@ -29,6 +33,9 @@ public class ElasticCredentialsCacheImpl extends ElasticCredentialsCache {
@Resource(name = "clusterCache")
private ICache<String, ClusterSettings> cache;
@Autowired
private JaxRsDpsLog log;
@Override
public void put(String s, ClusterSettings o) {
this.cache.put(s, o);
......@@ -36,7 +43,7 @@ public class ElasticCredentialsCacheImpl extends ElasticCredentialsCache {
@Override
public ClusterSettings get(String s) {
return this.cache.get(s);
return this.cache.getSuppressException(s, Optional.of(this.log));
}
@Override
......
......@@ -48,7 +48,7 @@
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-core-common</artifactId>
<version>0.9.0-rc4</version>
<version>0.9.1-SNAPSHOT</version>
</dependency>
<dependency>
......
......@@ -25,7 +25,7 @@
<properties>
<os-core-lib-ibm.version>0.9.0-SNAPSHOT</os-core-lib-ibm.version>
<start-class>org.opengroup.osdu.search.provider.ibm.app.SearchIBMApplication</start-class>
<osdu.oscorecommon.version>0.9.0-rc4</osdu.oscorecommon.version>
<osdu.oscorecommon.version>0.9.1-SNAPSHOT</osdu.oscorecommon.version>
</properties>
......
......@@ -33,7 +33,7 @@
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-core-common</artifactId>
<version>0.9.0-rc4</version>
<version>0.9.1-SNAPSHOT</version>
</dependency>
<dependency>
......
......@@ -33,6 +33,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
@Service
......@@ -136,7 +137,7 @@ public class EntitlementsAndCacheServiceImpl implements IEntitlementsExtensionSe
@Override
public Groups getGroups(DpsHeaders headers) {
String cacheKey = this.getGroupCacheKey(headers);
Groups groups = this.cache.get(cacheKey);
Groups groups = this.cache.getSuppressException(cacheKey, Optional.of(this.logger));
if (groups == null) {
IEntitlementsService service = this.factory.create(headers);
......
......@@ -25,7 +25,7 @@
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-core-common</artifactId>
<version>0.9.0-rc4</version>
<version>0.9.1-SNAPSHOT</version>
</dependency>
<dependency>
......
Supports Markdown
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