org.redisson.api.RObjectAsync Maven / Gradle / Ivy
Show all versions of redisson Show documentation
/**
* 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;
/**
* Base interface for all Redisson objects
*
* @author Nikita Koksharov
*
*/
public interface RObjectAsync {
/**
* Update the last access time of an object in async mode.
*
* @return true
if object was touched else false
*/
RFuture touchAsync();
/**
* Transfer object from source Redis instance to destination Redis instance
* in async mode
*
* @param host - destination host
* @param port - destination port
* @param database - destination database
* @param timeout - maximum idle time in any moment of the communication with the destination instance in milliseconds
* @return void
*/
RFuture migrateAsync(String host, int port, int database, long timeout);
/**
* Copy object from source Redis instance to destination Redis instance
* in async mode
*
* @param host - destination host
* @param port - destination port
* @param database - destination database
* @param timeout - maximum idle time in any moment of the communication with the destination instance in milliseconds
* @return void
*/
RFuture copyAsync(String host, int port, int database, long timeout);
/**
* Move object to another database in async mode
*
* @param database - number of Redis database
* @return true
if key was moved false
if not
*/
RFuture moveAsync(int database);
/**
* Delete object in async mode
*
* @return true
if object was deleted false
if not
*/
RFuture deleteAsync();
/**
* Delete the objects.
* Actual removal will happen later asynchronously.
*
* Requires Redis 4.0+
*
* @return true
if it was exist and deleted else false
*/
RFuture unlinkAsync();
/**
* Rename current object key to newName
* in async mode
*
* @param newName - new name of object
* @return void
*/
RFuture renameAsync(String newName);
/**
* Rename current object key to newName
* in async mode only if new key is not exists
*
* @param newName - new name of object
* @return true
if object has been renamed successfully and false
otherwise
*/
RFuture renamenxAsync(String newName);
/**
* Check object existence in async mode.
*
* @return true
if object exists and false
otherwise
*/
RFuture isExistsAsync();
}