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

org.redisson.api.RGeoReactive Maven / Gradle / Ivy

There is a newer version: 0.40.13
Show newest version
/**
 * Copyright 2018 Nikita Koksharov
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.redisson.api;

import java.util.List;
import java.util.Map;

import reactor.core.publisher.Mono;

/**
 * Geospatial items holder. Reactive interface.
 * 
 * @author Nikita Koksharov
 *
 * @param  type of value
 */
public interface RGeoReactive extends RScoredSortedSetReactive {

    /**
     * Adds geospatial member.
     * 
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param member - object itself
     * @return number of elements added to the sorted set, 
     * not including elements already existing for which 
     * the score was updated
     */
    Mono add(double longitude, double latitude, V member);

    /**
     * Adds geospatial members.
     * 
     * @param entries - objects
     * @return number of elements added to the sorted set, 
     * not including elements already existing for which 
     * the score was updated
     */
    Mono add(GeoEntry... entries);

    /**
     * Returns distance between members in GeoUnit units.
     * 
     * @param firstMember - first object
     * @param secondMember - second object
     * @param geoUnit - geo unit
     * @return distance
     */
    Mono dist(V firstMember, V secondMember, GeoUnit geoUnit);
    
    /**
     * Returns 11 characters Geohash string mapped by defined member.
     * 
     * @param members - objects
     * @return hash mapped by object
     */
    Mono> hash(V... members);

    /**
     * Returns geo-position mapped by defined member.
     * 
     * @param members - objects
     * @return geo position mapped by object
     */
    Mono> pos(V... members);
    
    /**
     * Returns the members of a sorted set, which are within the 
     * borders of the area specified with the center location 
     * and the maximum distance from the center (the radius) 
     * in GeoUnit units.
     * 

* Requires Redis 3.2.10 and higher. * * @param longitude - longitude of object * @param latitude - latitude of object * @param radius - radius in geo units * @param geoUnit - geo unit * @return list of objects */ Mono> radius(double longitude, double latitude, double radius, GeoUnit geoUnit); /** * Returns the members of a sorted set, which are within the * borders of the area specified with the center location * and the maximum distance from the center (the radius) * in GeoUnit units and limited by count *

* Requires Redis 3.2.10 and higher. * * @param longitude - longitude of object * @param latitude - latitude of object * @param radius - radius in geo units * @param geoUnit - geo unit * @param count - result limit * @return list of objects */ Mono> radius(double longitude, double latitude, double radius, GeoUnit geoUnit, int count); /** * Returns the members of a sorted set, which are within the * borders of the area specified with the center location * and the maximum distance from the center (the radius) * in GeoUnit units with GeoOrder *

* Requires Redis 3.2.10 and higher. * * @param longitude - longitude of object * @param latitude - latitude of object * @param radius - radius in geo units * @param geoUnit - geo unit * @param geoOrder - order of result * @return list of objects */ Mono> radius(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder); /** * Returns the members of a sorted set, which are within the * borders of the area specified with the center location * and the maximum distance from the center (the radius) * in GeoUnit units with GeoOrder * and limited by count *

* Requires Redis 3.2.10 and higher. * * @param longitude - longitude of object * @param latitude - latitude of object * @param radius - radius in geo units * @param geoUnit - geo unit * @param geoOrder - order of result * @param count - result limit * @return list of objects */ Mono> radius(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); /** * Returns the distance mapped by member, distance between member and the location. * Members of a sorted set, which are within the * borders of the area specified with the center location * and the maximum distance from the center (the radius) * in GeoUnit units. *

* Requires Redis 3.2.10 and higher. * * @param longitude - longitude of object * @param latitude - latitude of object * @param radius - radius in geo units * @param geoUnit - geo unit * @return distance mapped by object */ Mono> radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit); /** * Returns the distance mapped by member, distance between member and the location. * Members of a sorted set, which are within the * borders of the area specified with the center location * and the maximum distance from the center (the radius) * in GeoUnit units and limited by count. *

* Requires Redis 3.2.10 and higher. * * @param longitude - longitude of object * @param latitude - latitude of object * @param radius - radius in geo units * @param geoUnit - geo unit * @param count - result limit * @return distance mapped by object */ Mono> radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit, int count); /** * Returns the distance mapped by member, distance between member and the location. * Members of a sorted set, which are within the * borders of the area specified with the center location * and the maximum distance from the center (the radius) * in GeoUnit units with GeoOrder *

* Requires Redis 3.2.10 and higher. * * @param longitude - longitude of object * @param latitude - latitude of object * @param radius - radius in geo units * @param geoUnit - geo unit * @param geoOrder - order of result * @return distance mapped by object */ Mono> radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder); /** * Returns the distance mapped by member, distance between member and the location. * Members of a sorted set, which are within the * borders of the area specified with the center location * and the maximum distance from the center (the radius) * in GeoUnit units with GeoOrder * and limited by count *

* Requires Redis 3.2.10 and higher. * * @param longitude - longitude of object * @param latitude - latitude of object * @param radius - radius in geo units * @param geoUnit - geo unit * @param geoOrder - order of result * @param count - result limit * @return distance mapped by object */ Mono> radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); /** * Returns the geo-position mapped by member. * Members of a sorted set, which are within the * borders of the area specified with the center location * and the maximum distance from the center (the radius) * in GeoUnit units. *

* Requires Redis 3.2.10 and higher. * * @param longitude - longitude of object * @param latitude - latitude of object * @param radius - radius in geo units * @param geoUnit - geo unit * @return geo position mapped by object */ Mono> radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit); /** * Returns the geo-position mapped by member. * Members of a sorted set, which are within the * borders of the area specified with the center location * and the maximum distance from the center (the radius) * in GeoUnit units and limited by count *

* Requires Redis 3.2.10 and higher. * * @param longitude - longitude of object * @param latitude - latitude of object * @param radius - radius in geo units * @param geoUnit - geo unit * @param count - result limit * @return geo position mapped by object */ Mono> radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit, int count); /** * Returns the geo-position mapped by member. * Members of a sorted set, which are within the * borders of the area specified with the center location * and the maximum distance from the center (the radius) * in GeoUnit units with GeoOrder *

* Requires Redis 3.2.10 and higher. * * @param longitude - longitude of object * @param latitude - latitude of object * @param radius - radius in geo units * @param geoUnit - geo unit * @param geoOrder - geo order * @return geo position mapped by object */ Mono> radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder); /** * Returns the geo-position mapped by member. * Members of a sorted set, which are within the * borders of the area specified with the center location * and the maximum distance from the center (the radius) * in GeoUnit units with GeoOrder * and limited by count *

* Requires Redis 3.2.10 and higher. * * @param longitude - longitude of object * @param latitude - latitude of object * @param radius - radius in geo units * @param geoUnit - geo unit * @param geoOrder - geo order * @param count - result limit * @return geo position mapped by object */ Mono> radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); /** * Returns the members of a sorted set, which are within the * borders of the area specified with the defined member location * and the maximum distance from the defined member location (the radius) * in GeoUnit units. *

* Requires Redis 3.2.10 and higher. * * @param member - object * @param radius - radius in geo units * @param geoUnit - geo unit * @return list of objects */ Mono> radius(V member, double radius, GeoUnit geoUnit); /** * Returns the members of a sorted set, which are within the * borders of the area specified with the defined member location * and the maximum distance from the defined member location (the radius) * in GeoUnit units and limited by count *

* Requires Redis 3.2.10 and higher. * * @param member - object * @param radius - radius in geo units * @param geoUnit - geo unit * @param count - result limit * @return list of objects */ Mono> radius(V member, double radius, GeoUnit geoUnit, int count); /** * Returns the members of a sorted set, which are within the * borders of the area specified with the defined member location * and the maximum distance from the defined member location (the radius) * in GeoUnit units with GeoOrder *

* Requires Redis 3.2.10 and higher. * * @param member - object * @param radius - radius in geo units * @param geoUnit - geo unit * @param geoOrder - geo order * @return list of objects */ Mono> radius(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder); /** * Returns the members of a sorted set, which are within the * borders of the area specified with the defined member location * and the maximum distance from the defined member location (the radius) * in GeoUnit units with GeoOrder *

* Requires Redis 3.2.10 and higher. * * @param member - object * @param radius - radius in geo units * @param geoUnit - geo unit * @param geoOrder - geo order * @param count - result limit * @return list of objects */ Mono> radius(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); /** * Returns the distance mapped by member, distance between member and the defined member location. * Members of a sorted set, which are within the * borders of the area specified with the defined member location * and the maximum distance from the defined member location (the radius) * in GeoUnit units. *

* Requires Redis 3.2.10 and higher. * * @param member - object * @param radius - radius in geo units * @param geoUnit - geo unit * @return distance mapped by object */ Mono> radiusWithDistance(V member, double radius, GeoUnit geoUnit); /** * Returns the distance mapped by member, distance between member and the defined member location. * Members of a sorted set, which are within the * borders of the area specified with the defined member location * and the maximum distance from the defined member location (the radius) * in GeoUnit units and limited by count *

* Requires Redis 3.2.10 and higher. * * @param member - object * @param radius - radius in geo units * @param geoUnit - geo unit * @param count - result limit * @return distance mapped by object */ Mono> radiusWithDistance(V member, double radius, GeoUnit geoUnit, int count); /** * Returns the distance mapped by member, distance between member and the defined member location. * Members of a sorted set, which are within the * borders of the area specified with the defined member location * and the maximum distance from the defined member location (the radius) * in GeoUnit units with GeoOrder *

* Requires Redis 3.2.10 and higher. * * @param member - object * @param radius - radius in geo units * @param geoUnit - geo unit * @param geoOrder - geo * @return distance mapped by object */ Mono> radiusWithDistance(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder); /** * Returns the distance mapped by member, distance between member and the defined member location. * Members of a sorted set, which are within the * borders of the area specified with the defined member location * and the maximum distance from the defined member location (the radius) * in GeoUnit units with GeoOrder * and limited by count *

* Requires Redis 3.2.10 and higher. * * @param member - object * @param radius - radius in geo units * @param geoUnit - geo unit * @param geoOrder - geo * @param count - result limit * @return distance mapped by object */ Mono> radiusWithDistance(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); /** * Returns the geo-position mapped by member. * Members of a sorted set, which are within the * borders of the area specified with the defined member location * and the maximum distance from the defined member location (the radius) * in GeoUnit units. *

* Requires Redis 3.2.10 and higher. * * @param member - object * @param radius - radius in geo units * @param geoUnit - geo unit * @return geo position mapped by object */ Mono> radiusWithPosition(V member, double radius, GeoUnit geoUnit); /** * Returns the geo-position mapped by member. * Members of a sorted set, which are within the * borders of the area specified with the defined member location * and the maximum distance from the defined member location (the radius) * in GeoUnit units and limited by count *

* Requires Redis 3.2.10 and higher. * * @param member - object * @param radius - radius in geo units * @param geoUnit - geo unit * @param count - result limit * @return geo position mapped by object */ Mono> radiusWithPosition(V member, double radius, GeoUnit geoUnit, int count); /** * Returns the geo-position mapped by member. * Members of a sorted set, which are within the * borders of the area specified with the defined member location * and the maximum distance from the defined member location (the radius) * in GeoUnit units with GeoOrder *

* Requires Redis 3.2.10 and higher. * * @param member - object * @param radius - radius in geo units * @param geoUnit - geo unit * @param geoOrder - geo order * @return geo position mapped by object */ Mono> radiusWithPosition(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder); /** * Returns the geo-position mapped by member. * Members of a sorted set, which are within the * borders of the area specified with the defined member location * and the maximum distance from the defined member location (the radius) * in GeoUnit units with GeoOrder * and limited by count *

* Requires Redis 3.2.10 and higher. * * @param member - object * @param radius - radius in geo units * @param geoUnit - geo unit * @param geoOrder - geo order * @param count - result limit * @return geo position mapped by object */ Mono> radiusWithPosition(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); /** * Finds the members of a sorted set, which are within the * borders of the area specified with the center location * and the maximum distance from the center (the radius) * in GeoUnit units. * Store result to destName. * * @param destName - Geo object destination * @param longitude - longitude of object * @param latitude - latitude of object * @param radius - radius in geo units * @param geoUnit - geo unit * @return length of result */ Mono radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit); /** * Finds the members of a sorted set, which are within the * borders of the area specified with the center location * and the maximum distance from the center (the radius) * in GeoUnit units and limited by count * Store result to destName. * * @param destName - Geo object destination * @param longitude - longitude of object * @param latitude - latitude of object * @param radius - radius in geo units * @param geoUnit - geo unit * @param count - result limit * @return length of result */ Mono radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count); /** * Finds the members of a sorted set, which are within the * borders of the area specified with the center location * and the maximum distance from the center (the radius) * in GeoUnit units with GeoOrder * and limited by count * Store result to destName. * * @param destName - Geo object destination * @param longitude - longitude of object * @param latitude - latitude of object * @param radius - radius in geo units * @param geoUnit - geo unit * @param geoOrder - order of result * @param count - result limit * @return length of result */ Mono radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); /** * Finds the members of a sorted set, which are within the * borders of the area specified with the defined member location * and the maximum distance from the defined member location (the radius) * in GeoUnit units. * Store result to destName. * * @param destName - Geo object destination * @param member - object * @param radius - radius in geo units * @param geoUnit - geo unit * @return length of result */ Mono radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit); /** * Finds the members of a sorted set, which are within the * borders of the area specified with the defined member location * and the maximum distance from the defined member location (the radius) * in GeoUnit units and limited by count * Store result to destName. * * @param destName - Geo object destination * @param member - object * @param radius - radius in geo units * @param geoUnit - geo unit * @param count - result limit * @return length of result */ Mono radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit, int count); /** * Finds the members of a sorted set, which are within the * borders of the area specified with the defined member location * and the maximum distance from the defined member location (the radius) * in GeoUnit units with GeoOrder * Store result to destName. * * @param destName - Geo object destination * @param member - object * @param radius - radius in geo units * @param geoUnit - geo unit * @param geoOrder - geo order * @param count - result limit * @return length of result */ Mono radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy