All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.redis.datasource.geo.ReactiveGeoCommands Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package io.quarkus.redis.datasource.geo;

import java.util.List;
import java.util.Set;

import io.quarkus.redis.datasource.ReactiveRedisCommands;
import io.smallrye.mutiny.Uni;

/**
 * Allows executing commands from the {@code geo} group.
 * See the geo command list for further information about these commands.
 *
 * Geo-localized items are tuples composed of longitude, latitude and the member. The member is of type {@code <V>}.
 * Each key can store multiple items.
 *
 * @param  the type of the key
 * @param  the type of the value
 */
public interface ReactiveGeoCommands extends ReactiveRedisCommands {

    /**
     * Execute the command GEOADD.
     * Summary: Add one geospatial item in the geospatial index represented using a sorted set
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param longitude the longitude coordinate according to WGS84.
     * @param latitude the latitude coordinate according to WGS84.
     * @param member the member to add.
     * @return {@code true} if the geospatial item was added, {@code false} otherwise
     **/
    Uni geoadd(K key, double longitude, double latitude, V member);

    /**
     * Execute the command GEOADD.
     * Summary: Add one geospatial item in the geospatial index represented using a sorted set
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param position the geo position
     * @param member the member to add.
     * @return {@code true} if the geospatial item was added, {@code false} otherwise
     **/
    Uni geoadd(K key, GeoPosition position, V member);

    /**
     * Execute the command GEOADD.
     * Summary: Add one geospatial item in the geospatial index represented using a sorted set
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param item the item to add
     * @return {@code true} if the geospatial item was added, {@code false} otherwise
     **/
    Uni geoadd(K key, GeoItem item);

    /**
     * Execute the command GEOADD.
     * Summary: Add one or more geospatial items in the geospatial index represented using a sorted set
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param items the geo-item triplets containing the longitude, latitude and name / value
     * @return the number of elements added to the sorted set (excluding score updates).
     **/
    Uni geoadd(K key, GeoItem... items);

    /**
     * Execute the command GEOADD.
     * Summary: Add one geospatial item in the geospatial index represented using a sorted set
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param longitude the longitude coordinate according to WGS84.
     * @param latitude the latitude coordinate according to WGS84.
     * @param member the member to add.
     * @param args additional arguments.
     * @return {@code true} if the geospatial item was added, {@code false} otherwise
     **/
    Uni geoadd(K key, double longitude, double latitude, V member, GeoAddArgs args);

    /**
     * Execute the command GEOADD.
     * Summary: Add one geospatial item in the geospatial index represented using a sorted set
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param item the item to add
     * @param args additional arguments.
     * @return {@code true} if the geospatial item was added, {@code false} otherwise
     **/
    Uni geoadd(K key, GeoItem item, GeoAddArgs args);

    /**
     * Execute the command GEOADD.
     * Summary: Add one or more geospatial items in the geospatial index represented using a sorted set
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param args additional arguments.
     * @param items the items containing the longitude, latitude and name / value
     * @return the number of elements added to the sorted set (excluding score updates). If the {@code CH} option is
     *         specified, the number of elements that were changed (added or updated).
     **/
    Uni geoadd(K key, GeoAddArgs args, GeoItem... items);

    /**
     * Execute the command GEODIST.
     * Summary: Returns the distance between two members of a geospatial index
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param from from member
     * @param to to member
     * @param unit the unit
     * @return The command returns the distance as a double in the specified unit, or {@code empty} if one or both the
     *         elements are missing.
     **/
    Uni geodist(K key, V from, V to, GeoUnit unit);

    /**
     * Execute the command GEOHASH.
     * Summary: Returns members of a geospatial index as standard geohash strings
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param members the members
     * @return The command returns an array where each element is the Geohash corresponding to each member name passed
     *         as argument to the command.
     **/
    Uni> geohash(K key, V... members);

    /**
     * Execute the command GEOPOS.
     * Summary: Returns longitude and latitude of members of a geospatial index
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param members the items
     * @return The command returns an array where each element is a{@link GeoPosition} representing longitude and
     *         latitude (x,y) of each member name passed as argument to the command. Non-existing elements are reported as
     *         {@code null} elements.
     **/
    Uni> geopos(K key, V... members);

    /**
     * Execute the command GEORADIUS.
     * Summary: Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a
     * poUni
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param longitude the longitude
     * @param latitude the latitude
     * @param radius the radius
     * @param unit the unit
     * @return the list of values.
     * @deprecated See https://redis.io/commands/georadius
     **/
    @Deprecated
    Uni> georadius(K key, double longitude, double latitude, double radius, GeoUnit unit);

    /**
     * Execute the command GEORADIUS.
     * Summary: Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a
     * poUni
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param position the position
     * @param radius the radius
     * @param unit the unit
     * @return the list of values.
     * @deprecated See https://redis.io/commands/georadius
     **/
    @Deprecated
    Uni> georadius(K key, GeoPosition position, double radius, GeoUnit unit);

    /**
     * Execute the command GEORADIUS.
     * Summary: Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a
     * poUni
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param longitude the longitude
     * @param latitude the latitude
     * @param radius the radius
     * @param unit the unit
     * @param geoArgs the extra arguments of the {@code GEORADIUS} command
     * @return the list of {@link GeoValue}. Only the field requested using {@code geoArgs} are populated in the returned
     *         {@link GeoValue}.
     * @deprecated See https://redis.io/commands/georadius
     **/
    @Deprecated
    Uni>> georadius(K key, double longitude, double latitude, double radius, GeoUnit unit,
            GeoRadiusArgs geoArgs);

    /**
     * Execute the command GEORADIUS.
     * Summary: Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a
     * poUni
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param position the position
     * @param radius the radius
     * @param unit the unit
     * @param geoArgs the extra arguments of the {@code GEORADIUS} command
     * @return the list of {@link GeoValue}. Only the field requested using {@code geoArgs} are populated in the returned
     *         {@link GeoValue}.
     * @deprecated See https://redis.io/commands/georadius
     **/
    @Deprecated
    Uni>> georadius(K key, GeoPosition position, double radius, GeoUnit unit, GeoRadiusArgs geoArgs);

    /**
     * Execute the command GEORADIUS.
     * Summary: Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a
     * poUni.
     * It also stores the results in a sorted set.
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param longitude the longitude
     * @param latitude the latitude
     * @param radius the radius
     * @param unit the unit
     * @param geoArgs the extra {@code STORE} arguments of the {@code GEORADIUS} command
     * @return The number of items contained in the result written at the configured key.
     * @deprecated See https://redis.io/commands/georadius
     **/
    @Deprecated
    Uni georadius(K key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusStoreArgs geoArgs);

    /**
     * Execute the command GEORADIUS.
     * Summary: Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a
     * poUni.
     * It also stores the results in a sorted set.
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param position the position
     * @param radius the radius
     * @param unit the unit
     * @param geoArgs the extra {@code STORE} arguments of the {@code GEORADIUS} command
     * @return The number of items contained in the result written at the configured key.
     * @deprecated See https://redis.io/commands/georadius
     **/
    @Deprecated
    Uni georadius(K key, GeoPosition position, double radius, GeoUnit unit, GeoRadiusStoreArgs geoArgs);

    /**
     * Execute the command GEORADIUSBYMEMBER.
     * Summary: Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a
     * member
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param member the member
     * @param distance the max distance
     * @return the set of values
     * @deprecated See https://redis.io/commands/georadiusbymember
     **/
    @Deprecated
    Uni> georadiusbymember(K key, V member, double distance, GeoUnit unit);

    /**
     * Execute the command GEORADIUSBYMEMBER.
     * Summary: Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a
     * member
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param member the member
     * @param distance the max distance
     * @param geoArgs the extra arguments of the {@code GEORADIUS} command
     * @return the list of {@link GeoValue}. Only the field requested using {@code geoArgs} are populated in the
     *         returned {@link GeoValue values}.
     * @deprecated See https://redis.io/commands/georadiusbymember
     **/
    @Deprecated
    Uni>> georadiusbymember(K key, V member, double distance, GeoUnit unit, GeoRadiusArgs geoArgs);

    /**
     * Execute the command GEORADIUSBYMEMBER.
     * Summary: Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a
     * member.
     * It also stores the results in a sorted set.
     * Group: geo
     * Requires Redis 3.2.0
     *
     * @param key the key
     * @param member the member
     * @param distance the max distance
     * @param geoArgs the extra arguments of the {@code GEORADIUS} command
     * @return The number of items contained in the result written at the configured key.
     * @deprecated See https://redis.io/commands/georadiusbymember
     **/
    @Deprecated
    Uni georadiusbymember(K key, V member, double distance, GeoUnit unit, GeoRadiusStoreArgs geoArgs);

    /**
     * Execute the command GEOSEARCH.
     * Summary: Query a sorted set representing a geospatial index to fetch members inside an area of a box or a circle.
     * Group: geo
     * Requires Redis 6.2.0
     *
     * @return the list of {@code GeoValue<V>>}. The populated data depends on the parameters configured in {@code args}.
     **/
    Uni>> geosearch(K key, GeoSearchArgs args);

    /**
     * Execute the command GEOSEARCHSTORE.
     * Summary: Query a sorted set representing a geospatial index to fetch members inside an area of a box or a circle,
     * and store the result in another key.
     * Group: geo
     * Requires Redis 6.2.0
     *
     * @return the number of elements in the resulting set.
     **/
    Uni geosearchstore(K destination, K key, GeoSearchStoreArgs args, boolean storeDist);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy