Interface PublishApi
-
Method Summary
Modifier and TypeMethodDescriptionCompletionStage<org.apache.pekko.Done>cancelBatch(BatchToken token) Cancels a batch operation.CompletionStage<org.apache.pekko.Done>completeBatch(BatchToken token) Finalizes the batch and waits until the metadata has been processed.CompletionStage<org.apache.pekko.Done>deleteFeatureChanges(String layerId, VersionQuery versionQuery) Deletes one or more changesets where the version number can be specified by the query parameter 'versionQuery'.deleteFeatures(String layer, List<String> ids) Deletes specified features from Interactive Map layer.deleteFeatures(String layer, List<String> ids, Optional<InteractiveMapContext> context) Deletes specified features from Interactive Map layer.deleteIndex(String layer, String queryString) Deletes the partitions from index layer that match the provided query written in the RSQL query language.Get latest version available for the given catalog which can be used instartBatch2(java.util.OptionalLong,java.util.Optional<java.util.List<java.lang.String>>,java.util.List<com.here.platform.data.client.model.VersionDependency>).patchFeature(String layer, Feature feature, String featureId) Patch specified feature in Interactive Map layer.patchFeatureJson(String layer, String feature, String featureId) Patch specified feature in Interactive Map layer.postFeatureCollection(String layer, FeatureCollection featureCollection, Optional<InteractiveMapOptions.IfExistType> ifExist, Optional<InteractiveMapOptions.IfNotExistType> ifNotExist, Boolean transactional) Uploads specified FeatureCollection to Interactive Map layer.postFeatureCollectionJson(String layer, String featureCollection, Optional<InteractiveMapOptions.IfExistType> ifExist, Optional<InteractiveMapOptions.IfNotExistType> ifNotExist, Boolean transactional) Uploads specified FeatureCollection to Interactive Map layer.postFeatureModifications(String layer, FeatureModificationList featureModificationList, Boolean transactional) Uploads FeatureCollection(s) specified in FeatureModificationList to Interactive Map layer.postFeatureModificationsJson(String layer, String featureModificationList, Boolean transactional) Uploads FeatureCollection(s) specified in FeatureModificationList to Interactive Map layer.CompletionStage<org.apache.pekko.Done>publishBatch2(OptionalLong baseVersion, Optional<List<String>> layerIds, List<VersionDependency> dependencies, Iterator<CommitPartition> partitions) Performs new batch publication to a catalog.CompletionStage<org.apache.pekko.Done>publishBatch2(OptionalLong baseVersion, Optional<List<String>> layerIds, List<VersionDependency> dependencies, org.apache.pekko.stream.javadsl.Source<CommitPartition, org.apache.pekko.NotUsed> partitions) Performs new batch publication to a catalog.CompletionStage<org.apache.pekko.Done>publishIndex(String layer, Iterator<CommitPartition> partitions) Performs indexing of the specified partitions in Index layer.CompletionStage<org.apache.pekko.Done>publishIndex(String layer, org.apache.pekko.stream.javadsl.Source<CommitPartition, org.apache.pekko.NotUsed> partitions) Performs indexing of the specified partitions in Index layer.CompletionStage<org.apache.pekko.Done>publishToBatch(BatchToken token, Iterator<CommitPartition> partitions) Upload partitions for given batch token.CompletionStage<org.apache.pekko.Done>publishToBatch(BatchToken token, org.apache.pekko.stream.javadsl.Source<CommitPartition, org.apache.pekko.NotUsed> partitions) Upload partitions for given batch token.putFeature(String layer, Feature feature, String featureId) Uploads specified feature to Interactive Map layer.putFeatureCollection(String layer, FeatureCollection featureCollection) Uploads specified FeatureCollection to Interactive Map layer.putFeatureCollectionJson(String layer, String featureCollection) Uploads specified FeatureCollection to Interactive Map layer.putFeatureJson(String layer, String feature, String featureId) Uploads specified feature to Interactive Map layer.CompletionStage<org.apache.pekko.Done>setMinimumVersion(long minimumVersion) Sets the new minimum version for a catalog with versioned layers.startBatch2(OptionalLong baseVersion, Optional<List<String>> layerIds, List<VersionDependency> dependencies) Starts a new batch for a catalog with layers explicitly named.CompletionStage<org.apache.pekko.Done>updateIndex(String layer, Iterator<CommitPartition> additions, Iterator<CommitPartition> removals) Updates an index layer by adding theadditionspartitions and removingremovalspartitions.CompletionStage<org.apache.pekko.Done>updateIndex(String layer, org.apache.pekko.stream.javadsl.Source<CommitPartition, org.apache.pekko.NotUsed> additions, org.apache.pekko.stream.javadsl.Source<CommitPartition, org.apache.pekko.NotUsed> removals) Updates an index layer by adding theadditionspartitions and removingremovalspartitions.
-
Method Details
-
cancelBatch
Cancels a batch operation.Cancels an active batch and signals that submitted batch publications can be discarded. The token will no longer be valid after cancel batch operation.
- Parameters:
token- Token retrieved from a functionstartBatch2(java.util.OptionalLong,java.util.Optional<java.util.List<java.lang.String>>,java.util.List<com.here.platform.data.client.model.VersionDependency>).- Returns:
- future which completes when batch is fully cancelled by the server.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
completeBatch
Finalizes the batch and waits until the metadata has been processed.- Parameters:
token- Token retrieved from a functionstartBatch2(java.util.OptionalLong,java.util.Optional<java.util.List<java.lang.String>>,java.util.List<com.here.platform.data.client.model.VersionDependency>).- Returns:
- future which completes when publication is fully processed by server and new version is published to catalog or when the processing failed.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
deleteFeatureChanges
CompletionStage<org.apache.pekko.Done> deleteFeatureChanges(String layerId, VersionQuery versionQuery) Deletes one or more changesets where the version number can be specified by the query parameter 'versionQuery'. The service will begin the process to remove the versions from version 9 until the version 0. During the deletion process, newer versions can be created and won't be affected.- Parameters:
layerId- layerId of interactive Map layer. If the layer specified in request does not exist, an error is returned.versionQuery- The query parameter used to specify the versions to be deleted. The value must be an integer, bigger than 0 and the comparator should be one of the below list:- <
- =lt= i.e:
version=lt=10orversion<10- Returns:
- future which completes when deletion is fully processed by server
- Throws:
IllegalArgumentException- if the layer does not existDataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
deleteFeatures
Deletes specified features from Interactive Map layer.- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.ids- List of feature IDs to be deleted- Returns:
- Future which completes when specified featureCollection is uploaded.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
deleteFeatures
CompletionStage<FeatureCollection> deleteFeatures(String layer, List<String> ids, Optional<InteractiveMapContext> context) Deletes specified features from Interactive Map layer.- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.ids- List of feature IDs to be deletedcontext- The context where the operation will be performed on a composite layer. If not specified, the operation occurs based on the extension rules.- Returns:
- Future which completes when specified featureCollection is uploaded.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
deleteIndex
Deletes the partitions from index layer that match the provided query written in the RSQL query language.- Parameters:
layer- Name of the index layer. If the layer specified in request does not exist, an error is returned.queryString- String written in the RSQL query language to query the index layer- Returns:
- Delete request id which can be used to query the delete status.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
getBaseVersion
CompletionStage<OptionalLong> getBaseVersion()Get latest version available for the given catalog which can be used instartBatch2(java.util.OptionalLong,java.util.Optional<java.util.List<java.lang.String>>,java.util.List<com.here.platform.data.client.model.VersionDependency>).- Returns:
- Returns Some(version) - latest version for the given catalog. If the catalog doesn't contain any versions None will be returned.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
patchFeature
Patch specified feature in Interactive Map layer.- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.feature- The feature to put in Interactive Map layer.featureId- The feature ID of the feature.- Returns:
- Future which completes when specified feature is patched.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
patchFeatureJson
Patch specified feature in Interactive Map layer.- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.feature- The feature to put in Interactive Map layer.featureId- The feature ID of the feature.- Returns:
- Future which completes when specified feature is patched.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
postFeatureCollection
CompletionStage<FeatureCollection> postFeatureCollection(String layer, FeatureCollection featureCollection, Optional<InteractiveMapOptions.IfExistType> ifExist, Optional<InteractiveMapOptions.IfNotExistType> ifNotExist, Boolean transactional) Uploads specified FeatureCollection to Interactive Map layer.- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.featureCollection- The FeatureCollection to put in Interactive Map layer.ifExist- The action to execute, when a feature with the provided ID exists. Default is PATCH.ifNotExist- The action to execute, when a feature with the provided ID does not exist or the feature contains no ID. Default is CREATE.transactional- Defines, if this is a transactional operation. Default is true.- Returns:
- Future which completes when specified featureCollection is uploaded.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
postFeatureCollectionJson
CompletionStage<String> postFeatureCollectionJson(String layer, String featureCollection, Optional<InteractiveMapOptions.IfExistType> ifExist, Optional<InteractiveMapOptions.IfNotExistType> ifNotExist, Boolean transactional) Uploads specified FeatureCollection to Interactive Map layer.- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.featureCollection- The FeatureCollection to put in Interactive Map layer.ifExist- The action to execute, when a feature with the provided ID exists. Default is PATCH.ifNotExist- The action to execute, when a feature with the provided ID does not exist or the feature contains no ID. Default is CREATE.transactional- Defines, if this is a transactional operation. Default is true.- Returns:
- Future which completes when specified featureCollection is uploaded.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
postFeatureModifications
CompletionStage<FeatureCollection> postFeatureModifications(String layer, FeatureModificationList featureModificationList, Boolean transactional) Uploads FeatureCollection(s) specified in FeatureModificationList to Interactive Map layer.- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.featureModificationList- The FeatureModificationList which contains list of features that need to get created/updated/deleted in Interactive Map layer.transactional- Defines, if this is a transactional operation. Default is true.- Returns:
- Future which completes when specified FeatureCollection(s) are uploaded.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
postFeatureModificationsJson
CompletionStage<String> postFeatureModificationsJson(String layer, String featureModificationList, Boolean transactional) Uploads FeatureCollection(s) specified in FeatureModificationList to Interactive Map layer.- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.featureModificationList- The FeatureModificationList which contains list of features that need to get created/updated/deleted in Interactive Map layer.transactional- Defines, if this is a transactional operation. Default is true.- Returns:
- Future which completes when specified FeatureCollection(s) are uploaded.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
publishBatch2
CompletionStage<org.apache.pekko.Done> publishBatch2(OptionalLong baseVersion, Optional<List<String>> layerIds, List<VersionDependency> dependencies, Iterator<CommitPartition> partitions) Performs new batch publication to a catalog.Data for
CommitPartitionmust be already uploaded beforehandThis call is identical to
startBatch2(java.util.OptionalLong,java.util.Optional<java.util.List<java.lang.String>>,java.util.List<com.here.platform.data.client.model.VersionDependency>)+ {@link publishToBatch(token:com\.here\.platform\.data\.client\.model\.BatchToken,partitions:java\.util\.Iterator*} +completeBatch(com.here.platform.data.client.model.BatchToken).
Please note that there can only be one active publication at a time per versioned layer.- Parameters:
baseVersion- This parameter is deprecated and not used anymore.layerIds- List of layer ids which should be updated. Note: Publishing versioned and volatile layer partitions in the same publication is not advisable as in this case it increases version number even for volatile layers.dependencies- List of the dependencies for this publication. This is only relevant for publishing to versioned layer.partitions- partitions to publish.- Returns:
- future which completes when publication is fully processed by server and new version is published to catalog.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
publishBatch2
CompletionStage<org.apache.pekko.Done> publishBatch2(OptionalLong baseVersion, Optional<List<String>> layerIds, List<VersionDependency> dependencies, org.apache.pekko.stream.javadsl.Source<CommitPartition, org.apache.pekko.NotUsed> partitions) Performs new batch publication to a catalog.Data for
CommitPartitionmust be already uploaded beforehandThis call is identical to
startBatch2(java.util.OptionalLong,java.util.Optional<java.util.List<java.lang.String>>,java.util.List<com.here.platform.data.client.model.VersionDependency>)+ {@link publishToBatch(token:com\.here\.platform\.data\.client\.model\.BatchToken,partitions:org\.apache\.pekko\.stream\.javadsl\.Source*} +completeBatch(com.here.platform.data.client.model.BatchToken).
Please note that there can only be one active publication at a time per versioned layer.- Parameters:
baseVersion- This parameter is deprecated and not used anymore.layerIds- List of layer ids which should be updated. Note: Publishing versioned and volatile layer partitions in the same publication is not advisable as in this case it increases version number even for volatile layers.dependencies- List of the dependencies for this publication. This is only relevant for publishing to versioned layer.partitions- partitions to publish.- Returns:
- future which completes when publication is fully processed by server and new version is published to catalog.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
publishIndex
CompletionStage<org.apache.pekko.Done> publishIndex(String layer, Iterator<CommitPartition> partitions) Performs indexing of the specified partitions in Index layer.The partitions are indexed using the specified index keys defined in each indexing partition. After indexing the partitions can be searched by keys using query method from Query API.
- Parameters:
layer- Name of index layer. If the layer specified in request does not exist, an error is returned.partitions- The partitions to index.- Returns:
- Future which completes when specified partitions are indexed.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
publishIndex
CompletionStage<org.apache.pekko.Done> publishIndex(String layer, org.apache.pekko.stream.javadsl.Source<CommitPartition, org.apache.pekko.NotUsed> partitions) Performs indexing of the specified partitions in Index layer.The partitions are indexed using the specified index keys defined in each indexing partition. After indexing the partitions can be searched by keys using query method from Query API.
- Parameters:
layer- Name of index layer. If the layer specified in request does not exist, an error is returned.partitions- The partitions to index.- Returns:
- Future which completes when specified partitions are indexed.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
publishToBatch
CompletionStage<org.apache.pekko.Done> publishToBatch(BatchToken token, Iterator<CommitPartition> partitions) Upload partitions for given batch token.- Parameters:
token- Token retrieved from a functionstartBatch2(java.util.OptionalLong,java.util.Optional<java.util.List<java.lang.String>>,java.util.List<com.here.platform.data.client.model.VersionDependency>).partitions- partitions to upload.- Returns:
- future which completes when all partitions are uploaded to server.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
publishToBatch
CompletionStage<org.apache.pekko.Done> publishToBatch(BatchToken token, org.apache.pekko.stream.javadsl.Source<CommitPartition, org.apache.pekko.NotUsed> partitions) Upload partitions for given batch token.- Parameters:
token- Token retrieved from a functionstartBatch2(java.util.OptionalLong,java.util.Optional<java.util.List<java.lang.String>>,java.util.List<com.here.platform.data.client.model.VersionDependency>).partitions- partitions to upload.- Returns:
- future which completes when all partitions are uploaded to server.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
putFeature
Uploads specified feature to Interactive Map layer.- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.feature- The feature to put in Interactive Map layer.featureId- The feature ID of the feature.- Returns:
- Future which completes when specified feature is uploaded.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
putFeatureCollection
CompletionStage<FeatureCollection> putFeatureCollection(String layer, FeatureCollection featureCollection) Uploads specified FeatureCollection to Interactive Map layer.- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.featureCollection- The FeatureCollection to put in Interactive Map layer.- Returns:
- Future which completes when specified featureCollection is uploaded.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
putFeatureCollectionJson
Uploads specified FeatureCollection to Interactive Map layer.- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.featureCollection- The FeatureCollection to put in Interactive Map layer.- Returns:
- Future which completes when specified featureCollection is uploaded.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
putFeatureJson
Uploads specified feature to Interactive Map layer.- Parameters:
layer- Name of interactive Map layer. If the layer specified in request does not exist, an error is returned.feature- The feature to put in Interactive Map layer.featureId- The feature ID of the feature.- Returns:
- Future which completes when specified feature is uploaded.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
setMinimumVersion
Sets the new minimum version for a catalog with versioned layers.This removes all catalog versions that are older than the specified version.
- Parameters:
minimumVersion- The new version that will become a catalog's minimum version.- Returns:
- Future which completes when the value has been set.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
startBatch2
CompletionStage<BatchToken> startBatch2(OptionalLong baseVersion, Optional<List<String>> layerIds, List<VersionDependency> dependencies) Starts a new batch for a catalog with layers explicitly named.This call is used to start a new publishing to a catalog. The layers must be named explicitly. The returned token is valid for 24 hours.
Please note that there can only be one active publication at a time per versioned layer.- Parameters:
baseVersion- This parameter is deprecated and not used anymore.layerIds- List of layer ids which should be updated. Note: Publishing versioned and volatile layer partitions in the same publication is not advisable as in this case it increases version number even for volatile layers.dependencies- List of the dependencies for this publication. This is only relevant for publishing to versioned layer.- Returns:
- The token to use in subsequent calls that are part of the same publication (e.g.{@link com.here.platform.data.client.javadsl.PublishApi.publishToBatch(token:com\.here\.platform\.data\.client\.model\.BatchToken,partitions:java\.util\.Iterator*}).
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
updateIndex
CompletionStage<org.apache.pekko.Done> updateIndex(String layer, Iterator<CommitPartition> additions, Iterator<CommitPartition> removals) Updates an index layer by adding theadditionspartitions and removingremovalspartitions.- Parameters:
layer- Name of the index layer. If the layer specified in request does not exist, an error is returned.additions- The partitions to add to the index.removals- The partitions to remove from the index.- Returns:
- Future which completes when additions are added and removals are removed.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-
updateIndex
CompletionStage<org.apache.pekko.Done> updateIndex(String layer, org.apache.pekko.stream.javadsl.Source<CommitPartition, org.apache.pekko.NotUsed> additions, org.apache.pekko.stream.javadsl.Source<CommitPartition, org.apache.pekko.NotUsed> removals) Updates an index layer by adding theadditionspartitions and removingremovalspartitions.- Parameters:
layer- Name of the index layer. If the layer specified in request does not exist, an error is returned.additions- The partitions to add to the index.removals- The partitions to remove from the index.- Returns:
- Future which completes when additions are added and removals are removed.
- Throws:
DataClientNonRetriableException- in case of non-retriable errorDataClientRetriableException- in case of retriable error
-