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

com.lambdaworks.redis.RedisSentinelAsyncConnection Maven / Gradle / Ivy

Go to download

Advanced and thread-safe Java Redis client for synchronous, asynchronous, and reactive usage. Supports Cluster, Sentinel, Pipelining, Auto-Reconnect, Codecs and much more.

There is a newer version: 5.0.0.Beta1
Show newest version
/*
 * Copyright 2011-2016 the original author or authors.
 *
 * 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 com.lambdaworks.redis;

import java.io.Closeable;
import java.net.SocketAddress;
import java.util.List;
import java.util.Map;

import com.lambdaworks.redis.sentinel.api.async.RedisSentinelAsyncCommands;

/**
 * Asynchronous executed commands for Sentinel.
 * 
 * @param  Key type.
 * @param  Value type.
 * @author Mark Paluch
 * @since 3.0
 * @deprecated Use {@link RedisSentinelAsyncCommands}
 */
@Deprecated
public interface RedisSentinelAsyncConnection extends Closeable {

    /**
     * Return the ip and port number of the master with that name.
     * 
     * @param key the key
     * @return Future<SocketAddress>
     */
    RedisFuture getMasterAddrByName(K key);

    /**
     * Enumerates all the monitored masters and their states.
     * 
     * @return RedisFuture<Map<K, V>>
     */
    RedisFuture>> masters();

    /**
     * Show the state and info of the specified master.
     * 
     * @param key the key
     * @return RedisFuture<Map<K, V>>
     */
    RedisFuture> master(K key);

    /**
     * Provides a list of slaves for the master with the specified name.
     * 
     * @param key the key
     * @return RedisFuture<List<Map<K, V>>>
     */
    RedisFuture>> slaves(K key);

    /**
     * This command will reset all the masters with matching name.
     * 
     * @param key the key
     * @return RedisFuture<Long>
     */
    RedisFuture reset(K key);

    /**
     * Perform a failover.
     * 
     * @param key the master id
     * @return RedisFuture<String>
     */
    RedisFuture failover(K key);

    /**
     * This command tells the Sentinel to start monitoring a new master with the specified name, ip, port, and quorum.
     * 
     * @param key the key
     * @param ip the IP address
     * @param port the port
     * @param quorum the quorum count
     * @return RedisFuture<String>
     */
    RedisFuture monitor(K key, String ip, int port, int quorum);

    /**
     * Multiple option / value pairs can be specified (or none at all).
     * 
     * @param key the key
     * @param option the option
     * @param value the value
     * 
     * @return RedisFuture<String> simple-string-reply {@code OK} if {@code SET} was executed correctly.
     */
    RedisFuture set(K key, String option, V value);

    /**
     * remove the specified master.
     * 
     * @param key the key
     * @return RedisFuture<String>
     */
    RedisFuture remove(K key);

    /**
     * Ping the server.
     * 
     * @return RedisFuture<String> simple-string-reply
     */
    RedisFuture ping();

    @Override
    void close();

    /**
     *
     * @return true if the connection is open (connected and not closed).
     */
    boolean isOpen();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy