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

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

Go to download

Easy Redis Java client and Real-Time Data Platform. Valkey compatible. Sync/Async/RxJava3/Reactive API. Client side caching. Over 50 Redis based Java objects and services: JCache API, Apache Tomcat, Hibernate, Spring, Set, Multimap, SortedSet, Map, List, Queue, Deque, Semaphore, Lock, AtomicLong, Map Reduce, Bloom filter, Scheduler, RPC

There is a newer version: 3.40.2
Show newest version
/**
 * Copyright (c) 2013-2024 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 org.redisson.api.geo.GeoSearchArgs;
import reactor.core.publisher.Mono;

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

/**
 * 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);

    /**
     * Adds geospatial member only if it's already exists.
     * 

* Requires Redis 6.2.0 and higher. * * @param longitude - longitude of object * @param latitude - latitude of object * @param member - object itself * @return number of elements added to the sorted set */ Mono addIfExists(double longitude, double latitude, V member); /** * Adds geospatial members only if it's already exists. *

* Requires Redis 6.2.0 and higher. * * @param entries - objects * @return number of elements added to the sorted set */ Mono addIfExists(GeoEntry... entries); /** * Adds geospatial member only if has not been added before. *

* Requires Redis 6.2.0 and higher. * * @param longitude - longitude of object * @param latitude - latitude of object * @param member - object itself * @return number of elements added to the sorted set */ Mono tryAdd(double longitude, double latitude, V member); /** * Adds geospatial members only if has not been added before. *

* Requires Redis 6.2.0 and higher. * * @param entries - objects * @return number of elements added to the sorted set */ Mono tryAdd(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 long 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 specified search conditions. *

* Usage examples: *

     * List objects = geo.search(GeoSearchArgs.from(15, 37)
     *                                 .radius(200, GeoUnit.KILOMETERS)
     *                                 .order(GeoOrder.ASC)
     *                                 .count(1)));
     * 
*
     * List objects = geo.search(GeoSearchArgs.from(15, 37)
     *                                 .radius(200, GeoUnit.KILOMETERS)));
     * 
*

* Requires Redis 3.2.10 and higher. * * @param args - search conditions object * @return list of memebers */ Mono> search(GeoSearchArgs args); /* * Use search() method instead * */ @Deprecated Mono> radius(double longitude, double latitude, double radius, GeoUnit geoUnit); /* * Use search() method instead * */ @Deprecated Mono> radius(double longitude, double latitude, double radius, GeoUnit geoUnit, int count); /* * Use search() method instead * */ @Deprecated Mono> radius(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder); /* * Use search() method instead * */ @Deprecated Mono> radius(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); /** * Returns the distance mapped by member of a sorted set, * which are within the borders of specified search conditions. *

* Usage examples: *

     * Map objects = geo.searchWithDistance(GeoSearchArgs.from(15, 37)
     *                                 .radius(200, GeoUnit.KILOMETERS)
     *                                 .order(GeoOrder.ASC)
     *                                 .count(1)));
     * 
*
     * Map objects = geo.searchWithDistance(GeoSearchArgs.from(15, 37)
     *                                 .radius(200, GeoUnit.KILOMETERS)));
     * 
*

* Requires Redis 3.2.10 and higher. * * @param args - search conditions object * @return distance mapped by object */ Mono> searchWithDistance(GeoSearchArgs args); /* * Use searchWithDistance() method instead * */ @Deprecated Mono> radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit); /* * Use searchWithDistance() method instead * */ @Deprecated Mono> radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit, int count); /* * Use searchWithDistance() method instead * */ @Deprecated Mono> radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder); /* * Use searchWithDistance() method instead * */ @Deprecated Mono> radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); /** * Returns the position mapped by member of a sorted set, * which are within the borders of specified search conditions. *

* Usage examples: *

     * Map objects = geo.searchWithPosition(GeoSearchArgs.from(15, 37)
     *                                 .radius(200, GeoUnit.KILOMETERS)
     *                                 .order(GeoOrder.ASC)
     *                                 .count(1)));
     * 
*
     * Map objects = geo.searchWithPosition(GeoSearchArgs.from(15, 37)
     *                                 .radius(200, GeoUnit.KILOMETERS)));
     * 
*

* Requires Redis 3.2.10 and higher. * * @param args - search conditions object * @return position mapped by object */ Mono> searchWithPosition(GeoSearchArgs args); /* * Use searchWithPosition() method instead * */ @Deprecated Mono> radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit); /* * Use searchWithPosition() method instead * */ @Deprecated Mono> radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit, int count); /* * Use searchWithPosition() method instead * */ @Deprecated Mono> radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder); /* * Use searchWithPosition() method instead * */ @Deprecated Mono> radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); /* * Use search() method instead * */ @Deprecated Mono> radius(V member, double radius, GeoUnit geoUnit); /* * Use search() method instead * */ @Deprecated Mono> radius(V member, double radius, GeoUnit geoUnit, int count); /* * Use search() method instead * */ @Deprecated Mono> radius(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder); /* * Use search() method instead * */ @Deprecated Mono> radius(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); /* * Use searchWithDistance() method instead * */ @Deprecated Mono> radiusWithDistance(V member, double radius, GeoUnit geoUnit); /* * Use searchWithDistance() method instead * */ @Deprecated Mono> radiusWithDistance(V member, double radius, GeoUnit geoUnit, int count); /* * Use searchWithDistance() method instead * */ @Deprecated Mono> radiusWithDistance(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder); /* * Use searchWithDistance() method instead * */ @Deprecated Mono> radiusWithDistance(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); /* * Use searchWithPosition() method instead * */ @Deprecated Mono> radiusWithPosition(V member, double radius, GeoUnit geoUnit); /* * Use searchWithPosition() method instead * */ @Deprecated Mono> radiusWithPosition(V member, double radius, GeoUnit geoUnit, int count); /* * Use searchWithPosition() method instead * */ @Deprecated Mono> radiusWithPosition(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder); /* * Use searchWithPosition() method instead * */ @Deprecated 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 specified search conditions. *

* Stores result to destName. *

* Usage examples: *

     * long count = geo.storeSearchTo(GeoSearchArgs.from(15, 37)
     *                                 .radius(200, GeoUnit.KILOMETERS)
     *                                 .order(GeoOrder.ASC)
     *                                 .count(1)));
     * 
*
     * long count = geo.storeSearchTo(GeoSearchArgs.from(15, 37)
     *                                 .radius(200, GeoUnit.KILOMETERS)));
     * 
* * @param args - search conditions object * @return length of result */ Mono storeSearchTo(String destName, GeoSearchArgs args); /* * Use storeSearchTo() method instead * */ @Deprecated Mono radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit); /* * Use storeSearchTo() method instead * */ @Deprecated Mono radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count); /* * Use storeSearchTo() method instead * */ @Deprecated Mono radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); /* * Use storeSearchTo() method instead * */ @Deprecated Mono radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit); /* * Use storeSearchTo() method instead * */ @Deprecated Mono radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit, int count); /* * Use storeSearchTo() method instead * */ @Deprecated Mono radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); /** * Finds the members of a sorted set, * which are within the borders of specified search conditions. *

* Stores result to destName sorted by distance. *

* Usage examples: *

     * long count = geo.storeSortedSearchTo(GeoSearchArgs.from(15, 37)
     *                                 .radius(200, GeoUnit.KILOMETERS)
     *                                 .order(GeoOrder.ASC)
     *                                 .count(1)));
     * 
*
     * long count = geo.storeSortedSearchTo(GeoSearchArgs.from(15, 37)
     *                                 .radius(200, GeoUnit.KILOMETERS)));
     * 
* * @param args - search conditions object * @return length of result */ RFuture storeSortedSearchTo(String destName, GeoSearchArgs args); /* * Use storeSortedSearchTo() method instead * */ @Deprecated Mono radiusStoreSortedTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit); /* * Use storeSortedSearchTo() method instead * */ @Deprecated Mono radiusStoreSortedTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count); /* * Use storeSortedSearchTo() method instead * */ @Deprecated Mono radiusStoreSortedTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); /* * Use storeSortedSearchTo() method instead * */ @Deprecated Mono radiusStoreSortedTo(String destName, V member, double radius, GeoUnit geoUnit); /* * Use storeSortedSearchTo() method instead * */ @Deprecated Mono radiusStoreSortedTo(String destName, V member, double radius, GeoUnit geoUnit, int count); /* * Use storeSortedSearchTo() method instead * */ @Deprecated Mono radiusStoreSortedTo(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy