From 95e69c76141c7b3479d9de791583915756775160 Mon Sep 17 00:00:00 2001 From: Josh Fix Date: Thu, 3 Jun 2021 17:41:23 -0400 Subject: [PATCH] V1.0.0 (#18) * Initial 1.0.0 commit * fixed conformance * Added CORS config * tiny typo (#17) Saw a tiny typo and wanted to get on the board. Great stuff * Removed properties from collections Co-authored-by: zachrouseFE <39569018+zachrouseFE@users.noreply.github.com> --- README.md | 100 +----------------- pom.xml | 36 +------ staccato-application/Dockerfile | 5 +- staccato-application/pom.xml | 7 +- .../planet/staccato/catalog/RootCatalog.java | 6 +- .../staccato/config/ExtensionConfig.java | 2 +- .../staccato/config/StacConfiguration.java | 17 +++ .../staccato/config/StacWebFluxConfig.java | 12 --- .../staccato/filters/VersionFilter.java | 40 +++++++ .../staccato/oaf/DefaultOafService.java | 28 ++--- .../java/com/planet/staccato/oaf/OafApi.java | 4 +- .../planet/staccato/oaf/OafController.java | 4 +- .../src/main/resources/application.yml | 2 +- .../src/main/resources/banner.txt | 2 +- staccato-collections/landsat8/pom.xml | 2 +- .../staccato/landsat8/Landsat8AutoConfig.java | 4 + .../landsat8/Landsat8CollectionMetadata.java | 9 +- staccato-collections/planet/pom.xml | 2 +- .../staccato/planet/PlanetAutoConfig.java | 4 + .../planet/PlanetCollectionMetadata.java | 4 +- staccato-collections/pom.xml | 2 +- staccato-commons/pom.xml | 2 +- .../collection/CollectionMetadata.java | 4 - .../collection/CollectionMetadataAdapter.java | 8 +- .../com/planet/staccato/model/Catalog.java | 5 +- staccato-community/pom.xml | 16 +-- .../staccato-community-grpc/pom.xml | 4 +- .../staccato-community-kafka/pom.xml | 2 +- staccato-elasticsearch/pom.xml | 3 +- .../es/api/ElasticsearchApiService.java | 4 +- 30 files changed, 127 insertions(+), 213 deletions(-) delete mode 100644 staccato-application/src/main/java/com/planet/staccato/config/StacWebFluxConfig.java create mode 100644 staccato-application/src/main/java/com/planet/staccato/filters/VersionFilter.java diff --git a/README.md b/README.md index 7b51936..00d637c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ## About Staccato is a server that enables browsing and search of geospatial assets like satellite imagery. It implements the -SpatioTemporal Asset Catalog (STAC) v0.8.0 standard and is backed by [Elasticsearch](https://www.elastic.co/products/elasticsearch). +SpatioTemporal Asset Catalog (STAC) v1.0.0 standard and is backed by [Elasticsearch](https://www.elastic.co/products/elasticsearch). In addition to the core STAC catalog browsing and search functionality, it includes support for transactions, statistics, auto-generated schemas, [gRPC](https://grpc.io/) endpoints and [Kafka](https://kafka.apache.org/) ingestion. @@ -55,31 +55,6 @@ Any of the following methods are acceptable ways of running Staccato ## Endpoints -### API Endpoints - -- GET /search - dynamic catalog endpoint -- GET /search/{id} - returns an item by ID - -### Collection Endpoints - -- GET /collection/{collection_id} - retrieves a collection by ID -- GET /collection/{collection_id}/items - retrieves a collection of items belonging to a collection -- GET /collection/{collection_id}/items/{id} - retrieves an item by ID from a collection - -### Catalog Endpoints - -- GET / - retrieves the root catalog -- GET /stac/{catalog_id} - retrieves a catalog by ID -- GET /stac/{catalog_id}/items - retrieves a collection of items belonging to a collection -- GET /stac/{collection_id}/items/{id} - retrieves an item by ID from a collection - -### Transaction Endpoints - -- POST /collection/{collection_id}/items - creates a new item -- PUT /collection/{collection_id}/items/{item_id} - creates a new item -- PATCH /collection/{collection_id}/items/{item_id} - updates an item item -- DELETE /collection/{collection_id}/items/{item_id} - deletes an item - ### Stats Endpoints - GET /stats - retrieves aggregations for all collections @@ -94,72 +69,6 @@ Any of the following methods are acceptable ways of running Staccato - GET /actuator - returns a list of utility endpoints for the application -### Query Parameters (all optional) -- **limit** the maximum number of items to return, example limit=100 -- **page** to paginate, example page=2 (for the second page of results) -- **time** implicit range query, example time=1995-01-01T00:00:2005-01-01T00:00:00 -- **bbox** implicit intersects query, example bbox=-180,-90,180,90 -- **intersects** a valid GeoJSON geometry -- **query** a Common Query Language text string to query properties of the catalog entry (see below for examples) -- **ids** a list of comma separated IDs to be returned -- **collections** a list of comma separated collection IDs on which to filter the results -- **fields** a comma separated list of json field names to include in the result; fields to be excluded can be prefixed with "-" -- **sortby** a comma separated list of fields to sort by - -Examples: -_GET_ -- -- [https://stac.boundlessgeo.io/search?query=landsat:wrs_path=105 AND landsat:wrs_row=83](https://stac.boundlessgeo.io/stac/search?query=landsat:wrs_path=105%20AND%20landsat:wrs_row=83) -- -- [https://stac.boundlessgeo.io/search?limit=20&page=2&query=eo:cloud_cover<0.1&bbox=27.3245,29.85465,30.5214,31.8685&time=2018-02-12T00:00:00Z/2019-06-12T00:00:00Z](https://stac.boundlessgeo.io/stac/search?limit=20&page=2&query=eo:cloud_cover%3C.1&bbox=27.3245,29.85465,30.5214,31.8685&time=2018-02-12T00:00:00Z/2019-06-12T00:00:00Z) - -_POST_ - -```json -{ - "fields": { - "include": ["id", "bbox"] - } -} -``` -```json -{ - "query": "landsat:wrs_path=105 AND landsat:wrs_row=83" -} -``` -```json -{ - "ids": ["LC81050832019135LGN00", "LC81050822019135LGN00"], - "collections": ["landsat-8-l1"] -} -``` -```json -{ - "limit": 2, - "query": "eo:cloud_cover<0.1", - "time": "2018-02-12T00:00:00Z/2019-06-12T00:00:00Z", - "intersects": { - "type": "Polygon", - "coordinates": [[ - [-77.08248138427734, 38.788612962793636], [-77.01896667480469, 38.788612962793636], - [-77.01896667480469, 38.835161408189364], [-77.08248138427734, 38.835161408189364], - [-77.08248138427734, 38.788612962793636] - ]] - }, - "sort": [ - { - "field": "properties.eo:cloud_cover", - "direction": "desc" - }, - { - "field": "properties.landsat:image_quality_tirs", - "direction": "asc" - } - ] -} -``` - - ## Configuration The STAC API has several properties that are configurable from the command line, as environment properties in the @@ -178,7 +87,7 @@ staccato.es.host | localhost | The hostname of the Elasticsearch aggregationServ staccato.es.port | 9200 | The Elasticsearch aggregationService port staccato.es.number-of-shards | 5 | The number of shards used when auto-initializing an Elasticsearch index staccato.es.number-of-replicas | 0 | The number of replicas used when auto-initializing an Elasticsearch index -staccato.es.type | _doc | The Elasticsearch document type. It is not recommended to change this from it's default value as "_doc" will be the only value supported in ES7 +staccato.es.type | _doc | The Elasticsearch document type. It is not recommended to change this from its default value as "_doc" will be the only value supported in ES7 staccato.es.max-reconnection-attempts | 10 | The number of reconnection attempts to the Elasticsearch aggregationService staccato.es.rest-client-max-connections-total | 200 | The Elasticsearch client threadpool size. This is the maximum number of connections a single STAC instance may have open to Elasticsearch. staccato.es.rest-client-max-connections-per-route | 200 | The maximum number of Elasticsearch client connections per route. @@ -310,7 +219,7 @@ It is also important to note that this implementation currently relies on implem the `collection` field in every item. Because each collection will have a different properties implementation that may implement several different extension interfaces or custom fieldsExtension, Jackson cannot deserialize Item classes without more information on which properties class to deserialize to. Having the "collections" field in each item provides an -extremely convenient 1:1 relationship between the item and it's properties implementation. The Jackson configuration +extremely convenient 1:1 relationship between the item and its properties implementation. The Jackson configuration for this can be found [here](./staccato-application/src/main/java/com/planet/staccato/config/ExtensionConfig.java). ### Custom annotations @@ -331,7 +240,6 @@ methods with this annotation and build a subcatalog link containing the field na containing all unique values in Elasticsearch for that field. After all eligible subcatalog fieldsExtension have been traversed, the links section will be populated with links to all items that match the selected subcatalog values. - ## Elasticsearch ### Automatic Initialization @@ -414,7 +322,7 @@ Elasticsearch to rollover the index. When the criteria has been met, Elasticsea index named `my-index-name-000002`. Because this name matches the pattern `my-index-name-*` that was established in our template, all of the shard, read replica, mapping, etc configuration will automatically be applied. In addition, the `my-index-name` write alias will automatically be changed to point to `my-index-name-000002`, and the search alias -`my-index-name-search` will add to it's list. `my-index-name-000002`. When executing searches against the search +`my-index-name-search` will add to its list. `my-index-name-000002`. When executing searches against the search alias `my=index-name-search`, Elasticsearch will return matches from both indexes, `my-index-name-000001` and `my-index-name-000002`. The one important note: if a record needs to be updated, you need to first determine which actual index it belongs to and update it on that index. diff --git a/pom.xml b/pom.xml index 97d5f94..04e418f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,13 +5,13 @@ com.planet.staccato staccato - 1.0.0-rc.2 + 1.0.0 pom org.springframework.boot spring-boot-starter-parent - 2.4.4 + 2.4.6 @@ -45,7 +45,7 @@ org.springframework.cloud spring-cloud-dependencies - Hoxton.SR1 + Hoxton.SR11 pom import @@ -131,34 +131,6 @@ false - osgeo OSGeo Repository @@ -193,7 +165,7 @@ central Maven Plugin Repository - http://repo1.maven.org/maven2 + https://repo1.maven.org/maven2 spring-snapshots diff --git a/staccato-application/Dockerfile b/staccato-application/Dockerfile index 3279ee5..9420761 100644 --- a/staccato-application/Dockerfile +++ b/staccato-application/Dockerfile @@ -4,7 +4,8 @@ MAINTAINER josh@federal.planet.com ARG JAR_NAME ENV JAR_NAME $JAR_NAME -COPY target/${JAR_NAME} /${JAR_NAME} +#COPY target/${JAR_NAME} /${JAR_NAME} +ADD target/${JAR_NAME} /${JAR_NAME} -ENTRYPOINT java -jar /$JAR_NAME +ENTRYPOINT ["java", "-jar", "/staccato-1.0.0.jar"] #ENTRYPOINT java "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" -jar /$JAR_NAME \ No newline at end of file diff --git a/staccato-application/pom.xml b/staccato-application/pom.xml index f365d05..5e423f2 100644 --- a/staccato-application/pom.xml +++ b/staccato-application/pom.xml @@ -12,13 +12,13 @@ com.planet.staccato staccato - 1.0.0-rc.2 + 1.0.0 UTF-8 UTF-8 - 1.4.4 + 1.4.13 @@ -177,7 +177,8 @@ - quay.io/boundlessgeo/staccato + + gcr.io/focus-cargo-315523/staccato ${project.version} staccato-${project.version}.jar diff --git a/staccato-application/src/main/java/com/planet/staccato/catalog/RootCatalog.java b/staccato-application/src/main/java/com/planet/staccato/catalog/RootCatalog.java index 0c491cf..0823ee9 100644 --- a/staccato-application/src/main/java/com/planet/staccato/catalog/RootCatalog.java +++ b/staccato-application/src/main/java/com/planet/staccato/catalog/RootCatalog.java @@ -4,13 +4,15 @@ import lombok.Data; import lombok.RequiredArgsConstructor; +import java.util.List; + @Data @RequiredArgsConstructor public class RootCatalog extends Catalog { - protected Object conformsTo; + protected String[] conformsTo; - public Catalog conformsTo(Object conformsTo) { + public Catalog conformsTo(String[] conformsTo) { setConformsTo(conformsTo); return this; } diff --git a/staccato-application/src/main/java/com/planet/staccato/config/ExtensionConfig.java b/staccato-application/src/main/java/com/planet/staccato/config/ExtensionConfig.java index a776ce3..63f74f1 100644 --- a/staccato-application/src/main/java/com/planet/staccato/config/ExtensionConfig.java +++ b/staccato-application/src/main/java/com/planet/staccato/config/ExtensionConfig.java @@ -41,7 +41,7 @@ public void init() { mapper.addMixIn(Item.class, ItemMixin.class); collectionMetadataList.forEach(metadata -> { - metadata.setVersion(configProps.getVersion()); + metadata.setStacVersion(configProps.getVersion()); NamedType namedType = new NamedType(metadata.getProperties().getClass(), metadata.getId()); mapper.registerSubtypes(namedType); }); diff --git a/staccato-application/src/main/java/com/planet/staccato/config/StacConfiguration.java b/staccato-application/src/main/java/com/planet/staccato/config/StacConfiguration.java index 14d1cba..a383737 100644 --- a/staccato-application/src/main/java/com/planet/staccato/config/StacConfiguration.java +++ b/staccato-application/src/main/java/com/planet/staccato/config/StacConfiguration.java @@ -5,6 +5,9 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.stereotype.Component; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.reactive.CorsWebFilter; +import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource; import java.util.HashMap; import java.util.List; @@ -28,4 +31,18 @@ public Map collectionMetadataMap() { return metadataMap; } + @Bean + public CorsWebFilter corsWebFilter() { + CorsConfiguration corsConfig = new CorsConfiguration(); + corsConfig.setAllowedOrigins(List.of("*")); + corsConfig.setMaxAge(8000L); + corsConfig.addAllowedMethod("*"); + + UrlBasedCorsConfigurationSource source = + new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/**", corsConfig); + + return new CorsWebFilter(source); + } + } diff --git a/staccato-application/src/main/java/com/planet/staccato/config/StacWebFluxConfig.java b/staccato-application/src/main/java/com/planet/staccato/config/StacWebFluxConfig.java deleted file mode 100644 index 5eb1173..0000000 --- a/staccato-application/src/main/java/com/planet/staccato/config/StacWebFluxConfig.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.planet.staccato.config; - -import org.springframework.context.annotation.Configuration; - -/** - * @author joshfix - * Created on 2/28/19 - */ -@Configuration -//@EnableWebFlux -public class StacWebFluxConfig { -} diff --git a/staccato-application/src/main/java/com/planet/staccato/filters/VersionFilter.java b/staccato-application/src/main/java/com/planet/staccato/filters/VersionFilter.java new file mode 100644 index 0000000..96bd221 --- /dev/null +++ b/staccato-application/src/main/java/com/planet/staccato/filters/VersionFilter.java @@ -0,0 +1,40 @@ +package com.planet.staccato.filters; + +import com.planet.staccato.config.LinksConfigProps; +import com.planet.staccato.config.StacConfigProps; +import com.planet.staccato.config.StaccatoMediaType; +import com.planet.staccato.dto.api.SearchRequest; +import com.planet.staccato.model.Item; +import com.planet.staccato.model.Link; +import lombok.RequiredArgsConstructor; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * We do not want to store links in the database, as the deployed hostname/DNS is subject to change. This class will + * dynamically build links using the configured protocol/host/port. + * + * @author joshfix + * Created on 2/12/18 + */ +@Component +@RequiredArgsConstructor +public class VersionFilter implements ItemSearchFilter { + + private final StacConfigProps stacConfigProps; + private final static Set types = new HashSet<>(Arrays.asList("*")); + + @Override + public Set types() { + return types; + } + + @Override + public Item doFilter(Item item, SearchRequest request) { + return item.stacVersion(stacConfigProps.getVersion()); + } +} diff --git a/staccato-application/src/main/java/com/planet/staccato/oaf/DefaultOafService.java b/staccato-application/src/main/java/com/planet/staccato/oaf/DefaultOafService.java index e9135a7..6b89d9b 100644 --- a/staccato-application/src/main/java/com/planet/staccato/oaf/DefaultOafService.java +++ b/staccato-application/src/main/java/com/planet/staccato/oaf/DefaultOafService.java @@ -15,6 +15,7 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; +import java.util.Arrays; import java.util.List; /** @@ -27,25 +28,18 @@ public class DefaultOafService { private final List queryables; private final ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); - private final Conformance conformance = new Conformance(); + private final String[] conformance = new String[]{ + "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core", + //"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30", + "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/html", + "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson", + "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/x-cql-text" + }; public DefaultOafService(List queryables) { this.queryables = queryables; } - @PostConstruct - public void init() { - initConformance(); - } - - private void initConformance() { - conformance.setConformsTo(List.of("http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core", - //"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30", - "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/html", - "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson", - "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/x-cql-text")); - } - public Mono getApi() { try { Resource catalogResource = new UrlResource("https://raw.githubusercontent.com/radiantearth/stac-spec/568a04821935cc92de7b4b05ea6fa9f6bf8a0592/api-spec/openapi/OAFeat.yaml"); @@ -57,12 +51,12 @@ public Mono getApi() { } } - public Conformance getConformance() { + public String[] getConformance() { return conformance; } - public Mono getConformanceMono() { - return Mono.just(conformance); + public Mono> getConformanceMono() { + return Flux.just(conformance).collectList(); } public Flux getQueryables() { diff --git a/staccato-application/src/main/java/com/planet/staccato/oaf/OafApi.java b/staccato-application/src/main/java/com/planet/staccato/oaf/OafApi.java index 32b7690..5d708b6 100644 --- a/staccato-application/src/main/java/com/planet/staccato/oaf/OafApi.java +++ b/staccato-application/src/main/java/com/planet/staccato/oaf/OafApi.java @@ -8,6 +8,8 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import java.util.List; + /** * @author joshfix * Created on 2019-09-23 @@ -19,7 +21,7 @@ public interface OafApi { Mono getApi(); @GetMapping(path = "/conformance", produces = MediaType.APPLICATION_JSON_VALUE) - Mono getConformance(); + Mono> getConformance(); @GetMapping(path = "/queryables", produces = StaccatoMediaType.APPLICATION_SCHEMA_JSON_VALUE) Flux getQueryables(); diff --git a/staccato-application/src/main/java/com/planet/staccato/oaf/OafController.java b/staccato-application/src/main/java/com/planet/staccato/oaf/OafController.java index 316b2fa..58c0514 100644 --- a/staccato-application/src/main/java/com/planet/staccato/oaf/OafController.java +++ b/staccato-application/src/main/java/com/planet/staccato/oaf/OafController.java @@ -7,6 +7,8 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import java.util.List; + /** * @author joshfix * Created on 2019-09-23 @@ -23,7 +25,7 @@ public Mono getApi() { } @Override - public Mono getConformance() { + public Mono> getConformance() { return service.getConformanceMono(); } diff --git a/staccato-application/src/main/resources/application.yml b/staccato-application/src/main/resources/application.yml index 5af02d0..92f2ed2 100644 --- a/staccato-application/src/main/resources/application.yml +++ b/staccato-application/src/main/resources/application.yml @@ -48,7 +48,7 @@ logging: #org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping: WARN staccato: - version: 1.0.0-rc.2 + version: 1.0.0 rsocket: enabled: false kafka: diff --git a/staccato-application/src/main/resources/banner.txt b/staccato-application/src/main/resources/banner.txt index dd43ef8..13a19c1 100644 --- a/staccato-application/src/main/resources/banner.txt +++ b/staccato-application/src/main/resources/banner.txt @@ -4,4 +4,4 @@ ___/ / /_/ /_/ / /__/ /__/ /_/ / /_/ /_/ / /____/\__/\__,_/\___/\___/\__,_/\__/\____/ -v1.0.0-rc.2 \ No newline at end of file +v1.0.0 \ No newline at end of file diff --git a/staccato-collections/landsat8/pom.xml b/staccato-collections/landsat8/pom.xml index 8f9de30..4ac5f39 100644 --- a/staccato-collections/landsat8/pom.xml +++ b/staccato-collections/landsat8/pom.xml @@ -9,7 +9,7 @@ com.planet.staccato staccato-collections - 1.0.0-rc.2 + 1.0.0 diff --git a/staccato-collections/landsat8/src/main/java/com/planet/staccato/landsat8/Landsat8AutoConfig.java b/staccato-collections/landsat8/src/main/java/com/planet/staccato/landsat8/Landsat8AutoConfig.java index 2e13c29..a54cf12 100644 --- a/staccato-collections/landsat8/src/main/java/com/planet/staccato/landsat8/Landsat8AutoConfig.java +++ b/staccato-collections/landsat8/src/main/java/com/planet/staccato/landsat8/Landsat8AutoConfig.java @@ -4,6 +4,7 @@ import com.planet.staccato.collection.CollectionMetadata; import com.planet.staccato.collection.LinkHelper; import com.planet.staccato.config.LinksConfigProps; +import com.planet.staccato.config.StacConfigProps; import com.planet.staccato.queryables.QueryableProperty; import com.planet.staccato.queryables.Queryables; import lombok.AllArgsConstructor; @@ -22,10 +23,12 @@ public class Landsat8AutoConfig { // autowiring this in ensures the static LINK_PREFIX value is built private final LinksConfigProps linksConfigProps; + private final StacConfigProps stacConfigProps; @Bean public CollectionMetadata landsat8Collection() { Landsat8CollectionMetadata metadata = new Landsat8CollectionMetadata(); + metadata.setStacVersion(stacConfigProps.getVersion()); metadata.links(LinkHelper.buildCollectionLinks(metadata.getId())) .catalogType(CatalogType.COLLECTION); return metadata; @@ -34,6 +37,7 @@ public CollectionMetadata landsat8Collection() { @Bean public CollectionMetadata landsat8Catalog() { Landsat8CollectionMetadata metadata = new Landsat8CollectionMetadata(); + metadata.setStacVersion(stacConfigProps.getVersion()); metadata.links(LinkHelper.buildCollectionLinks(metadata.getId())) .setCatalogType(CatalogType.CATALOG); return metadata; diff --git a/staccato-collections/landsat8/src/main/java/com/planet/staccato/landsat8/Landsat8CollectionMetadata.java b/staccato-collections/landsat8/src/main/java/com/planet/staccato/landsat8/Landsat8CollectionMetadata.java index 23bb6fc..1d9954e 100644 --- a/staccato-collections/landsat8/src/main/java/com/planet/staccato/landsat8/Landsat8CollectionMetadata.java +++ b/staccato-collections/landsat8/src/main/java/com/planet/staccato/landsat8/Landsat8CollectionMetadata.java @@ -28,17 +28,16 @@ public class Landsat8CollectionMetadata extends CollectionMetadataAdapter buildBands() { return bands; } - +*/ } diff --git a/staccato-collections/planet/pom.xml b/staccato-collections/planet/pom.xml index 2c05222..210510c 100644 --- a/staccato-collections/planet/pom.xml +++ b/staccato-collections/planet/pom.xml @@ -9,7 +9,7 @@ com.planet.staccato staccato-collections - 1.0.0-rc.2 + 1.0.0 diff --git a/staccato-collections/planet/src/main/java/com/planet/staccato/planet/PlanetAutoConfig.java b/staccato-collections/planet/src/main/java/com/planet/staccato/planet/PlanetAutoConfig.java index 9588620..5eac7be 100644 --- a/staccato-collections/planet/src/main/java/com/planet/staccato/planet/PlanetAutoConfig.java +++ b/staccato-collections/planet/src/main/java/com/planet/staccato/planet/PlanetAutoConfig.java @@ -4,6 +4,7 @@ import com.planet.staccato.collection.CollectionMetadata; import com.planet.staccato.collection.LinkHelper; import com.planet.staccato.config.LinksConfigProps; +import com.planet.staccato.config.StacConfigProps; import com.planet.staccato.queryables.QueryableProperty; import com.planet.staccato.queryables.Queryables; import lombok.AllArgsConstructor; @@ -22,10 +23,12 @@ public class PlanetAutoConfig { // autowiring this in ensures the static LINK_PREFIX value is built private final LinksConfigProps linksConfigProps; + private final StacConfigProps stacConfigProps; @Bean public CollectionMetadata planetCollection() { PlanetCollectionMetadata metadata = new PlanetCollectionMetadata(); + metadata.setStacVersion(stacConfigProps.getVersion()); metadata.links(LinkHelper.buildCollectionLinks(metadata.getId())) .catalogType(CatalogType.COLLECTION); return metadata; @@ -34,6 +37,7 @@ public CollectionMetadata planetCollection() { @Bean public CollectionMetadata planetCatalog() { PlanetCollectionMetadata metadata = new PlanetCollectionMetadata(); + metadata.setStacVersion(stacConfigProps.getVersion()); metadata.links(LinkHelper.buildCollectionLinks(metadata.getId())) .setCatalogType(CatalogType.CATALOG); return metadata; diff --git a/staccato-collections/planet/src/main/java/com/planet/staccato/planet/PlanetCollectionMetadata.java b/staccato-collections/planet/src/main/java/com/planet/staccato/planet/PlanetCollectionMetadata.java index 52b7c23..4e5c9e4 100644 --- a/staccato-collections/planet/src/main/java/com/planet/staccato/planet/PlanetCollectionMetadata.java +++ b/staccato-collections/planet/src/main/java/com/planet/staccato/planet/PlanetCollectionMetadata.java @@ -26,12 +26,12 @@ public PlanetCollectionMetadata() { crs(CRS); setTitle(TITLE); setDescription(DESCRIPTION); - setVersion(VERSION); + setStacVersion(VERSION); setLicense(LICENSE); keywords.add(KEYWORDS); properties = new PlanetItemProperties(); - buildProperties(); + //buildProperties(); buildProviders(); } diff --git a/staccato-collections/pom.xml b/staccato-collections/pom.xml index 30d9c63..c1430b9 100644 --- a/staccato-collections/pom.xml +++ b/staccato-collections/pom.xml @@ -5,7 +5,7 @@ com.planet.staccato staccato-collections - 1.0.0-rc.2 + 1.0.0 pom staccato-collections diff --git a/staccato-commons/pom.xml b/staccato-commons/pom.xml index 78f492e..3536926 100644 --- a/staccato-commons/pom.xml +++ b/staccato-commons/pom.xml @@ -5,7 +5,7 @@ staccato com.planet.staccato - 1.0.0-rc.2 + 1.0.0 4.0.0 diff --git a/staccato-commons/src/main/java/com/planet/staccato/collection/CollectionMetadata.java b/staccato-commons/src/main/java/com/planet/staccato/collection/CollectionMetadata.java index f668809..ce85db6 100644 --- a/staccato-commons/src/main/java/com/planet/staccato/collection/CollectionMetadata.java +++ b/staccato-commons/src/main/java/com/planet/staccato/collection/CollectionMetadata.java @@ -44,10 +44,6 @@ public interface CollectionMetadata { void setKeywords(Set keywords); CollectionMetadata keywords(Set keywords); - String getVersion(); - void setVersion(String version); - CollectionMetadata version(String version); - String getLicense(); void setLicense(String license); CollectionMetadata license(String license); diff --git a/staccato-commons/src/main/java/com/planet/staccato/collection/CollectionMetadataAdapter.java b/staccato-commons/src/main/java/com/planet/staccato/collection/CollectionMetadataAdapter.java index 8c23656..ff45d6b 100644 --- a/staccato-commons/src/main/java/com/planet/staccato/collection/CollectionMetadataAdapter.java +++ b/staccato-commons/src/main/java/com/planet/staccato/collection/CollectionMetadataAdapter.java @@ -1,5 +1,6 @@ package com.planet.staccato.collection; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.planet.staccato.model.*; import com.planet.staccato.properties.CoreProperties; import lombok.Data; @@ -29,6 +30,7 @@ public class CollectionMetadataAdapter implements Coll protected Extent extent; protected List providers = new ArrayList<>(); protected Map summaries; + @JsonIgnore protected T properties; protected List links = new ArrayList<>(); protected CatalogType catalogType; @@ -69,12 +71,6 @@ public CollectionMetadata keywords(Set keywords) { return this; } - @Override - public CollectionMetadata version(String version) { - setVersion(version); - return this; - } - @Override public CollectionMetadata license(String license) { setLicense(license); diff --git a/staccato-commons/src/main/java/com/planet/staccato/model/Catalog.java b/staccato-commons/src/main/java/com/planet/staccato/model/Catalog.java index d426f35..695c4e0 100644 --- a/staccato-commons/src/main/java/com/planet/staccato/model/Catalog.java +++ b/staccato-commons/src/main/java/com/planet/staccato/model/Catalog.java @@ -7,7 +7,6 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; import java.util.Map; /** @@ -18,7 +17,7 @@ public class Catalog { @JsonProperty("stac_version") - private String version; + private String stacVersion; private String title; private String id; private CatalogType type = CatalogType.CATALOG; @@ -31,7 +30,7 @@ public class Catalog { private String path; public Catalog version(String version) { - setVersion(version); + setStacVersion(version); return this; } diff --git a/staccato-community/pom.xml b/staccato-community/pom.xml index 1231198..116061c 100644 --- a/staccato-community/pom.xml +++ b/staccato-community/pom.xml @@ -8,12 +8,12 @@ com.planet.staccato staccato-community - 1.0.0-rc.2 + 1.0.0 com.planet.staccato staccato - 1.0.0-rc.2 + 1.0.0 @@ -26,15 +26,5 @@ UTF-8 ${project.version} - + \ No newline at end of file diff --git a/staccato-community/staccato-community-grpc/pom.xml b/staccato-community/staccato-community-grpc/pom.xml index 30d79bf..bbd61e2 100644 --- a/staccato-community/staccato-community-grpc/pom.xml +++ b/staccato-community/staccato-community-grpc/pom.xml @@ -5,7 +5,7 @@ staccato-community com.planet.staccato - 1.0.0-rc.2 + 1.0.0 4.0.0 @@ -84,7 +84,7 @@ kr.motd.maven os-maven-plugin - 1.6.2 + 1.7.0 diff --git a/staccato-community/staccato-community-kafka/pom.xml b/staccato-community/staccato-community-kafka/pom.xml index 88a8342..5edb0e8 100644 --- a/staccato-community/staccato-community-kafka/pom.xml +++ b/staccato-community/staccato-community-kafka/pom.xml @@ -5,7 +5,7 @@ staccato-community com.planet.staccato - 1.0.0-rc.2 + 1.0.0 4.0.0 diff --git a/staccato-elasticsearch/pom.xml b/staccato-elasticsearch/pom.xml index 622372d..7552b76 100644 --- a/staccato-elasticsearch/pom.xml +++ b/staccato-elasticsearch/pom.xml @@ -5,14 +5,13 @@ staccato com.planet.staccato - 1.0.0-rc.2 + 1.0.0 4.0.0 staccato-elasticsearch - 3.0.4 2.5.2 diff --git a/staccato-elasticsearch/src/main/java/com/planet/staccato/es/api/ElasticsearchApiService.java b/staccato-elasticsearch/src/main/java/com/planet/staccato/es/api/ElasticsearchApiService.java index c7e19cd..c71e5d0 100644 --- a/staccato-elasticsearch/src/main/java/com/planet/staccato/es/api/ElasticsearchApiService.java +++ b/staccato-elasticsearch/src/main/java/com/planet/staccato/es/api/ElasticsearchApiService.java @@ -2,6 +2,7 @@ import com.planet.staccato.collection.CollectionMetadata; import com.planet.staccato.config.LinksConfigProps; +import com.planet.staccato.config.StacConfigProps; import com.planet.staccato.dto.api.SearchRequest; import com.planet.staccato.es.IndexAliasLookup; import com.planet.staccato.es.QueryBuilderHelper; @@ -83,8 +84,7 @@ public Flux getItemsFlux(SearchRequest searchRequest) { Set indices = getIndices(searchRequest); BoolQueryBuilder boolQueryBuilder = QueryBuilderHelper.buildQuery(searchRequest); Flux itemFlux = repository.searchItemFlux(indices, boolQueryBuilder, searchRequest); - return processor.searchItemFlux( - itemFlux, searchRequest); + return processor.searchItemFlux(itemFlux, searchRequest); } /**