Commit f30d0570 authored by Rostislav Vatolin [SLB]'s avatar Rostislav Vatolin [SLB]
Browse files

Merge remote-tracking branch 'upstream/master' into setup-hpa

parents d651a8e8 2f0c209b
Pipeline #75632 failed with stages
in 20 minutes and 43 seconds
......@@ -289,8 +289,8 @@ The following software have components provided under the terms of this license:
- AWS SDK for Java - Models (from https://aws.amazon.com/sdkforjava)
- Adapter: RxJava (from https://repo1.maven.org/maven2/com/squareup/retrofit2/adapter-rxjava)
- Apache Ant + JUnit (from http://ant.apache.org/)
- Apache Ant Core (from https://ant.apache.org/)
- Apache Ant Launcher (from https://ant.apache.org/)
- Apache Ant Core (from http://ant.apache.org/)
- Apache Ant Launcher (from http://ant.apache.org/)
- Apache Commons BeanUtils (from http://commons.apache.org/proper/commons-beanutils/)
- Apache Commons CLI (from https://commons.apache.org/proper/commons-cli/)
- Apache Commons Codec (from https://commons.apache.org/proper/commons-codec/)
......@@ -304,9 +304,11 @@ The following software have components provided under the terms of this license:
- Apache Log4j JUL Adapter (from https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-jul)
- Apache Log4j SLF4J Binding (from https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-slf4j-impl)
- Apache Log4j to SLF4J Adapter (from https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-to-slf4j)
- Apache Maven Invoker (from https://repo1.maven.org/maven2/org/apache/maven/shared/maven-invoker)
- Apache Maven Wagon :: API (from https://repo1.maven.org/maven2/org/apache/maven/wagon/wagon-provider-api)
- Apache Maven Wagon :: Providers :: File Provider (from https://repo1.maven.org/maven2/org/apache/maven/wagon/wagon-file)
- Apache Maven Wagon :: Providers :: HTTP Shared Library (from https://repo1.maven.org/maven2/org/apache/maven/wagon/wagon-http-shared)
- Apache Maven Wagon :: Providers :: Lightweight HTTP Provider (from https://repo1.maven.org/maven2/org/apache/maven/wagon/wagon-http-lightweight)
- Apache Maven Wagon :: Providers :: SSH Common Library (from https://repo1.maven.org/maven2/org/apache/maven/wagon/wagon-ssh-common)
- Apache Maven Wagon :: Providers :: SSH External Provider (from https://repo1.maven.org/maven2/org/apache/maven/wagon/wagon-ssh-external)
- Apache Maven Wagon :: Providers :: SSH Provider (from https://repo1.maven.org/maven2/org/apache/maven/wagon/wagon-ssh)
......@@ -323,7 +325,7 @@ The following software have components provided under the terms of this license:
- Brave Instrumentation: Http Adapters (from https://repo1.maven.org/maven2/io/zipkin/brave/brave-instrumentation-http)
- Brave instrumentation for Reactor Netty HTTP (from https://github.com/reactor/reactor-netty)
- Byte Buddy (without dependencies) (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy)
- Byte Buddy agent (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent)
- Byte Buddy Java agent (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent)
- ClassMate (from http://github.com/cowtowncoder/java-classmate)
- Cloud Key Management Service (KMS) API v1-rev20210820-1.32.1 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms)
- Cloud Storage JSON API v1-rev20210918-1.32.1 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage)
......@@ -389,15 +391,15 @@ The following software have components provided under the terms of this license:
- Jackson datatype: JSR310 (from https://repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jsr310)
- Jackson datatype: jdk8 (from https://repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jdk8)
- Jackson extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-jackson)
- Jackson module: Afterburner (from https://github.com/FasterXML/jackson-modules-base)
- Jackson module: Old JAXB Annotations (javax.xml.bind) (from https://github.com/FasterXML/jackson-modules-base)
- Jackson-annotations (from http://github.com/FasterXML/jackson)
- Jackson-annotations (from http://github.com/FasterXML/jackson)
- Jackson-core (from https://github.com/FasterXML/jackson)
- Jackson-core (from https://github.com/FasterXML/jackson)
- Jackson-dataformat-XML (from http://wiki.fasterxml.com/JacksonExtensionXmlDataBinding)
- Jackson-dataformat-YAML (from https://github.com/FasterXML/jackson)
- Jackson-dataformat-YAML (from http://wiki.fasterxml.com/JacksonExtensionYAML)
- Jackson-datatype-Joda (from http://wiki.fasterxml.com/JacksonModuleJoda)
- Jackson-module-Afterburner (from http://wiki.fasterxml.com/JacksonHome)
- Jackson-module-JAXB-annotations (from http://wiki.fasterxml.com/JacksonJAXBAnnotations)
- Jackson-module-parameter-names (from https://repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-parameter-names)
- Jakarta Bean Validation API (from https://beanvalidation.org)
- Jakarta Expression Language Implementation (from https://projects.eclipse.org/projects/ee4j.el)
......@@ -428,7 +430,6 @@ The following software have components provided under the terms of this license:
- Maven Artifact Manager (from https://repo1.maven.org/maven2/org/apache/maven/maven-artifact-manager)
- Maven Core (from https://repo1.maven.org/maven2/org/apache/maven/maven-core)
- Maven Error Diagnostics (from https://repo1.maven.org/maven2/org/apache/maven/maven-error-diagnostics)
- Maven Invoker (from https://repo1.maven.org/maven2/org/apache/maven/shared/maven-invoker)
- Maven Model (from https://repo1.maven.org/maven2/org/apache/maven/maven-model)
- Maven Monitor (from https://repo1.maven.org/maven2/org/apache/maven/maven-monitor)
- Maven Plugin API (from https://repo1.maven.org/maven2/org/apache/maven/maven-plugin-api)
......@@ -441,7 +442,6 @@ The following software have components provided under the terms of this license:
- Maven Reporting Implementation (from https://repo1.maven.org/maven2/org/apache/maven/reporting/maven-reporting-impl)
- Maven Repository Metadata Model (from https://repo1.maven.org/maven2/org/apache/maven/maven-repository-metadata)
- Maven Settings (from https://repo1.maven.org/maven2/org/apache/maven/maven-settings)
- Maven Wagon Lightweight HTTP Provider (from https://repo1.maven.org/maven2/org/apache/maven/wagon/wagon-http-lightweight)
- Metrics Core (from https://repo1.maven.org/maven2/io/dropwizard/metrics/metrics-core)
- Microsoft Application Insights Java SDK Core (from https://github.com/Microsoft/ApplicationInsights-Java)
- Microsoft Application Insights Java SDK Spring Boot starter (from https://github.com/Microsoft/ApplicationInsights-Java)
......@@ -478,6 +478,7 @@ The following software have components provided under the terms of this license:
- OkHttp (from https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp)
- OkHttp Logging Interceptor (from https://repo1.maven.org/maven2/com/squareup/okhttp3/logging-interceptor)
- OkHttp URLConnection (from https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp-urlconnection)
- Okio (from https://repo1.maven.org/maven2/com/squareup/okio/okio)
- OpenCensus (from https://github.com/census-instrumentation/opencensus-java)
- OpenCensus (from https://github.com/census-instrumentation/opencensus-java)
- OpenCensus (from https://github.com/census-instrumentation/opencensus-java)
......@@ -508,17 +509,19 @@ The following software have components provided under the terms of this license:
- SnakeYAML (from http://www.snakeyaml.org)
- Spring AOP (from https://github.com/spring-projects/spring-framework)
- Spring Beans (from https://github.com/spring-projects/spring-framework)
- Spring Boot (from http://projects.spring.io/spring-boot/)
- Spring Boot (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot)
- Spring Boot AOP Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-aop)
- Spring Boot Actuator (from http://projects.spring.io/spring-boot/)
- Spring Boot AutoConfigure (from http://projects.spring.io/spring-boot/)
- Spring Boot Logging Starter (from http://projects.spring.io/spring-boot/)
- Spring Boot AutoConfigure (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-autoconfigure)
- Spring Boot Json Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-json)
- Spring Boot Logging Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-logging)
- Spring Boot Security Starter (from http://projects.spring.io/spring-boot/)
- Spring Boot Starter (from http://projects.spring.io/spring-boot/)
- Spring Boot Test (from http://projects.spring.io/spring-boot/)
- Spring Boot Test Auto-Configure (from http://projects.spring.io/spring-boot/)
- Spring Boot Test Starter (from http://projects.spring.io/spring-boot/)
- Spring Boot Tomcat Starter (from http://projects.spring.io/spring-boot/)
- Spring Boot Web Starter (from http://projects.spring.io/spring-boot/)
- Spring Boot Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter)
- Spring Boot Test (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-test)
- Spring Boot Test Auto-Configure (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-test-autoconfigure)
- Spring Boot Test Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-test)
- Spring Boot Tomcat Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-tomcat)
- Spring Boot Web Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-web)
- Spring Cloud GCP Autoconfigure Module (from https://repo1.maven.org/maven2/org/springframework/cloud/spring-cloud-gcp-autoconfigure)
- Spring Cloud GCP Core Module (from https://repo1.maven.org/maven2/org/springframework/cloud/spring-cloud-gcp-core)
- Spring Cloud GCP Datastore Module (from https://repo1.maven.org/maven2/org/springframework/cloud/spring-cloud-gcp-data-datastore)
......@@ -586,7 +589,6 @@ The following software have components provided under the terms of this license:
- mockito-core (from http://mockito.org)
- mockito-core (from http://mockito.org)
- mockito-core (from http://mockito.org)
- okio (from https://github.com/square/okio/)
- org.apiguardian:apiguardian-api (from https://github.com/apiguardian-team/apiguardian)
- org.conscrypt:conscrypt-openjdk-uber (from https://conscrypt.org/)
- org.jetbrains.kotlin:kotlin-stdlib-common (from https://kotlinlang.org/)
......@@ -601,33 +603,31 @@ The following software have components provided under the terms of this license:
- proto-google-common-protos (from https://github.com/googleapis/java-iam/proto-google-common-protos)
- proto-google-common-protos (from https://github.com/googleapis/java-iam/proto-google-common-protos)
- proto-google-iam-v1 (from https://github.com/googleapis/java-iam/proto-google-iam-v1)
- resilience4j (from https://github.com/resilience4j/resilience4j)
- resilience4j (from https://resilience4j.readme.io)
- resilience4j (from https://github.com/resilience4j/resilience4j)
- resilience4j (from https://github.com/resilience4j/resilience4j)
- resilience4j (from https://github.com/resilience4j/resilience4j)
- resilience4j (from https://resilience4j.readme.io)
- resilience4j (from https://github.com/resilience4j/resilience4j)
- resilience4j (from https://github.com/resilience4j/resilience4j)
- resilience4j (from https://resilience4j.readme.io)
- resilience4j (from https://github.com/resilience4j/resilience4j)
- rxjava (from https://github.com/ReactiveX/RxJava)
- spring-boot-actuator-autoconfigure (from https://spring.io/projects/spring-boot)
- spring-boot-dependencies (from https://spring.io/projects/spring-boot)
- spring-boot-starter-actuator (from https://spring.io/projects/spring-boot)
- spring-boot-starter-aop (from https://spring.io/projects/spring-boot)
- spring-boot-starter-data-mongodb (from https://spring.io/projects/spring-boot)
- spring-boot-starter-json (from https://spring.io/projects/spring-boot)
- spring-boot-starter-log4j2 (from https://spring.io/projects/spring-boot)
- spring-boot-starter-reactor-netty (from https://spring.io/projects/spring-boot)
- spring-boot-starter-validation (from https://spring.io/projects/spring-boot)
- spring-boot-starter-webflux (from https://spring.io/projects/spring-boot)
- spring-security-config (from https://spring.io/spring-security)
- spring-security-core (from https://spring.io/spring-security)
- spring-security-oauth2-client (from https://spring.io/spring-security)
- spring-security-oauth2-core (from https://spring.io/spring-security)
- spring-security-oauth2-jose (from https://spring.io/spring-security)
- spring-security-config (from http://spring.io/spring-security)
- spring-security-core (from http://spring.io/spring-security)
- spring-security-oauth2-client (from http://spring.io/spring-security)
- spring-security-oauth2-core (from http://spring.io/spring-security)
- spring-security-oauth2-jose (from http://spring.io/spring-security)
- spring-security-oauth2-resource-server (from https://spring.io/spring-security)
- spring-security-test (from https://spring.io/spring-security)
- spring-security-web (from https://spring.io/spring-security)
- spring-security-test (from http://spring.io/spring-security)
- spring-security-web (from http://spring.io/spring-security)
- springfox-core (from https://github.com/springfox/springfox)
- springfox-schema (from https://github.com/springfox/springfox)
- springfox-spi (from https://github.com/springfox/springfox)
......@@ -950,7 +950,7 @@ The following software have components provided under the terms of this license:
- mockito-junit-jupiter (from https://github.com/mockito/mockito)
- msal4j (from https://github.com/AzureAD/microsoft-authentication-library-for-java)
- msal4j-persistence-extension (from https://github.com/AzureAD/microsoft-authentication-extensions-for-java)
- spring-security-core (from https://spring.io/spring-security)
- spring-security-core (from http://spring.io/spring-security)
========================================================================
MPL-1.1
......@@ -991,7 +991,7 @@ SAX-PD
========================================================================
The following software have components provided under the terms of this license:
- Apache Ant Core (from https://ant.apache.org/)
- Apache Ant Core (from http://ant.apache.org/)
========================================================================
SPL-1.0
......@@ -1005,7 +1005,7 @@ W3C
========================================================================
The following software have components provided under the terms of this license:
- Apache Ant Core (from https://ant.apache.org/)
- Apache Ant Core (from http://ant.apache.org/)
- JTidy (from http://jtidy.sourceforge.net)
- Xerces2-j (from https://xerces.apache.org/xerces2-j/)
- xml-apis (from )
......
......@@ -14,7 +14,6 @@
package org.opengroup.osdu.partition.api;
import java.util.Collections;
import org.opengroup.osdu.partition.logging.AuditLogger;
import org.opengroup.osdu.partition.model.PartitionInfo;
import org.opengroup.osdu.partition.model.Property;
......@@ -24,12 +23,21 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.annotation.RequestScope;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import javax.validation.Valid;
import java.net.URI;
import java.util.Collections;
import java.util.List;
import java.util.Map;
......@@ -39,7 +47,7 @@ import java.util.Map;
public class PartitionApi {
@Autowired
@Qualifier("cachedPartitionServiceImpl")
@Qualifier("partitionServiceImpl")
private IPartitionService partitionService;
@Autowired
......
// Copyright 2017-2020, Schlumberger
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.partition.provider.interfaces;
import org.opengroup.osdu.core.common.cache.ICache;
public interface IPartitionServiceCache<String, V> extends ICache<String, V> {
}
// Copyright 2017-2020, Schlumberger
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.partition.service;
import org.apache.http.HttpStatus;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.partition.model.PartitionInfo;
import org.opengroup.osdu.partition.provider.interfaces.IPartitionService;
import org.opengroup.osdu.partition.provider.interfaces.IPartitionServiceCache;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import javax.inject.Inject;
import java.util.List;
@Service
public class CachedPartitionServiceImpl implements IPartitionService {
private static final String PARTITION_LIST_KEY = "getAllPartitions";
@Inject
@Qualifier("partitionServiceImpl")
private IPartitionService partitionService;
@Inject
@Qualifier("partitionServiceCache")
private IPartitionServiceCache<String, PartitionInfo> partitionServiceCache;
@Inject
@Qualifier("partitionListCache")
private IPartitionServiceCache<String, List<String>> partitionListCache;
@Override
public PartitionInfo createPartition(String partitionId, PartitionInfo partitionInfo) {
if (partitionServiceCache.get(partitionId) != null)
throw new AppException(HttpStatus.SC_CONFLICT, "partition exist", "Partition with same id exist");
PartitionInfo pi = partitionService.createPartition(partitionId, partitionInfo);
if (pi != null) {
partitionServiceCache.put(partitionId, pi);
partitionListCache.clearAll();
}
return pi;
}
@Override
public PartitionInfo updatePartition(String partitionId, PartitionInfo partitionInfo) {
PartitionInfo pi = partitionService.updatePartition(partitionId, partitionInfo);
if(pi != null) {
partitionServiceCache.put(partitionId, pi);
}
return pi;
}
@Override
public PartitionInfo getPartition(String partitionId) {
PartitionInfo pi = (PartitionInfo) partitionServiceCache.get(partitionId);
if (pi == null) {
pi = partitionService.getPartition(partitionId);
if (pi != null) {
partitionServiceCache.put(partitionId, pi);
}
}
return pi;
}
@Override
public boolean deletePartition(String partitionId) {
if (partitionService.deletePartition(partitionId)) {
if (partitionServiceCache.get(partitionId) != null) {
partitionServiceCache.delete(partitionId);
}
partitionListCache.clearAll();
return true;
}
return false;
}
@Override
public List<String> getAllPartitions() {
List<String> partitions = (List<String>)partitionListCache.get(PARTITION_LIST_KEY);
if (partitions == null) {
partitions = partitionService.getAllPartitions();
if (partitions != null) {
partitionListCache.put(PARTITION_LIST_KEY, partitions);
}
}
return partitions;
}
}
// Copyright © 2020 Amazon Web Services
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.partition.provider.aws.service;
import org.opengroup.osdu.partition.model.PartitionInfo;
import org.opengroup.osdu.partition.provider.interfaces.IPartitionServiceCache;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import java.util.List;
/***
* We don't want to use cache. Implement a dummy service to always return a cache miss.
*/
@Service
@Qualifier("partitionListCache")
public class PartitionServiceDummyListCacheImpl implements IPartitionServiceCache<String, List<String>> {
public PartitionServiceDummyListCacheImpl() {
}
@Override
public void clearAll() {
return;
}
@Override
public void delete(String arg0) {
return;
}
@Override
public List<String> get(String arg0) {
return null;
}
@Override
public void put(String arg0, List<String> arg1) {
return;
}
}
// Copyright © 2020 Amazon Web Services
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.partition.provider.aws.service;
import org.opengroup.osdu.partition.model.PartitionInfo;
import org.opengroup.osdu.partition.provider.interfaces.IPartitionServiceCache;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
/***
* We don't want to use cache. Implement a dummy service to always return a cache miss.
*/
@Service
@Qualifier("partitionServiceCache")
public class PartitionServiceDummyPartitionInfoCacheImpl implements IPartitionServiceCache<String, PartitionInfo> {
public PartitionServiceDummyPartitionInfoCacheImpl() {
}
@Override
public void clearAll() {
return;
}
@Override
public void delete(String arg0) {
return;
}
@Override
public PartitionInfo get(String arg0) {
return null;
}
@Override
public void put(String arg0, PartitionInfo arg1) {
return;
}
}
......@@ -14,9 +14,6 @@
package org.opengroup.osdu.partition.provider.aws.service;
import java.util.List;
import java.util.Map;
import org.apache.http.HttpStatus;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.AppException;
......@@ -27,6 +24,12 @@ import org.opengroup.osdu.partition.provider.interfaces.IPartitionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* AWS implementation doesn't use cache.
*/
@Service
public class PartitionServiceImpl implements IPartitionService {
......
package org.opengroup.osdu.partition.provider.azure.cache;
import org.opengroup.osdu.core.common.cache.ICache;
import org.opengroup.osdu.partition.provider.interfaces.IPartitionServiceCache;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
@Qualifier("partitionListCache")
public class PartitionListCacheImpl implements IPartitionServiceCache<String, List<String>> {
@Resource(name="partitionListCache")
private ICache<String, List<String>> cache;
@Override
public void put(String s, List<String> o) {
this.cache.put(s, o);
}
@Override
public List<String> get(String s) {
return this.cache.get(s);
}
@Override
public void delete(String s) {
this.cache.delete(s);
}
@Override
public void clearAll() {
this.cache.clearAll();
}
}
package org.opengroup.osdu.partition.provider.azure.cache;
import org.opengroup.osdu.core.common.cache.ICache;
import org.opengroup.osdu.partition.model.PartitionInfo;
import org.opengroup.osdu.partition.provider.interfaces.IPartitionServiceCache;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
@Qualifier("partitionServiceCache")
public class PartitionServiceCacheImpl implements IPartitionServiceCache<String, PartitionInfo> {
@Resource(name="partitionServiceCache")
private ICache<String, PartitionInfo> cache;
@Override
public void put(String s, PartitionInfo o) {
this.cache.put(s, o);
}
@Override
public PartitionInfo get(String s) {
return this.cache.get(s);
}
@Override
public void delete(String s) {
this.cache.delete(s);
}
@Override
public void clearAll() {
this.cache.clearAll();
}
}
......@@ -15,41 +15,56 @@
package org.opengroup.osdu.partition.provider.azure.service;
import org.apache.http.HttpStatus;
import org.opengroup.osdu.core.common.cache.ICache;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.partition.model.PartitionInfo;
import org.opengroup.osdu.partition.model.Property;
import org.opengroup.osdu.partition.provider.azure.persistence.PartitionTableStore;
import org.opengroup.osdu.partition.provider.interfaces.IPartitionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import javax.inject.Inject;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;