public class StoreClient extends AbstractClient
client| Constructor and Description |
|---|
StoreClient(io.vertx.core.http.HttpClient client)Construct a new store client using the given HTTP client |
| Modifier and Type | Method and Description |
|---|---|
void | appendTags(java.lang.String query, java.lang.String layer, java.util.List<java.lang.String> tags, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Append tags to chunks in the GeoRocket data store. |
void | delete(java.lang.String query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Delete chunks from the GeoRocket data store. |
void | delete(java.lang.String query, java.lang.String layer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Delete chunks or layers from the GeoRocket data store. |
protected java.lang.String | getEndpoint()Return the HTTP endpoint, the GeoRocket data store path at server side. |
void | getPropertyValues(java.lang.String property, java.lang.String query, java.lang.String layer, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer>>> handler)Search the GeoRocket store for all values of the specified property and return a ReadStream of merged values matching the given criteria. |
protected java.lang.String | prepareImport(java.lang.String layer, java.util.Collection<java.lang.String> tags)Prepare an import. |
protected java.lang.String | prepareImport(java.lang.String layer, java.util.Collection<java.lang.String> tags, java.util.Collection<java.lang.String> properties)Prepare an import. |
protected java.lang.String | prepareImport(java.lang.String layer, java.util.Collection<java.lang.String> tags, java.util.Collection<java.lang.String> properties, java.lang.String fallbackCRS)Prepare an import. |
void | removeProperties(java.lang.String query, java.lang.String layer, java.util.List<java.lang.String> properties, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Remove properties from chunks in the GeoRocket data store. |
void | removeTags(java.lang.String query, java.lang.String layer, java.util.List<java.lang.String> tags, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Remove tags from chunks in the GeoRocket data store. |
void | search(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer>>> handler)Export the contents of the whole GeoRocket data store. |
void | search(SearchParams params, io.vertx.core.Handler<io.vertx.core.AsyncResult<SearchResult>> handler)Search the GeoRocket data store and return a SearchResult containing a ReadStream of merged chunks matching the given options. |
void | search(java.lang.String query, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer>>> handler)Search the GeoRocket data store and return a ReadStream of merged chunks matching the given criteria. |
void | search(java.lang.String query, java.lang.String layer, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer>>> handler)Deprecated. Use search(SearchParams, Handler) instead |
void | setProperties(java.lang.String query, java.lang.String layer, java.util.List<java.lang.String> properties, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Set properties of chunks in the GeoRocket data store. |
io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> | startImport(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Start importing data to GeoRocket. |
io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> | startImport(ImportParams params, io.vertx.core.Handler<io.vertx.core.AsyncResult<ImportResult>> handler)Start importing data to GeoRocket. |
io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> | startImport(java.lang.String layer, java.util.Collection<java.lang.String> tags, java.util.Collection<java.lang.String> properties, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Deprecated. Use startImport(ImportParams, Handler) instead |
io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> | startImport(java.lang.String layer, java.util.Collection<java.lang.String> tags, java.util.Collection<java.lang.String> properties, long size, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Deprecated. Use startImport(ImportParams, Handler) instead |
io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> | startImport(java.lang.String layer, java.util.Collection<java.lang.String> tags, java.util.Collection<java.lang.String> properties, java.util.Optional<java.lang.Long> size, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Deprecated. Use startImport(ImportParams, Handler) instead |
io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> | startImport(java.lang.String layer, java.util.Collection<java.lang.String> tags, java.util.Collection<java.lang.String> properties, java.util.Optional<java.lang.Long> size, java.lang.String fallbackCRS, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Deprecated. Use startImport(ImportParams, Handler) instead |
io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> | startImport(java.lang.String layer, java.util.Collection<java.lang.String> tags, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Deprecated. Use startImport(ImportParams, Handler) instead |
io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> | startImport(java.lang.String layer, java.util.Collection<java.lang.String> tags, long size, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Deprecated. Use startImport(ImportParams, Handler) instead |
io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> | startImport(java.lang.String layer, java.util.Collection<java.lang.String> tags, java.util.Optional<java.lang.Long> size, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Deprecated. Use startImport(ImportParams, Handler) instead |
io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> | startImport(java.lang.String layer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Start importing data to GeoRocket. |
configureRequest, fail, fail, getWithParameter, prepareQuery, prepareQuery, update, urlencodepublic StoreClient(io.vertx.core.http.HttpClient client)
client - the HTTP clientprotected java.lang.String prepareImport(java.lang.String layer,
java.util.Collection<java.lang.String> tags)layer - the layer to import to (may be null if data should be imported to the root layer)tags - a collection of tags to attach to the imported data (may be null if no tags need to be attached)protected java.lang.String prepareImport(java.lang.String layer,
java.util.Collection<java.lang.String> tags,
java.util.Collection<java.lang.String> properties)layer - the layer to import to (may be null if data should be imported to the root layer)tags - a collection of tags to attach to the imported data (may be null if no tags need to be attached)properties - a collection of properties to attach to the imported data (may be null if no properties need to be attached)protected java.lang.String prepareImport(java.lang.String layer,
java.util.Collection<java.lang.String> tags,
java.util.Collection<java.lang.String> properties,
java.lang.String fallbackCRS)layer - the layer to import to (may be null if data should be imported to the root layer)tags - a collection of tags to attach to the imported data (may be null if no tags need to be attached)properties - a collection of properties to attach to the imported data (may be null if no properties need to be attached)fallbackCRS - the CRS which should be used if the imported file does not specify one (may be null)public io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> startImport(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)
Start importing data to GeoRocket. The method opens a connection to the GeoRocket server and returns a WriteStream that can be used to send data.
The caller is responsible for closing the stream (and ending the import process) through WriteStream.end() and handling exceptions through WriteStream.exceptionHandler(Handler).
handler - a handler that will be called when the data has been imported by the GeoRocket serverWriteStream that can be used to send datapublic io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> startImport(java.lang.String layer,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Start importing data to GeoRocket. The method opens a connection to the GeoRocket server and returns a WriteStream that can be used to send data.
The caller is responsible for closing the stream (and ending the import process) through WriteStream.end() and handling exceptions through WriteStream.exceptionHandler(Handler).
layer - the layer to import to (may be null if data should be imported to the root layer)handler - a handler that will be called when the data has been imported by the GeoRocket serverWriteStream that can be used to send data@Deprecated
public io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> startImport(java.lang.String layer,
java.util.Collection<java.lang.String> tags,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)startImport(ImportParams, Handler) insteadStart importing data to GeoRocket. The method opens a connection to the GeoRocket server and returns a WriteStream that can be used to send data.
The caller is responsible for closing the stream (and ending the import process) through WriteStream.end() and handling exceptions through WriteStream.exceptionHandler(Handler).
layer - the layer to import to (may be null if data should be imported to the root layer)tags - a collection of tags to attach to the imported data (may be null if no tags need to be attached)handler - a handler that will be called when the data has been imported by the GeoRocket serverWriteStream that can be used to send data@Deprecated
public io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> startImport(java.lang.String layer,
java.util.Collection<java.lang.String> tags,
java.util.Collection<java.lang.String> properties,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)startImport(ImportParams, Handler) insteadStart importing data to GeoRocket. The method opens a connection to the GeoRocket server and returns a WriteStream that can be used to send data.
The caller is responsible for closing the stream (and ending the import process) through WriteStream.end() and handling exceptions through WriteStream.exceptionHandler(Handler).
layer - the layer to import to (may be null if data should be imported to the root layer)tags - a collection of tags to attach to the imported data (may be null if no tags need to be attached)properties - a collection of properties to attach to the imported data (may be null if no properties need to be attached)handler - a handler that will be called when the data has been imported by the GeoRocket serverWriteStream that can be used to send data@Deprecated
public io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> startImport(java.lang.String layer,
java.util.Collection<java.lang.String> tags,
long size,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)startImport(ImportParams, Handler) insteadStart importing data to GeoRocket. The method opens a connection to the GeoRocket server and returns a WriteStream that can be used to send data.
The caller is responsible for closing the stream (and ending the import process) through WriteStream.end() and handling exceptions through WriteStream.exceptionHandler(Handler).
layer - the layer to import to (may be null if data should be imported to the root layer)tags - a collection of tags to attach to the imported data (may be null if no tags need to be attached)size - size of the data to be sent in byteshandler - a handler that will be called when the data has been imported by the GeoRocket serverWriteStream that can be used to send data@Deprecated
public io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> startImport(java.lang.String layer,
java.util.Collection<java.lang.String> tags,
java.util.Collection<java.lang.String> properties,
long size,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)startImport(ImportParams, Handler) insteadStart importing data to GeoRocket. The method opens a connection to the GeoRocket server and returns a WriteStream that can be used to send data.
The caller is responsible for closing the stream (and ending the import process) through WriteStream.end() and handling exceptions through WriteStream.exceptionHandler(Handler).
layer - the layer to import to (may be null if data should be imported to the root layer)tags - a collection of tags to attach to the imported data (may be null if no tags need to be attached)properties - a collection of properties to attach to the imported data (may be null if no properties need to be attached)size - size of the data to be sent in byteshandler - a handler that will be called when the data has been imported by the GeoRocket serverWriteStream that can be used to send data@Deprecated
public io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> startImport(java.lang.String layer,
java.util.Collection<java.lang.String> tags,
java.util.Optional<java.lang.Long> size,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)startImport(ImportParams, Handler) insteadStart importing data to GeoRocket. The method opens a connection to the GeoRocket server and returns a WriteStream that can be used to send data.
The caller is responsible for closing the stream (and ending the import process) through WriteStream.end() and handling exceptions through WriteStream.exceptionHandler(Handler).
layer - the layer to import to (may be null if data should be imported to the root layer)tags - a collection of tags to attach to the imported data (may be null if no tags need to be attached)size - size of the data to be sent in bytes (optional)handler - a handler that will be called when the data has been imported by the GeoRocket serverWriteStream that can be used to send data@Deprecated
public io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> startImport(java.lang.String layer,
java.util.Collection<java.lang.String> tags,
java.util.Collection<java.lang.String> properties,
java.util.Optional<java.lang.Long> size,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)startImport(ImportParams, Handler) insteadStart importing data to GeoRocket. The method opens a connection to the GeoRocket server and returns a WriteStream that can be used to send data.
The caller is responsible for closing the stream (and ending the import process) through WriteStream.end() and handling exceptions through WriteStream.exceptionHandler(Handler).
layer - the layer to import to (may be null if data should be imported to the root layer)tags - a collection of tags to attach to the imported data (may be null if no tags need to be attached)properties - a collection of properties to attach to the imported data (may be null if no properties need to be attached)size - size of the data to be sent in bytes (optional)handler - a handler that will be called when the data has been imported by the GeoRocket serverWriteStream that can be used to send data@Deprecated
public io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> startImport(java.lang.String layer,
java.util.Collection<java.lang.String> tags,
java.util.Collection<java.lang.String> properties,
java.util.Optional<java.lang.Long> size,
java.lang.String fallbackCRS,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)startImport(ImportParams, Handler) insteadStart importing data to GeoRocket. The method opens a connection to the GeoRocket server and returns a WriteStream that can be used to send data.
The caller is responsible for closing the stream (and ending the import process) through WriteStream.end() and handling exceptions through WriteStream.exceptionHandler(Handler).
layer - the layer to import to (may be null if data should be imported to the root layer)tags - a collection of tags to attach to the imported data (may be null if no tags need to be attached)properties - a collection of properties to attach to the imported data (may be null if no properties need to be attached)size - size of the data to be sent in bytes (optional)fallbackCRS - the CRS which should be used if the imported file does not specify one (may be null)handler - a handler that will be called when the data has been imported by the GeoRocket serverWriteStream that can be used to send datapublic io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> startImport(ImportParams params, io.vertx.core.Handler<io.vertx.core.AsyncResult<ImportResult>> handler)
Start importing data to GeoRocket. The method opens a connection to the GeoRocket server and returns a WriteStream that can be used to send data.
The caller is responsible for closing the stream (and ending the import process) through WriteStream.end() and handling exceptions through WriteStream.exceptionHandler(Handler).
params - import parametershandler - a handler that will be called when the data has been imported by the GeoRocket serverWriteStream that can be used to send datapublic void search(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer>>> handler)
Export the contents of the whole GeoRocket data store. Return a ReadStream from which merged chunks can be read.
The caller is responsible for handling exceptions through ReadStream.exceptionHandler(Handler).
handler - a handler that will receive the ReadStreampublic void search(java.lang.String query,
io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer>>> handler)Search the GeoRocket data store and return a ReadStream of merged chunks matching the given criteria.
If query is null the contents of the whole data store will be returned.
The caller is responsible for handling exceptions through ReadStream.exceptionHandler(Handler).
query - a search query specifying which chunks to return (may be null)handler - a handler that will receive the ReadStream from which the merged chunks matching the given criteria can be read@Deprecated
public void search(java.lang.String query,
java.lang.String layer,
io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer>>> handler)search(SearchParams, Handler) insteadSearch the GeoRocket data store and return a ReadStream of merged chunks matching the given criteria.
If query is null or empty all chunks from the given layer (and all sub-layers) will be returned. If layer is also null or empty the contents of the whole data store will be returned.
The caller is responsible for handling exceptions through ReadStream.exceptionHandler(Handler).
query - a search query specifying which chunks to return (may be null)layer - the name of the layer where to search for chunks recursively (may be null)handler - a handler that will receive the ReadStream from which the merged chunks matching the given criteria can be readpublic void search(SearchParams params, io.vertx.core.Handler<io.vertx.core.AsyncResult<SearchResult>> handler)
Search the GeoRocket data store and return a SearchResult containing a ReadStream of merged chunks matching the given options.
If SearchParams.getQuery() returns null or an empty String, all chunks from the the layer returned by SearchParams.getLayer() (and all sub-layers) will be returned. If the layer is also null or empty, the contents of the whole data store will be returned.
The caller is responsible for handling exceptions through ReadStream.exceptionHandler(Handler).
params - search parametershandler - a handler that will receive the SearchResult objectpublic void delete(java.lang.String query,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Delete chunks from the GeoRocket data store.
Either query or layer must be given to protect against requests that accidentally delete the whole data store. If you want to do so, provide an empty query and the root layer /.
query - a search query specifying the chunks to delete (must not be null to protect against requests that accidentally delete the whole data store. If you want to do so, use delete(String, String, Handler) and provide an empty query and the root layer /.)handler - a handler that will be called when the operation has finishedpublic void delete(java.lang.String query,
java.lang.String layer,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Delete chunks or layers from the GeoRocket data store.
Either query or layer must be given to protect against requests that accidentally delete the whole data store. If you want to do so, provide an empty query and the root layer /.
query - a search query specifying the chunks to delete (or null if all chunks and all sub-layers from the given layer should be deleted)layer - the absolute path to the layer from which to delete (or null if the whole store should be searched for chunks to delete)handler - a handler that will be called when the operation has finishedpublic void setProperties(java.lang.String query,
java.lang.String layer,
java.util.List<java.lang.String> properties,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Set properties of chunks in the GeoRocket data store. If a property with the same key already exists, its value will be overwritten.
.The chunks are either specified by a query or layer information or both. If none is given, the given properties will be appended to all chunks in the data store.
query - a search query specifying the chunks, whose properties should be updated (or null if the properties of all chunks in all sub-layers from the given layer should be updated)layer - the absolute path to the layer in which to update properties (or null if the entire store should be queried to find the chunks, whose properties should be updated)properties - a collection of properties to sethandler - a handler that will be called when the operation has finishedpublic void removeProperties(java.lang.String query,
java.lang.String layer,
java.util.List<java.lang.String> properties,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Remove properties from chunks in the GeoRocket data store.
The chunks are either specified by a query or layer information or both. If none is given, the given properties will be removed from all chunks in the data store.
query - a search query specifying the chunks, whose properties should be updated (or null if the properties of all chunks in all sub-layers from the given layer should be updated)layer - the absolute path to the layer in which to update properties (or null if the entire store should be queried to find the chunks, whose properties should be updated)properties - a collection of properties to remove from the queried chunkshandler - a handler that will be called when the operation has finishedpublic void appendTags(java.lang.String query,
java.lang.String layer,
java.util.List<java.lang.String> tags,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Append tags to chunks in the GeoRocket data store.
The chunks are either specified by a query or layer information or both. If none is given, the given tags will be appended to all chunks in the data store.
query - a search query specifying the chunks, whose tags should be updated (or null if the tags of all chunks in all sub-layers from the given layer should be updated)layer - the absolute path to the layer from which to update tags (or null if the entire store should be queried to find the chunks, whose tags should be updated)tags - a collection of tags to be removed from the queried chunkshandler - a handler that will be called when the operation has finishedpublic void removeTags(java.lang.String query,
java.lang.String layer,
java.util.List<java.lang.String> tags,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> handler)Remove tags from chunks in the GeoRocket data store.
The chunks are either specified by a query or layer information or both. If none is given, the given tags will be removed from all chunks in the data store.
query - a search query specifying the chunks, whose tags should be updated (or null if the tags of all chunks in all sub-layers from the given layer should be updated)layer - the absolute path to the layer from which to update tags (or null if the entire store should be queried to find the chunks, whose tags should be updated)tags - a collection of tags to be removed from the queried chunkshandler - a handler that will be called when the operation has finishedpublic void getPropertyValues(java.lang.String property,
java.lang.String query,
java.lang.String layer,
io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer>>> handler)Search the GeoRocket store for all values of the specified property and return a ReadStream of merged values matching the given criteria.
If query is null or empty all chunks from the given layer (and all sub-layers) will be searched for the property. If layer is also null or empty the contents of the whole data store will be searched for the property.
The caller is responsible for handling exceptions through ReadStream.exceptionHandler(Handler).
property - the name of the propertyquery - a search query specifying which chunks should be searched (may be null)layer - the name of the layer where to search for chunks recursively (may be null)handler - a handler that will receive the ReadStream from which the merged values matching the given criteria can be readprotected java.lang.String getEndpoint()