diff --git a/NOTICE b/NOTICE index 87002dedd587dca0d77eba33e1813423c6102693..710a92fbaca3aed1e622b83868b6c55825f70422 100644 --- a/NOTICE +++ b/NOTICE @@ -31,7 +31,6 @@ Apache-2.0 ======================================================================== The following software have components provided under the terms of this license: -- AHC/Client (from https://repo1.maven.org/maven2/org/asynchttpclient/async-http-client) - AMQP 1.0 JMS Spring Boot AutoConfiguration (from https://repo1.maven.org/maven2/org/amqphub/spring/amqp-10-jms-spring-boot-autoconfigure) - AMQP 1.0 JMS Spring Boot Starter (from https://repo1.maven.org/maven2/org/amqphub/spring/amqp-10-jms-spring-boot-starter) - ASM Analysis (from http://asm.ow2.io/) @@ -81,10 +80,11 @@ The following software have components provided under the terms of this license: - Apache Lucene (module: spatial-extras) (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-spatial-extras) - Apache Lucene (module: suggest) (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-suggest) - AssertJ Core (from ${project.organization.url}#${project.artifactId}) +- Asynchronous Http Client (from https://repo1.maven.org/maven2/org/asynchttpclient/async-http-client) - Asynchronous Http Client Netty Utils (from https://repo1.maven.org/maven2/org/asynchttpclient/async-http-client-netty-utils) - AutoValue Annotations (from https://github.com/google/auto/tree/master/value, https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations) - BSON (from http://bsonspec.org, https://bsonspec.org) -- BSON Record Codec (from https://www.mongodb.com/) +- BSON Record Codec (from <https://www.mongodb.com/>, https://www.mongodb.com/) - Bean Validation API (from http://beanvalidation.org) - Brave (from https://repo1.maven.org/maven2/io/zipkin/brave/brave) - Brave Instrumentation: Http Adapters (from https://repo1.maven.org/maven2/io/zipkin/brave/brave-instrumentation-http) @@ -106,7 +106,7 @@ The following software have components provided under the terms of this license: - GSON extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-gson) - Google APIs Client Library for Java (from https://repo1.maven.org/maven2/com/google/api-client/google-api-client) - Google App Engine extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-appengine) -- Google Cloud Core (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core, https://github.com/googleapis/java-core) +- Google Cloud Core (from https://github.com/googleapis/google-cloud-java, https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core, https://github.com/googleapis/java-core) - Google Cloud Core HTTP (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-core-http, https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core-http, https://github.com/googleapis/java-core) - Google Cloud Core gRPC (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core-grpc, https://github.com/googleapis/java-core) - Google Cloud Datastore (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-datastore, https://github.com/googleapis/java-datastore) @@ -128,7 +128,7 @@ The following software have components provided under the terms of this license: - Hop (from https://github.com/rabbitmq/hop, https://www.rabbitmq.com) - J2ObjC Annotations (from https://github.com/google/j2objc/) - JAX-RS 2.1: The Java(TM) API for RESTful Web Services (from https://repo1.maven.org/maven2/org/jboss/spec/javax/ws/rs/jboss-jaxrs-api_2.1_spec) -- JBoss Jakarta Annotations API (from https://github.com/jboss/jboss-jakarta-annotations-api_spec) +- JBoss Jakarta Annotations API (from <https://github.com/jboss/jboss-jakarta-annotations-api_spec>, https://github.com/jboss/jboss-jakarta-annotations-api_spec) - JBoss Logging 3 (from http://www.jboss.org) - JBoss Marshalling API (from https://repo1.maven.org/maven2/org/jboss/marshalling/jboss-marshalling) - JBoss Marshalling River (from https://repo1.maven.org/maven2/org/jboss/marshalling/jboss-marshalling-river) @@ -167,7 +167,7 @@ The following software have components provided under the terms of this license: - Java Native Access Platform (from https://github.com/java-native-access/jna) - Java UUID Generator (from http://wiki.fasterxml.com/JugHome) - Java archiving library (from http://rauschig.org/jarchivelib) -- JavaBeans Activation Framework (from https://repo1.maven.org/maven2/com/sun/activation/javax.activation) +- JavaBeans Activation Framework (from <http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp>, http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp, https://repo1.maven.org/maven2/com/sun/activation/javax.activation) - Javassist (from http://www.javassist.org/) - JetBrains Java Annotations (from https://github.com/JetBrains/java-annotations) - Joda-Time (from http://joda-time.sourceforge.net, http://www.joda.org/joda-time/, https://www.joda.org/joda-time/) @@ -179,11 +179,11 @@ The following software have components provided under the terms of this license: - KeePassJava2 :: Simple (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2-simple) - Kotlin Stdlib (from https://kotlinlang.org/, https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib) - Kotlin Stdlib Common (from https://kotlinlang.org/) -- Kotlin Stdlib Jdk7 (from https://kotlinlang.org/) -- Kotlin Stdlib Jdk8 (from https://kotlinlang.org/) +- Kotlin Stdlib Jdk7 (from <https://kotlinlang.org/>, https://kotlinlang.org/) +- Kotlin Stdlib Jdk8 (from <https://kotlinlang.org/>, https://kotlinlang.org/) - LatencyUtils (from http://latencyutils.github.io/LatencyUtils/) - Lettuce (from http://github.com/lettuce-io/lettuce-core) -- Lucene Common Analyzers (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common) +- Lucene Common Analyzers (from <https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common>, https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common) - Lucene Core (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-core) - Lucene Grouping (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-grouping) - Lucene Highlighter (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-highlighter) @@ -237,11 +237,11 @@ The following software have components provided under the terms of this license: - PWDB :: Database (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/database) - PostgreSQL JDBC Driver - PowerMock (from http://www.powermock.org, https://repo1.maven.org/maven2/org/powermock/powermock-api-mockito) -- Prometheus Java Simpleclient (from https://repo1.maven.org/maven2/io/prometheus/simpleclient) -- Prometheus Java Simpleclient Common (from https://repo1.maven.org/maven2/io/prometheus/simpleclient_common) -- Prometheus Java Span Context Supplier - Common (from https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_common) -- Prometheus Java Span Context Supplier - OpenTelemetry (from https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_otel) -- Prometheus Java Span Context Supplier - OpenTelemetry Agent (from https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_otel_agent) +- Prometheus Java Simpleclient (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient>, https://repo1.maven.org/maven2/io/prometheus/simpleclient) +- Prometheus Java Simpleclient Common (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient_common>, https://repo1.maven.org/maven2/io/prometheus/simpleclient_common) +- Prometheus Java Span Context Supplier - Common (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_common>, https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_common) +- Prometheus Java Span Context Supplier - OpenTelemetry (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_otel>, https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_otel) +- Prometheus Java Span Context Supplier - OpenTelemetry Agent (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_otel_agent>, https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_otel_agent) - Protocol Buffer extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-protobuf) - Proton-J (from https://repo1.maven.org/maven2/org/apache/qpid/proton-j) - QpidJMS Client (from https://repo1.maven.org/maven2/org/apache/qpid/qpid-jms-client) @@ -306,7 +306,7 @@ The following software have components provided under the terms of this license: - Spring Web (from http://www.springframework.org, https://github.com/spring-projects/spring-framework, https://repo1.maven.org/maven2/org/springframework/spring-web) - Spring Web MVC (from https://github.com/spring-projects/spring-framework, https://repo1.maven.org/maven2/org/springframework/spring-webmvc) - Spring WebFlux (from https://github.com/spring-projects/spring-framework) -- Swagger UI (from http://webjars.org) +- Swagger UI (from <http://webjars.org>, http://webjars.org) - Vavr (from http://vavr.io, https://www.vavr.io) - Vavr Match (from http://vavr.io) - Woodstox (from https://github.com/FasterXML/woodstox) @@ -314,14 +314,14 @@ The following software have components provided under the terms of this license: - Zipkin Reporter: Core (from https://repo1.maven.org/maven2/io/zipkin/reporter2/zipkin-reporter) - Zipkin v2 (from https://repo1.maven.org/maven2/io/zipkin/zipkin2/zipkin) - aalto-xml (from https://github.com/FasterXML/aalto-xml, https://repo1.maven.org/maven2/com/fasterxml/aalto-xml) -- aggs-matrix-stats (from https://github.com/elastic/elasticsearch.git) +- aggs-matrix-stats (from https://github.com/elastic/elasticsearch, https://github.com/elastic/elasticsearch.git) - compiler (from http://github.com/spullara/mustache.java) - datastore-v1-proto-client (from https://repo1.maven.org/maven2/com/google/cloud/datastore/datastore-v1-proto-client) - documentdb-bulkexecutor (from http://azure.microsoft.com/en-us/services/documentdb/) - elasticsearch (from https://github.com/elastic/elasticsearch, https://github.com/elastic/elasticsearch.git, https://repo1.maven.org/maven2/org/elasticsearch/elasticsearch) - elasticsearch-cli (from https://github.com/elastic/elasticsearch, https://github.com/elastic/elasticsearch.git) - elasticsearch-core (from https://github.com/elastic/elasticsearch, https://github.com/elastic/elasticsearch.git) -- elasticsearch-geo (from https://github.com/elastic/elasticsearch.git) +- elasticsearch-geo (from https://github.com/elastic/elasticsearch, https://github.com/elastic/elasticsearch.git) - elasticsearch-secure-sm (from https://github.com/elastic/elasticsearch, https://github.com/elastic/elasticsearch.git) - elasticsearch-x-content (from https://github.com/elastic/elasticsearch, https://github.com/elastic/elasticsearch.git) - embedded-elasticsearch (from https://github.com/allegro/embedded-elasticsearch) @@ -352,19 +352,19 @@ The following software have components provided under the terms of this license: - jose4j (from https://bitbucket.org/b_c/jose4j/) - json-patch (from https://github.com/fge/json-patch) - json-path (from http://code.google.com/p/json-path/, https://github.com/jayway/JsonPath) -- lang-mustache (from https://github.com/elastic/elasticsearch.git) +- lang-mustache (from https://github.com/elastic/elasticsearch, https://github.com/elastic/elasticsearch.git) - lettuce (from http://github.com/mp911de/lettuce/wiki, https://github.com/lettuce-io/lettuce-core/wiki) -- mapper-extras (from https://github.com/elastic/elasticsearch.git) +- mapper-extras (from https://github.com/elastic/elasticsearch, https://github.com/elastic/elasticsearch.git) - micrometer-core (from https://github.com/micrometer-metrics/micrometer) - micrometer-registry-azure-monitor (from https://github.com/micrometer-metrics/micrometer) -- micrometer-registry-prometheus (from https://github.com/micrometer-metrics/micrometer) +- micrometer-registry-prometheus (from <https://github.com/micrometer-metrics/micrometer>, https://github.com/micrometer-metrics/micrometer) - minio (from https://github.com/minio/minio-java) - null (from https://github.com/fge/btf, https://github.com/fge/msg-simple) - org.apiguardian:apiguardian-api (from https://github.com/apiguardian-team/apiguardian) - org.conscrypt:conscrypt-openjdk-uber (from https://conscrypt.org/) - org.opentest4j:opentest4j (from https://github.com/ota4j-team/opentest4j) - org.xmlunit:xmlunit-core (from http://www.xmlunit.org/, https://www.xmlunit.org/) -- parent-join (from https://github.com/elastic/elasticsearch.git) +- parent-join (from https://github.com/elastic/elasticsearch, https://github.com/elastic/elasticsearch.git) - perfmark:perfmark-api (from https://github.com/perfmark/perfmark) - proto-google-cloud-datastore-v1 (from https://github.com/googleapis/googleapis, https://github.com/googleapis/java-datastore/proto-google-cloud-datastore-v1) - proto-google-cloud-iamcredentials-v1 (from https://github.com/googleapis/google-cloud-java, https://github.com/googleapis/java-iamcredentials/proto-google-cloud-iamcredentials-v1, https://repo1.maven.org/maven2/com/google/api/grpc/proto-google-cloud-iamcredentials-v1) @@ -372,18 +372,17 @@ The following software have components provided under the terms of this license: - proto-google-cloud-pubsub-v1 (from https://github.com/googleapis/googleapis, https://github.com/googleapis/java-pubsub/proto-google-cloud-pubsub-v1) - proto-google-common-protos (from https://github.com/googleapis/api-client-staging, https://github.com/googleapis/gapic-generator-java, https://github.com/googleapis/googleapis, https://github.com/googleapis/java-iam/proto-google-common-protos) - proto-google-iam-v1 (from https://github.com/googleapis/gapic-generator-java, https://github.com/googleapis/googleapis, https://github.com/googleapis/java-iam/proto-google-iam-v1) -- rank-eval (from https://github.com/elastic/elasticsearch.git) +- rank-eval (from https://github.com/elastic/elasticsearch, https://github.com/elastic/elasticsearch.git) - resilience4j (from https://github.com/resilience4j/resilience4j, https://resilience4j.readme.io, ttps://resilience4j.readme.io) -- rest (from https://github.com/elastic/elasticsearch.git) +- rest (from https://github.com/elastic/elasticsearch, https://github.com/elastic/elasticsearch.git) - rest-high-level (from https://github.com/elastic/elasticsearch) -- spring-security-crypto (from http://spring.io/spring-security, https://spring.io/projects/spring-security, https://spring.io/spring-security) - spring-security-oauth2-client (from http://spring.io/spring-security, https://spring.io/projects/spring-security, https://spring.io/spring-security) - spring-security-oauth2-core (from http://spring.io/spring-security, https://spring.io/projects/spring-security, https://spring.io/spring-security) - spring-security-oauth2-jose (from http://spring.io/spring-security, https://spring.io/projects/spring-security, https://spring.io/spring-security) - spring-security-test (from http://spring.io/spring-security, https://spring.io/projects/spring-security, https://spring.io/spring-security) -- springdoc-openapi-common (from https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-common) -- springdoc-openapi-ui (from https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-ui) -- springdoc-openapi-webmvc-core (from https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-webmvc-core) +- springdoc-openapi-common (from <https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-common>, https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-common) +- springdoc-openapi-ui (from https://github.com/springdoc/springdoc-openapi, https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-ui) +- springdoc-openapi-webmvc-core (from <https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-webmvc-core>, https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-webmvc-core) - swagger-annotations (from https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-annotations, https://repo1.maven.org/maven2/io/swagger/swagger-annotations) - swagger-core (from https://repo1.maven.org/maven2/io/swagger/core/v3/swagger-core, https://repo1.maven.org/maven2/io/swagger/swagger-core) - swagger-jaxrs (from https://repo1.maven.org/maven2/io/swagger/swagger-jaxrs) @@ -404,15 +403,15 @@ The following software have components provided under the terms of this license: - Apache Lucene (module: misc) (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-misc) - Apache Lucene (module: spatial-extras) (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-spatial-extras) - Apache Lucene (module: suggest) (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-suggest) -- GAX (Google Api eXtensions) for Java (Core) (from https://repo1.maven.org/maven2/com/google/api/gax) -- GAX (Google Api eXtensions) for Java (HTTP JSON) (from https://repo1.maven.org/maven2/com/google/api/gax-httpjson) -- GAX (Google Api eXtensions) for Java (gRPC) (from https://repo1.maven.org/maven2/com/google/api/gax-grpc) +- GAX (Google Api eXtensions) for Java (Core) (from https://github.com/googleapis, https://github.com/googleapis/gax-java, https://repo1.maven.org/maven2/com/google/api/gax) +- GAX (Google Api eXtensions) for Java (HTTP JSON) (from <https://repo1.maven.org/maven2/com/google/api/gax-httpjson>, https://repo1.maven.org/maven2/com/google/api/gax-httpjson) +- GAX (Google Api eXtensions) for Java (gRPC) (from <https://repo1.maven.org/maven2/com/google/api/gax-grpc>, https://repo1.maven.org/maven2/com/google/api/gax-grpc) - Hamcrest (from http://hamcrest.org/JavaHamcrest/) - Hamcrest Core (from http://hamcrest.org/, http://hamcrest.org/JavaHamcrest/, https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core) - HdrHistogram (from http://hdrhistogram.github.io/HdrHistogram/) - Jodd BeanUtil (from http://jodd.org) - Jodd Core (from http://jodd.org) -- Lucene Common Analyzers (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common) +- Lucene Common Analyzers (from <https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common>, https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common) - Lucene Grouping (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-grouping) - Lucene Highlighter (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-highlighter) - Lucene Join (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-join) @@ -442,9 +441,9 @@ The following software have components provided under the terms of this license: - Apache Lucene (module: suggest) (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-suggest) - AspectJ Weaver (from http://www.aspectj.org, https://www.eclipse.org/aspectj/) - Class Model for Hk2 (from https://repo1.maven.org/maven2/org/glassfish/hk2/class-model) -- GAX (Google Api eXtensions) for Java (Core) (from https://repo1.maven.org/maven2/com/google/api/gax) -- GAX (Google Api eXtensions) for Java (HTTP JSON) (from https://repo1.maven.org/maven2/com/google/api/gax-httpjson) -- GAX (Google Api eXtensions) for Java (gRPC) (from https://repo1.maven.org/maven2/com/google/api/gax-grpc) +- GAX (Google Api eXtensions) for Java (Core) (from https://github.com/googleapis, https://github.com/googleapis/gax-java, https://repo1.maven.org/maven2/com/google/api/gax) +- GAX (Google Api eXtensions) for Java (HTTP JSON) (from <https://repo1.maven.org/maven2/com/google/api/gax-httpjson>, https://repo1.maven.org/maven2/com/google/api/gax-httpjson) +- GAX (Google Api eXtensions) for Java (gRPC) (from <https://repo1.maven.org/maven2/com/google/api/gax-grpc>, https://repo1.maven.org/maven2/com/google/api/gax-grpc) - Google APIs Client Library for Java (from https://repo1.maven.org/maven2/com/google/api-client/google-api-client) - Google Auth Library for Java - Credentials (from https://repo1.maven.org/maven2/com/google/auth/google-auth-library-credentials) - Google Auth Library for Java - OAuth2 HTTP (from https://repo1.maven.org/maven2/com/google/auth/google-auth-library-oauth2-http) @@ -454,14 +453,14 @@ The following software have components provided under the terms of this license: - Hamcrest (from http://hamcrest.org/JavaHamcrest/) - Hamcrest Core (from http://hamcrest.org/, http://hamcrest.org/JavaHamcrest/, https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core) - JAX-RS 2.1: The Java(TM) API for RESTful Web Services (from https://repo1.maven.org/maven2/org/jboss/spec/javax/ws/rs/jboss-jaxrs-api_2.1_spec) -- JBoss Jakarta Annotations API (from https://github.com/jboss/jboss-jakarta-annotations-api_spec) +- JBoss Jakarta Annotations API (from <https://github.com/jboss/jboss-jakarta-annotations-api_spec>, https://github.com/jboss/jboss-jakarta-annotations-api_spec) - Jackson module: Afterburner (from http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson-modules-base) - Jakarta Activation (from https://repo1.maven.org/maven2/com/sun/activation/jakarta.activation) - Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) - Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) - Jakarta RESTful WS API (from https://github.com/eclipse-ee4j/jaxrs-api) - Jakarta XML Binding API (from https://repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api, https://repo1.maven.org/maven2/org/jboss/spec/javax/xml/bind/jboss-jaxb-api_2.3_spec) -- Lucene Common Analyzers (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common) +- Lucene Common Analyzers (from <https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common>, https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common) - Lucene Core (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-core) - Lucene Grouping (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-grouping) - Lucene Highlighter (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-highlighter) @@ -543,7 +542,7 @@ The following software have components provided under the terms of this license: - LatencyUtils (from http://latencyutils.github.io/LatencyUtils/) - MongoDB Java Driver (from http://mongodb.org/, http://www.mongodb.org, https://www.mongodb.com/) - Netty/Common (from https://repo1.maven.org/maven2/io/netty/netty-common) -- Prometheus Java Simpleclient (from https://repo1.maven.org/maven2/io/prometheus/simpleclient) +- Prometheus Java Simpleclient (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient>, https://repo1.maven.org/maven2/io/prometheus/simpleclient) - RabbitMQ Java Client (from http://www.rabbitmq.com, https://www.rabbitmq.com) - jersey-container-servlet (from https://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet) - jersey-container-servlet-core (from https://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet-core) @@ -568,7 +567,7 @@ The following software have components provided under the terms of this license: - JSR 311 API (from https://jsr311.dev.java.net, https://jsr311.dev.java.net/) - Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) - Java Architecture for XML Binding (from http://jaxb.java.net/, https://repo1.maven.org/maven2/javax/xml/bind/jaxb-api) -- JavaBeans Activation Framework (from https://repo1.maven.org/maven2/com/sun/activation/javax.activation) +- JavaBeans Activation Framework (from <http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp>, http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp, https://repo1.maven.org/maven2/com/sun/activation/javax.activation) - javax.annotation-api (from http://jcp.org/en/jsr/detail?id=250) ======================================================================== @@ -584,7 +583,7 @@ The following software have components provided under the terms of this license: - JSR 353 (JSON Processing) Default Provider (from http://jsonp.java.net) - Jakarta Servlet (from https://javaee.github.io/servlet-spec/, https://projects.eclipse.org/projects/ee4j.servlet) - Java Architecture for XML Binding (from http://jaxb.java.net/, https://repo1.maven.org/maven2/javax/xml/bind/jaxb-api) -- JavaBeans Activation Framework (from https://repo1.maven.org/maven2/com/sun/activation/javax.activation) +- JavaBeans Activation Framework (from <http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp>, http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp, https://repo1.maven.org/maven2/com/sun/activation/javax.activation) - Run Level Service (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-runlevel) - javax.annotation-api (from http://jcp.org/en/jsr/detail?id=250) - javax.ws.rs-api (from https://github.com/eclipse-ee4j/jaxrs-api) @@ -643,7 +642,7 @@ The following software have components provided under the terms of this license: - HK2 Implementation Utilities (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-utils) - HK2 core module (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-core) - JAX-RS 2.1: The Java(TM) API for RESTful Web Services (from https://repo1.maven.org/maven2/org/jboss/spec/javax/ws/rs/jboss-jaxrs-api_2.1_spec) -- JBoss Jakarta Annotations API (from https://github.com/jboss/jboss-jakarta-annotations-api_spec) +- JBoss Jakarta Annotations API (from <https://github.com/jboss/jboss-jakarta-annotations-api_spec>, https://github.com/jboss/jboss-jakarta-annotations-api_spec) - JUnit Jupiter (Aggregator) (from https://junit.org/junit5/) - JUnit Jupiter API (from http://junit.org/junit5/, https://junit.org/junit5/) - JUnit Jupiter Engine (from http://junit.org/junit5/, https://junit.org/junit5/) @@ -681,11 +680,11 @@ The following software have components provided under the terms of this license: - HK2 Implementation Utilities (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-utils) - HK2 core module (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-core) - JAX-RS 2.1: The Java(TM) API for RESTful Web Services (from https://repo1.maven.org/maven2/org/jboss/spec/javax/ws/rs/jboss-jaxrs-api_2.1_spec) -- JBoss Jakarta Annotations API (from https://github.com/jboss/jboss-jakarta-annotations-api_spec) +- JBoss Jakarta Annotations API (from <https://github.com/jboss/jboss-jakarta-annotations-api_spec>, https://github.com/jboss/jboss-jakarta-annotations-api_spec) - Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) - Jakarta RESTful WS API (from https://github.com/eclipse-ee4j/jaxrs-api) - Java Architecture for XML Binding (from http://jaxb.java.net/, https://repo1.maven.org/maven2/javax/xml/bind/jaxb-api) -- JavaBeans Activation Framework (from https://repo1.maven.org/maven2/com/sun/activation/javax.activation) +- JavaBeans Activation Framework (from <http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp>, http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp, https://repo1.maven.org/maven2/com/sun/activation/javax.activation) - RabbitMQ Java Client (from http://www.rabbitmq.com, https://www.rabbitmq.com) - ServiceLocator Default Implementation (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-locator) - aopalliance-repackaged (from https://repo1.maven.org/maven2/org/glassfish/hk2/external/aopalliance-repackaged) @@ -714,7 +713,7 @@ The following software have components provided under the terms of this license: - HK2 Implementation Utilities (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-utils) - HK2 core module (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-core) - JAX-RS 2.1: The Java(TM) API for RESTful Web Services (from https://repo1.maven.org/maven2/org/jboss/spec/javax/ws/rs/jboss-jaxrs-api_2.1_spec) -- JBoss Jakarta Annotations API (from https://github.com/jboss/jboss-jakarta-annotations-api_spec) +- JBoss Jakarta Annotations API (from <https://github.com/jboss/jboss-jakarta-annotations-api_spec>, https://github.com/jboss/jboss-jakarta-annotations-api_spec) - Jakarta Activation (from https://repo1.maven.org/maven2/com/sun/activation/jakarta.activation) - Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api) - Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) @@ -722,7 +721,7 @@ The following software have components provided under the terms of this license: - Jakarta RESTful WS API (from https://github.com/eclipse-ee4j/jaxrs-api) - Jakarta XML Binding API (from https://repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api, https://repo1.maven.org/maven2/org/jboss/spec/javax/xml/bind/jboss-jaxb-api_2.3_spec) - Java Architecture for XML Binding (from http://jaxb.java.net/, https://repo1.maven.org/maven2/javax/xml/bind/jaxb-api) -- JavaBeans Activation Framework (from https://repo1.maven.org/maven2/com/sun/activation/javax.activation) +- JavaBeans Activation Framework (from <http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp>, http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp, https://repo1.maven.org/maven2/com/sun/activation/javax.activation) - OSGi resource locator (from https://repo1.maven.org/maven2/org/glassfish/hk2/osgi-resource-locator) - ServiceLocator Default Implementation (from https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-locator) - aopalliance-repackaged (from https://repo1.maven.org/maven2/org/glassfish/hk2/external/aopalliance-repackaged) @@ -763,7 +762,7 @@ IPA ======================================================================== The following software have components provided under the terms of this license: -- Lucene Common Analyzers (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common) +- Lucene Common Analyzers (from <https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common>, https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common) ======================================================================== ISC @@ -771,7 +770,7 @@ ISC The following software have components provided under the terms of this license: - Java Native Access Platform (from https://github.com/java-native-access/jna) -- spring-security-crypto (from http://spring.io/spring-security, https://spring.io/projects/spring-security, https://spring.io/spring-security) +- Spring Security - Core (from http://spring.io/spring-security, https://repo1.maven.org/maven2/org/springframework/security/spring-security-core, https://spring.io/projects/spring-security, https://spring.io/spring-security) ======================================================================== ImageMagick @@ -864,7 +863,7 @@ The following software have components provided under the terms of this license: - Jakarta XML Binding API (from https://repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api, https://repo1.maven.org/maven2/org/jboss/spec/javax/xml/bind/jboss-jaxb-api_2.3_spec) - Java Client Runtime for AutoRest (from https://github.com/Azure/autorest-clientruntime-for-java) - Java JWT (from http://www.jwt.io, https://github.com/auth0/java-jwt) -- Lucene Common Analyzers (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common) +- Lucene Common Analyzers (from <https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common>, https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common) - Lucene Core (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-core) - Lucene Grouping (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-grouping) - Lucene Highlighter (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-highlighter) @@ -920,7 +919,7 @@ The following software have components provided under the terms of this license: - msal4j (from https://github.com/AzureAD/microsoft-authentication-library-for-java) - msal4j-persistence-extension (from https://github.com/AzureAD/microsoft-authentication-extensions-for-java) - qpid-proton-j-extensions (from https://github.com/Azure/qpid-proton-j-extensions) -- webjars-locator-core (from http://webjars.org) +- webjars-locator-core (from <http://webjars.org>, http://webjars.org) ======================================================================== MPL-1.1 @@ -975,7 +974,7 @@ The following software have components provided under the terms of this license: - Apache Lucene (module: misc) (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-misc) - Apache Lucene (module: spatial-extras) (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-spatial-extras) - Apache Lucene (module: suggest) (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-suggest) -- Lucene Common Analyzers (from https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common) +- Lucene Common Analyzers (from <https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common>, https://repo1.maven.org/maven2/org/apache/lucene/lucene-analyzers-common) - Lucene Grouping (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-grouping) - Lucene Highlighter (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-highlighter) - Lucene Join (from https://lucene.apache.org/, https://repo1.maven.org/maven2/org/apache/lucene/lucene-join) @@ -1004,6 +1003,7 @@ public-domain ======================================================================== The following software have components provided under the terms of this license: +- Apache Groovy (from http://groovy-lang.org, http://groovy.codehaus.org/, https://groovy-lang.org) - HdrHistogram (from http://hdrhistogram.github.io/HdrHistogram/) - JBoss Logging 3 (from http://www.jboss.org) - JSON in Java (from https://github.com/douglascrockford/JSON-java) diff --git a/pom.xml b/pom.xml index 4d5b82a914443f315af015ea7cf11535d44aa2bd..501ed0889e8671763eacb5b9036c9823d485fcc2 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ <log4j-core.version>2.17.1</log4j-core.version> <google-oauth-client.version>1.34.1</google-oauth-client.version> <commons-compress.version>1.21</commons-compress.version> - <osdu.oscorecommon.version>0.18.0</osdu.oscorecommon.version> + <osdu.oscorecommon.version>0.19.0-SNAPSHOT</osdu.oscorecommon.version> <tomcat-embed-core.version>9.0.67</tomcat-embed-core.version> <openapi.version>1.6.9</openapi.version> <json-smart.version>2.4.7</json-smart.version> diff --git a/provider/search-azure/pom.xml b/provider/search-azure/pom.xml index 8fb2b3ccad2829a5da63d402c3138ead1298e6db..97fd81cc1a530ada1e1b92dea6959716ee000464 100644 --- a/provider/search-azure/pom.xml +++ b/provider/search-azure/pom.xml @@ -56,7 +56,6 @@ <azure-core.version>1.31.0</azure-core.version> <azure-security-keyvault-keys.version>4.4.6</azure-security-keyvault-keys.version> <azure-security-keyvault-secrets.version>4.4.6</azure-security-keyvault-secrets.version> - <osdu.oscorecommon.version>0.19.0-rc6</osdu.oscorecommon.version> </properties> <dependencyManagement> diff --git a/search-core/pom.xml b/search-core/pom.xml index 977c4ae4517ec5e593292f9b79f4fc3b600a0691..673c9fa54b1da88079db1ee3c3c25e2aa39cc1a2 100644 --- a/search-core/pom.xml +++ b/search-core/pom.xml @@ -38,7 +38,6 @@ <project.main.basedir>${project.basedir}</project.main.basedir> <nimbus-jose-jwt.version>9.1.2</nimbus-jose-jwt.version> <elasticsearch.version>7.8.1</elasticsearch.version> - <osdu.oscorecommon.version>0.17.0</osdu.oscorecommon.version> <netty.version>4.1.70.Final</netty.version> <spring-security-web.version>5.7.3</spring-security-web.version> <spring-webmvc.version>5.3.22</spring-webmvc.version> diff --git a/search-core/src/main/java/org/opengroup/osdu/search/service/IndexAliasService.java b/search-core/src/main/java/org/opengroup/osdu/search/service/IndexAliasService.java new file mode 100644 index 0000000000000000000000000000000000000000..3176456e5f7fcc3de2a2b48dbc83f169180feeda --- /dev/null +++ b/search-core/src/main/java/org/opengroup/osdu/search/service/IndexAliasService.java @@ -0,0 +1,22 @@ +// Copyright © 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.search.service; + +import java.util.List; +import java.util.Map; + +public interface IndexAliasService { + Map<String, String> getIndicesAliases(List<String> kinds); +} diff --git a/search-core/src/main/java/org/opengroup/osdu/search/service/IndexAliasServiceImpl.java b/search-core/src/main/java/org/opengroup/osdu/search/service/IndexAliasServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..f1c1c3d04f1edb2285072cbb2935cee64ef7807e --- /dev/null +++ b/search-core/src/main/java/org/opengroup/osdu/search/service/IndexAliasServiceImpl.java @@ -0,0 +1,161 @@ +// Copyright © 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.search.service; + +import com.google.api.client.util.Strings; +import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest; +import org.elasticsearch.action.support.master.AcknowledgedResponse; +import org.elasticsearch.client.GetAliasesResponse; +import org.elasticsearch.client.RequestOptions; +import org.elasticsearch.client.RestHighLevelClient; +import org.elasticsearch.cluster.metadata.AliasMetadata; +import org.elasticsearch.rest.RestStatus; +import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; +import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver; +import org.opengroup.osdu.search.util.ElasticClientHandler; +import org.springframework.stereotype.Component; + +import javax.inject.Inject; +import java.io.IOException; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +@Component +public class IndexAliasServiceImpl implements IndexAliasService { + @Inject + private ElasticClientHandler elasticClientHandler; + @Inject + private ElasticIndexNameResolver elasticIndexNameResolver; + @Inject + private JaxRsDpsLog log; + + private final Map<String, String> KIND_ALIAS_MAP = new ConcurrentHashMap(); + + + @Override + public Map<String, String> getIndicesAliases(List<String> kinds) { + Map<String, String> aliases = new HashMap<>(); + List<String> unresolvedKinds = new ArrayList<>(); + + List<String> validKinds = kinds.stream().filter(k -> elasticIndexNameResolver.isIndexAliasSupported(k)).collect(Collectors.toList()); + for(String kind: validKinds) { + if(KIND_ALIAS_MAP.containsKey(kind)) { + String alias = KIND_ALIAS_MAP.get(kind); + aliases.put(kind, alias); + } + else { + unresolvedKinds.add(kind); + } + } + if(!unresolvedKinds.isEmpty()) { + try (RestHighLevelClient restClient = this.elasticClientHandler.createRestClient()) { + // It is much faster to get all the aliases and verify it locally than to verify it remotely. + Set<String> allExistingAliases = getAllExistingAliases(restClient); + for(String kind: unresolvedKinds) { + String alias = elasticIndexNameResolver.getIndexAliasFromKind(kind); + if(!allExistingAliases.contains(alias)) { + try { + alias = createIndexAlias(restClient, kind); + } + catch(Exception e) { + log.error(String.format("Fail to create index alias for kind '%s'", kind), e); + } + } + if(!Strings.isNullOrEmpty(alias)) { + aliases.put(kind, alias); + KIND_ALIAS_MAP.put(kind, alias); + } + } + } catch (Exception e) { + log.error(String.format("Fail to get index aliases for kinds"), e); + } + } + + return aliases; + } + + private Set<String> getAllExistingAliases(RestHighLevelClient restClient) throws IOException { + GetAliasesRequest request = new GetAliasesRequest(); + GetAliasesResponse response = restClient.indices().getAlias(request, RequestOptions.DEFAULT); + if(response.status() != RestStatus.OK) + return new HashSet<>(); + + Set<String> allAliases = new HashSet<>(); + for (Set<AliasMetadata> aliasSet: response.getAliases().values()) { + List<String> aliases = aliasSet.stream().map(a -> a.getAlias()).collect(Collectors.toList()); + allAliases.addAll(aliases); + } + return allAliases; + } + + private String createIndexAlias(RestHighLevelClient restClient, String kind) throws IOException { + String index = elasticIndexNameResolver.getIndexNameFromKind(kind); + String alias = elasticIndexNameResolver.getIndexAliasFromKind(kind); + // To create an alias for an index, the index name must the concrete index name, not alias + index = resolveConcreteIndexName(restClient, index); + if(!Strings.isNullOrEmpty(index)) { + IndicesAliasesRequest addRequest = new IndicesAliasesRequest(); + IndicesAliasesRequest.AliasActions aliasActions = new IndicesAliasesRequest.AliasActions(IndicesAliasesRequest.AliasActions.Type.ADD) + .index(index) + .alias(alias); + addRequest.addAliasAction(aliasActions); + AcknowledgedResponse response = restClient.indices().updateAliases(addRequest, RequestOptions.DEFAULT); + if(response.isAcknowledged()) { + return alias; + } + } + + return null; + } + + private String resolveConcreteIndexName(RestHighLevelClient restClient, String index) throws IOException { + GetAliasesRequest request = new GetAliasesRequest(index); + GetAliasesResponse response = restClient.indices().getAlias(request, RequestOptions.DEFAULT); + if(response.status() == RestStatus.NOT_FOUND) { + /* index resolved from kind is actual concrete index + * Example: + * { + * "opendes-wke-well-1.0.7": { + * "aliases": {} + * } + * } + */ + return index; + } + if(response.status() == RestStatus.OK) { + /* index resolved from kind is NOT actual create index. It is just an alias + * The concrete index name in this example is "opendes-osdudemo-wellbore-1.0.0_1649167113090" + * Example: + * { + * "opendes-osdudemo-wellbore-1.0.0_1649167113090": { + * "aliases": { + * "opendes-osdudemo-wellbore-1.0.0": {} + * } + * } + * } + */ + Map<String, Set<AliasMetadata>> aliases = response.getAliases(); + for (Map.Entry<String, Set<AliasMetadata>> entry: aliases.entrySet()) { + String actualIndex = entry.getKey(); + List<String> aliaseNames = entry.getValue().stream().map(a -> a.getAlias()).collect(Collectors.toList()); + if(aliaseNames.contains(index)) + return actualIndex; + } + } + return null; + } +} diff --git a/search-core/src/main/java/org/opengroup/osdu/search/util/CrossTenantUtils.java b/search-core/src/main/java/org/opengroup/osdu/search/util/CrossTenantUtils.java index a21c0b1f61965368255f1aea6658aca32182e388..08cc2686c0f956b71d3fed24a2c86281981a922c 100644 --- a/search-core/src/main/java/org/opengroup/osdu/search/util/CrossTenantUtils.java +++ b/search-core/src/main/java/org/opengroup/osdu/search/util/CrossTenantUtils.java @@ -14,26 +14,53 @@ package org.opengroup.osdu.search.util; +import com.google.api.client.util.Strings; import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver; import org.opengroup.osdu.core.common.model.search.Query; import org.opengroup.osdu.core.common.util.KindParser; +import org.opengroup.osdu.search.service.IndexAliasService; import org.springframework.stereotype.Component; import javax.inject.Inject; +import java.util.HashMap; import java.util.List; +import java.util.Map; @Component public class CrossTenantUtils { + // For details, please refer to implementation of class + // org.opengroup.osdu.core.common.model.search.validation.MultiKindValidator + private static final int MAX_INDEX_NAME_LENGTH = 3840; @Inject private ElasticIndexNameResolver elasticIndexNameResolver; + @Inject + private IndexAliasService indexAliasService; public String getIndexName(Query searchRequest) { - StringBuilder builder = new StringBuilder(); List<String> kinds = KindParser.parse(searchRequest.getKind()); + String index = getIndexName(kinds, new HashMap<>()); + if(index.length() <= MAX_INDEX_NAME_LENGTH) { + return index; + } + else { + Map<String, String> aliases = this.indexAliasService.getIndicesAliases(kinds); + return getIndexName(kinds, aliases); + } + } + + private String getIndexName(List<String> kinds, Map<String, String> aliases) { + StringBuilder builder = new StringBuilder(); for(String kind : kinds) { - String index = this.elasticIndexNameResolver.getIndexNameFromKind(kind); - builder.append(index + ","); + if(aliases.containsKey(kind) && !Strings.isNullOrEmpty(aliases.get(kind))) { + String alias = aliases.get(kind); + builder.append(alias); + } + else { + String index = this.elasticIndexNameResolver.getIndexNameFromKind(kind); + builder.append(index); + } + builder.append(","); } builder.append("-.*"); // Exclude Lucene/ElasticSearch internal indices return builder.toString(); diff --git a/search-core/src/test/java/org/opengroup/osdu/search/service/IndexAliasServiceImplTest.java b/search-core/src/test/java/org/opengroup/osdu/search/service/IndexAliasServiceImplTest.java new file mode 100644 index 0000000000000000000000000000000000000000..f3de187c3568e9557a568fe2006ddceb725fb636 --- /dev/null +++ b/search-core/src/test/java/org/opengroup/osdu/search/service/IndexAliasServiceImplTest.java @@ -0,0 +1,153 @@ +package org.opengroup.osdu.search.service; + + +import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest; +import org.elasticsearch.action.support.master.AcknowledgedResponse; +import org.elasticsearch.client.*; +import org.elasticsearch.cluster.metadata.AliasMetadata; +import org.elasticsearch.rest.RestStatus; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnitRunner; +import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; +import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver; +import org.opengroup.osdu.search.util.ElasticClientHandler; +import org.powermock.api.mockito.PowerMockito; +import org.springframework.context.annotation.Lazy; + +import java.io.IOException; +import java.util.*; + +import static junit.framework.TestCase.assertEquals; +import static junit.framework.TestCase.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.*; +import static org.mockito.MockitoAnnotations.initMocks; + +@RunWith(MockitoJUnitRunner.class) +public class IndexAliasServiceImplTest { + @Mock + private ElasticClientHandler elasticClientHandler; + @Mock + private ElasticIndexNameResolver elasticIndexNameResolver; + @Mock + @Lazy + private JaxRsDpsLog log; + @InjectMocks + private IndexAliasServiceImpl sut; + + private RestHighLevelClient restHighLevelClient; + private IndicesClient indicesClient; + private GetAliasesResponse getAliasesResponse; + + private static String kind = "common:welldb:wellbore:1.2.0"; + private static String index = "common-welldb-wellbore-1.2.0"; + private static String alias = "a1234567890"; + + @Before + public void setup() { + initMocks(this); + indicesClient = PowerMockito.mock(IndicesClient.class); + restHighLevelClient = PowerMockito.mock(RestHighLevelClient.class); + getAliasesResponse = PowerMockito.mock(GetAliasesResponse.class); + } + + @Test + public void getInDicesAliases_when_kind_is_not_supported_for_alias() throws IOException { + when(elasticIndexNameResolver.isIndexAliasSupported(any())).thenReturn(false); + List<String> kinds = Arrays.asList(kind); + Map<String, String> kindAliasMap = sut.getIndicesAliases(kinds); + assertTrue(kindAliasMap.isEmpty()); + } + + @Test + public void getInDicesAliases_when_alias_exist() throws IOException { + setup_when_alias_exist(); + + List<String> kinds = Arrays.asList(kind); + Map<String, String> kindAliasMap = sut.getIndicesAliases(kinds); + verify(this.indicesClient, times(1)).getAlias(any(), any()); + assertTrue(kindAliasMap.containsKey(kind)); + assertEquals(alias, kindAliasMap.get(kind)); + } + + @Test + public void getInDicesAliases_when_alias_exist_with_cache_take_effect() throws IOException { + setup_when_alias_exist(); + + List<String> kinds = Arrays.asList(kind); + Map<String, String> kindAliasMap = sut.getIndicesAliases(kinds); + verify(this.indicesClient, times(1)).getAlias(any(), any()); + assertTrue(kindAliasMap.containsKey(kind)); + assertEquals(alias, kindAliasMap.get(kind)); + + // call again. It should get from cache + sut.getIndicesAliases(kinds); + verify(this.indicesClient, times(1)).getAlias(any(), any()); + } + + @Test + public void getInDicesAliases_when_alias_not_exist_and_create_alias_successfully() throws IOException { + setup_when_alias_not_exist_and_try_create_alias(true); + + List<String> kinds = Arrays.asList(kind); + Map<String, String> kindAliasMap = sut.getIndicesAliases(kinds); + assertTrue(kindAliasMap.containsKey(kind)); + assertEquals(alias, kindAliasMap.get(kind)); + } + + @Test + public void getInDicesAliases_when_alias_not_exist_and_fail_create_alias() throws IOException { + setup_when_alias_not_exist_and_try_create_alias(false); + + List<String> kinds = Arrays.asList(kind); + Map<String, String> kindAliasMap = sut.getIndicesAliases(kinds); + assertTrue(kindAliasMap.isEmpty()); + } + + private void setup_when_alias_exist() throws IOException { + Map<String, Set<AliasMetadata>> aliases = new HashMap<>(); + Set<AliasMetadata> aliasMetadataSet = new HashSet<>(); + aliasMetadataSet.add(AliasMetadata.builder(alias).build()); + aliases.put(index, aliasMetadataSet); + + when(elasticIndexNameResolver.getIndexAliasFromKind(any())).thenReturn(alias); + when(elasticIndexNameResolver.isIndexAliasSupported(any())).thenReturn(true); + when(elasticClientHandler.createRestClient()).thenReturn(restHighLevelClient); + when(restHighLevelClient.indices()).thenReturn(indicesClient); + when(indicesClient.getAlias(any(GetAliasesRequest.class), any(RequestOptions.class))).thenReturn(getAliasesResponse); + when(getAliasesResponse.status()).thenReturn(RestStatus.OK); + when(getAliasesResponse.getAliases()).thenReturn(aliases); + } + + private void setup_when_alias_not_exist_and_try_create_alias(boolean create_ok) throws IOException { + GetAliasesResponse getAliasesResponseWithAliasConstraint = PowerMockito.mock(GetAliasesResponse.class); + Map<String, Set<AliasMetadata>> aliases = new HashMap<>(); + Set<AliasMetadata> aliasMetadataSet = new HashSet<>(); + aliasMetadataSet.add(AliasMetadata.builder("otherAlias").build()); + aliases.put("otherIndex", aliasMetadataSet); + AcknowledgedResponse updateAliasesResponse = new AcknowledgedResponse(create_ok); + when(elasticIndexNameResolver.getIndexNameFromKind(any())).thenReturn(index); + when(elasticIndexNameResolver.getIndexAliasFromKind(any())).thenReturn(alias); + when(elasticIndexNameResolver.isIndexAliasSupported(any())).thenReturn(true); + when(elasticClientHandler.createRestClient()).thenReturn(restHighLevelClient); + when(restHighLevelClient.indices()).thenReturn(indicesClient); + when(indicesClient.getAlias(any(GetAliasesRequest.class), any(RequestOptions.class))) + .thenAnswer(invocation -> + { + GetAliasesRequest request = invocation.getArgument(0); + if(request.aliases().length == 0) + return getAliasesResponse; + else + return getAliasesResponseWithAliasConstraint; + }); + when(getAliasesResponse.status()).thenReturn(RestStatus.OK); + when(getAliasesResponse.getAliases()).thenReturn(aliases); + when(getAliasesResponseWithAliasConstraint.status()).thenReturn(RestStatus.NOT_FOUND); + when(indicesClient.updateAliases(any(IndicesAliasesRequest.class), any(RequestOptions.class))).thenReturn(updateAliasesResponse); + } +} diff --git a/search-core/src/test/java/org/opengroup/osdu/search/util/CrossTenantUtilsTest.java b/search-core/src/test/java/org/opengroup/osdu/search/util/CrossTenantUtilsTest.java index 52955d2314ddd902be22c01c3e52d8ca83381d79..28f857464db759e3d0dffa7ffba9cf0717356ee5 100644 --- a/search-core/src/test/java/org/opengroup/osdu/search/util/CrossTenantUtilsTest.java +++ b/search-core/src/test/java/org/opengroup/osdu/search/util/CrossTenantUtilsTest.java @@ -22,20 +22,28 @@ import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.opengroup.osdu.core.common.model.search.QueryRequest; import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver; +import org.opengroup.osdu.search.service.IndexAliasService; import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) public class CrossTenantUtilsTest { + private static final int MAX_INDEX_NAME_LENGTH = 3840; @Mock private QueryRequest queryRequest; @Mock private ElasticIndexNameResolver elasticIndexNameResolver; + @Mock + private IndexAliasService indexAliasService; @InjectMocks private CrossTenantUtils sut; @@ -57,12 +65,7 @@ public class CrossTenantUtilsTest { kind.add("slb:wks:log:1.0.5"); String indices = "opendes-welldb-wellbore2-1.0.0,opendes-osdudemo-wellbore-1.0.0,opendes-wks-polylineSet-1.0.0,slb-wks-log-1.0.5,-.*"; when(queryRequest.getKind()).thenReturn(kind); - when(this.elasticIndexNameResolver.getIndexNameFromKind(anyString())).thenAnswer(invocation -> - { - String kd = invocation.getArgument(0); - kd = kd.replace(":", "-"); - return kd; - }); + mock_getIndexNameFromKind(); assertEquals(indices, this.sut.getIndexName(queryRequest)); } @@ -71,12 +74,84 @@ public class CrossTenantUtilsTest { String kind = "opendes:welldb:wellbore2:1.0.0,opendes:osdudemo:wellbore:1.0.0,opendes:wks:polylineSet:1.0.0,slb:wks:log:1.0.5"; String indices = "opendes-welldb-wellbore2-1.0.0,opendes-osdudemo-wellbore-1.0.0,opendes-wks-polylineSet-1.0.0,slb-wks-log-1.0.5,-.*"; when(queryRequest.getKind()).thenReturn(kind); + mock_getIndexNameFromKind(); + assertEquals(indices, this.sut.getIndexName(queryRequest)); + } + + @Test + public void should_returnMultiIndicesAsIs_when_total_length_is_not_longer_than_max_length() { + List<String> kinds = getKindsNotLongerThan(MAX_INDEX_NAME_LENGTH); + when(queryRequest.getKind()).thenReturn(kinds); + mock_getIndexNameFromKind(); + assertEquals(getIndexName(kinds), this.sut.getIndexName(queryRequest)); + } + + @Test + public void should_returnMultiIndices_aliases_when_total_length_is_longer_than_max_length() { + List<String> kinds = getKindsNotLongerThan(MAX_INDEX_NAME_LENGTH * 2); + String alias = "a1234567890"; + Map<String, String> kindAliasMap = new HashMap<>(); + kindAliasMap.put(kinds.get(0), alias); + + when(indexAliasService.getIndicesAliases(any())).thenReturn(kindAliasMap); + when(queryRequest.getKind()).thenReturn(kinds); + mock_getIndexNameFromKind(); + assertEquals(getIndexName(kinds.size(), alias), this.sut.getIndexName(queryRequest)); + } + + @Test + public void should_returnMultiIndicesAsIs_when_total_length_is_longer_than_max_length_but_alias_exist() { + List<String> kinds = getKindsNotLongerThan(MAX_INDEX_NAME_LENGTH * 2); + Map<String, String> kindAliasMap = new HashMap<>(); + + when(indexAliasService.getIndicesAliases(any())).thenReturn(kindAliasMap); + when(queryRequest.getKind()).thenReturn(kinds); + mock_getIndexNameFromKind(); + assertEquals(getIndexName(kinds), this.sut.getIndexName(queryRequest)); + } + + private void mock_getIndexNameFromKind() { when(this.elasticIndexNameResolver.getIndexNameFromKind(anyString())).thenAnswer(invocation -> { String kd = invocation.getArgument(0); kd = kd.replace(":", "-"); return kd; }); - assertEquals(indices, this.sut.getIndexName(queryRequest)); + } + + private List<String> getKindsNotLongerThan(int length) { + String kind = "osdu:wks:master-data-wellbore:1.0.0"; + ArrayList kinds = new ArrayList(); + int lengthPerKind = kind.length() + 1; // 1 is comma + int totalLength = "-.*".length(); + int n = 0; + while (totalLength + lengthPerKind<= length) { + kinds.add(kind); + totalLength += lengthPerKind; + } + return kinds; + } + + private String getIndexName(int numberOfAlias, String alias) { + StringBuilder builder = new StringBuilder(); + int n = 0; + while(n < numberOfAlias) { + builder.append(alias); + builder.append(","); + n++; + } + builder.append("-.*"); + return builder.toString(); + } + + private String getIndexName(List<String> kinds) { + StringBuilder builder = new StringBuilder(); + for(String kind : kinds) { + String index = kind.replace(":", "-"); + builder.append(index); + builder.append(","); + } + builder.append("-.*"); + return builder.toString(); } } diff --git a/testing/integration-tests/search-test-aws/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/Steps.java b/testing/integration-tests/search-test-aws/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/Steps.java index 88e3a68ac091f36004ae4709401999790009f2ee..56ae6a0e25e13453c323290dc9554f3a9cd3df80 100644 --- a/testing/integration-tests/search-test-aws/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/Steps.java +++ b/testing/integration-tests/search-test-aws/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/Steps.java @@ -65,6 +65,11 @@ public class Steps extends QuerySteps { super.i_send_with(query, kind); } + @When("^I send \"(.*?)\" with (\\d+) copies of \"(.*?)\"$") + public void i_send_with_multi_kinds(String query, int number, String kind) { + super.i_send_with_multi_kinds(query, number, kind); + } + @When("^I want the results sorted by (.*?)$") public void i_sort_with(String sortJson) { super.i_sort_with(sortJson); @@ -174,4 +179,4 @@ public class Steps extends QuerySteps { protected String getApi() { return Config.getSearchBaseURL() + "query"; } -} \ No newline at end of file +} diff --git a/testing/integration-tests/search-test-azure/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/Steps.java b/testing/integration-tests/search-test-azure/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/Steps.java index bda2d5dc9be9c9dbcd1e17a20237656d4b210347..7580e5cf7f85dccfc969ca4645bfae262dd296b9 100644 --- a/testing/integration-tests/search-test-azure/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/Steps.java +++ b/testing/integration-tests/search-test-azure/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/Steps.java @@ -66,6 +66,11 @@ public class Steps extends QuerySteps { super.i_send_with(query, kind); } + @When("^I send \"(.*?)\" with (\\d+) copies of \"(.*?)\"$") + public void i_send_with_multi_kinds(String query, int number, String kind) { + super.i_send_with_multi_kinds(query, number, kind); + } + @When("^I want the results sorted by (.*?)$") public void i_sort_with(String sortJson) { super.i_sort_with(sortJson); diff --git a/testing/integration-tests/search-test-azure/src/test/resources/features/query/singlecluster/SingleClusterQuery.feature b/testing/integration-tests/search-test-azure/src/test/resources/features/query/singlecluster/SingleClusterQuery.feature index 52373c492630d54ce4bd02c059f3e5d346c88543..324b70137184c89e57decb2a38d86c814da1cf91 100644 --- a/testing/integration-tests/search-test-azure/src/test/resources/features/query/singlecluster/SingleClusterQuery.feature +++ b/testing/integration-tests/search-test-azure/src/test/resources/features/query/singlecluster/SingleClusterQuery.feature @@ -15,6 +15,7 @@ Feature: Search with different queries | "tenant1:search<timestamp>:test-data--Integration:1.0.1" | "records_1" | "data.default.viewers@tenant1"| | "tenant1:search<timestamp>:test-data2--Integration:1.0.2" | "records_2" | "data.default.viewers@tenant1"| | "tenant1:well<timestamp>:test-data3--Integration:1.0.3" | "records_4" | "data.default.viewers@tenant1" | + Scenario Outline: Search data in a given kind When I send <query> with <kind> And I limit the count of returned results to <limit> @@ -41,6 +42,21 @@ Feature: Search with different queries | "tenant1" | "tenant1:search<timestamp>:test-data--Integration:1.0.1" | ""OFFICE2" \| OFFICE3" | None | None | All | 1 | | "tenant1" | "tenant1:search<timestamp>:test-data2--Integration:1.0.2" | "data.Well\*:(Data Lake Cloud)" | None | None | All | 3 | + Scenario Outline: Search data in a given kind with hundreds of copies + When I send <query> with <number> copies of <kind> + And I limit the count of returned results to <limit> + And I set the offset of starting point as <offset> + And I set the fields I want in response as <returned_fields> + And I send request to tenant <tenant> + Then I should get in response <count> records with <returned_fields> + + Examples: + | tenant | kind | number | query | limit | offset | returned_fields | count | + | "tenant1" | "tenant1:search<timestamp>:test-data--Integration:1.0.1" | 300 | "data.OriginalOperator:OFFICE4" | None | None | All | 1 | + | "tenant1" | "tenant1:search<timestamp>:test-data--Integration:1.0.1" | 300 | None | 0 | None | NULL | 3 | + | "tenant1" | "tenant1:search<timestamp>:test-data2--Integration:1.0.2" | 300 | None | 0 | None | NULL | 3 | + + Scenario Outline: Search data in a given a kind with invalid inputs When I send <query> with <kind> And I limit the count of returned results to <limit> diff --git a/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/common/QueryBase.java b/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/common/QueryBase.java index c82fe282733f5a3cfe444f397ccdb5eb338006d2..5976688b555a13a815831c905947840ebe60d95d 100644 --- a/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/common/QueryBase.java +++ b/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/common/QueryBase.java @@ -47,6 +47,19 @@ public class QueryBase extends TestsBase { requestQuery.setKind(generateActualName(kind, timeStamp)); } + public void i_send_with_multi_kinds(String query, int number, String kind) { + requestQuery.setQuery(query); + String actualKind = generateActualName(kind, timeStamp); + StringBuilder builder = new StringBuilder(); + for(int i = 0; i < number; i++) { + if(builder.length() > 0) { + builder.append(","); + } + builder.append(actualKind); + } + requestQuery.setKind(builder.toString()); + } + public void i_set_the_fields_I_want_in_response_as(List<String> returnedFileds) { if(returnedFileds.contains("NULL")) requestQuery.setReturnedFields(null); else if (!returnedFileds.contains("All")) requestQuery.setReturnedFields(returnedFileds); diff --git a/testing/integration-tests/search-test-core/src/main/resources/features/query/singlecluster/Query.feature b/testing/integration-tests/search-test-core/src/main/resources/features/query/singlecluster/Query.feature index 9742bd9ed2e2372d9c49ace0bba2c1d5c824cef5..90185ae8800c03d2eb264378b0a84930bcba05e8 100644 --- a/testing/integration-tests/search-test-core/src/main/resources/features/query/singlecluster/Query.feature +++ b/testing/integration-tests/search-test-core/src/main/resources/features/query/singlecluster/Query.feature @@ -41,6 +41,20 @@ Feature: Search with different queries | "tenant1" | "tenant1:search<timestamp>:test-data--Integration:1.0.1" | ""OFFICE2" \| OFFICE3" | None | None | All | 1 | | "tenant1" | "tenant1:search<timestamp>:test-data2--Integration:1.0.2" | "data.Well\*:(Data Lake Cloud)" | None | None | All | 3 | + Scenario Outline: Search data in a given kind with hundreds of copies + When I send <query> with <number> copies of <kind> + And I limit the count of returned results to <limit> + And I set the offset of starting point as <offset> + And I set the fields I want in response as <returned_fields> + And I send request to tenant <tenant> + Then I should get in response <count> records with <returned_fields> + + Examples: + | tenant | kind | number | query | limit | offset | returned_fields | count | + | "tenant1" | "tenant1:search<timestamp>:test-data--Integration:1.0.1" | 300 | "data.OriginalOperator:OFFICE4" | None | None | All | 1 | + | "tenant1" | "tenant1:search<timestamp>:test-data--Integration:1.0.1" | 300 | None | 0 | None | NULL | 3 | + | "tenant1" | "tenant1:search<timestamp>:test-data2--Integration:1.0.2" | 300 | None | 0 | None | NULL | 3 | + Scenario Outline: Search data in a given a kind with invalid inputs When I send <query> with <kind> And I limit the count of returned results to <limit> diff --git a/testing/integration-tests/search-test-gc/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/Steps.java b/testing/integration-tests/search-test-gc/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/Steps.java index 07d1e3052b40762ce3876aa9ca164a54a934ed92..569246132ad2183d1012329634e9b0dd5ffa7fdd 100644 --- a/testing/integration-tests/search-test-gc/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/Steps.java +++ b/testing/integration-tests/search-test-gc/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/Steps.java @@ -52,6 +52,11 @@ public class Steps extends QuerySteps { super.i_send_with(query, kind); } + @When("^I send \"(.*?)\" with (\\d+) copies of \"(.*?)\"$") + public void i_send_with_multi_kinds(String query, int number, String kind) { + super.i_send_with_multi_kinds(query, number, kind); + } + @When("^I want the results sorted by (.*?)$") public void i_sort_with(String sortJson) { super.i_sort_with(sortJson); @@ -161,4 +166,4 @@ public class Steps extends QuerySteps { protected String getApi() { return Config.getSearchBaseURL() + "query"; } -} \ No newline at end of file +} diff --git a/testing/integration-tests/search-test-ibm/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/Steps.java b/testing/integration-tests/search-test-ibm/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/Steps.java index f0cbe44fec31889ac531473830ff259fbc5d47d4..c080f850562560bfacc4c8f3cf039e7db15275dc 100644 --- a/testing/integration-tests/search-test-ibm/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/Steps.java +++ b/testing/integration-tests/search-test-ibm/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/Steps.java @@ -52,6 +52,11 @@ public class Steps extends QuerySteps { super.i_send_with(query, kind); } + @When("^I send \"(.*?)\" with (\\d+) copies of \"(.*?)\"$") + public void i_send_with_multi_kinds(String query, int number, String kind) { + super.i_send_with_multi_kinds(query, number, kind); + } + @When("^I want the results sorted by (.*?)$") public void i_sort_with(String sortJson) { super.i_sort_with(sortJson); @@ -149,4 +154,4 @@ public class Steps extends QuerySteps { protected String getApi() { return Config.getSearchBaseURL() + "query"; } -} \ No newline at end of file +}