Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you 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 io.vertx.groovy.redis;
import groovy.transform.CompileStatic
import io.vertx.lang.groovy.InternalHelper
import io.vertx.core.json.JsonObject
import io.vertx.redis.op.BitOperation
import io.vertx.redis.op.ResetOptions
import io.vertx.redis.op.ObjectCmd
import io.vertx.redis.op.KillFilter
import java.util.Map
import io.vertx.redis.op.GeoUnit
import io.vertx.core.json.JsonObject
import io.vertx.core.AsyncResult
import io.vertx.redis.op.RangeOptions
import io.vertx.redis.op.GeoMember
import io.vertx.redis.op.GeoRadiusOptions
import io.vertx.redis.op.InsertOptions
import io.vertx.redis.op.AggregateOptions
import io.vertx.redis.op.SetOptions
import io.vertx.redis.op.SortOptions
import io.vertx.redis.op.MigrateOptions
import io.vertx.redis.op.ScanOptions
import io.vertx.redis.op.FailoverOptions
import io.vertx.redis.op.SlotCmd
import io.vertx.redis.op.RangeLimitOptions
import io.vertx.redis.op.LimitOptions
import io.vertx.core.json.JsonArray
import java.util.List
import io.vertx.groovy.core.buffer.Buffer
import io.vertx.core.Handler
/**
* This Interface represents a TX
*/
@CompileStatic
public class RedisTransaction {
private final def io.vertx.redis.RedisTransaction delegate;
public RedisTransaction(Object delegate) {
this.delegate = (io.vertx.redis.RedisTransaction) delegate;
}
public Object getDelegate() {
return delegate;
}
/**
* Close the client - when it is fully closed the handler will be called.
* @param handler
*/
public void close(Handler> handler) {
delegate.close(handler);
}
/**
* Append a value to a key
* @param key Key string
* @param value Value to append
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction append(String key, String value, Handler> handler) {
delegate.append(key, value, handler);
return this;
}
/**
* Authenticate to the server
* @param password Password for authentication
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction auth(String password, Handler> handler) {
delegate.auth(password, handler);
return this;
}
/**
* Asynchronously rewrite the append-only file
* @param handler
* @return
*/
public RedisTransaction bgrewriteaof(Handler> handler) {
delegate.bgrewriteaof(handler);
return this;
}
/**
* Asynchronously save the dataset to disk
* @param handler
* @return
*/
public RedisTransaction bgsave(Handler> handler) {
delegate.bgsave(handler);
return this;
}
/**
* Count set bits in a string
* @param key Key string
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction bitcount(String key, Handler> handler) {
delegate.bitcount(key, handler);
return this;
}
/**
* Count set bits in a string
* @param key Key string
* @param start Start index
* @param end End index
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction bitcountRange(String key, long start, long end, Handler> handler) {
delegate.bitcountRange(key, start, end, handler);
return this;
}
/**
* Perform bitwise operations between strings
* @param operation Bitwise operation to perform
* @param destkey Destination key where result is stored
* @param keys List of keys on which to perform the operation
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction bitop(BitOperation operation, String destkey, List keys, Handler> handler) {
delegate.bitop(operation, destkey, keys != null ? (List)keys.collect({it}) : null, handler);
return this;
}
/**
* Find first bit set or clear in a string
* @param key Key string
* @param bit What bit value to look for - must be 1, or 0
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction bitpos(String key, int bit, Handler> handler) {
delegate.bitpos(key, bit, handler);
return this;
}
/**
* Find first bit set or clear in a string
*
* See also bitposRange() method, which takes start, and stop offset.
* @param key Key string
* @param bit What bit value to look for - must be 1, or 0
* @param start Start offset
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction bitposFrom(String key, int bit, int start, Handler> handler) {
delegate.bitposFrom(key, bit, start, handler);
return this;
}
/**
* Find first bit set or clear in a string
*
* Note: when both start, and stop offsets are specified,
* behaviour is slightly different than if only start is specified
* @param key Key string
* @param bit What bit value to look for - must be 1, or 0
* @param start Start offset
* @param stop End offset - inclusive
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction bitposRange(String key, int bit, int start, int stop, Handler> handler) {
delegate.bitposRange(key, bit, start, stop, handler);
return this;
}
/**
* Remove and get the first element in a list, or block until one is available
* @param key Key string identifying a list to watch
* @param seconds Timeout in seconds
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction blpop(String key, int seconds, Handler> handler) {
delegate.blpop(key, seconds, handler);
return this;
}
/**
* Remove and get the first element in any of the lists, or block until one is available
* @param keys List of key strings identifying lists to watch
* @param seconds Timeout in seconds
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction blpopMany(List keys, int seconds, Handler> handler) {
delegate.blpopMany(keys != null ? (List)keys.collect({it}) : null, seconds, handler);
return this;
}
/**
* Remove and get the last element in a list, or block until one is available
* @param key Key string identifying a list to watch
* @param seconds Timeout in seconds
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction brpop(String key, int seconds, Handler> handler) {
delegate.brpop(key, seconds, handler);
return this;
}
/**
* Remove and get the last element in any of the lists, or block until one is available
* @param keys List of key strings identifying lists to watch
* @param seconds Timeout in seconds
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction brpopMany(List keys, int seconds, Handler> handler) {
delegate.brpopMany(keys != null ? (List)keys.collect({it}) : null, seconds, handler);
return this;
}
/**
* Pop a value from a list, push it to another list and return it; or block until one is available
* @param key Key string identifying the source list
* @param destkey Key string identifying the destination list
* @param seconds Timeout in seconds
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction brpoplpush(String key, String destkey, int seconds, Handler> handler) {
delegate.brpoplpush(key, destkey, seconds, handler);
return this;
}
/**
* Kill the connection of a client
* @param filter Filter options (see KillFilter)
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clientKill(Map filter = [:], Handler> handler) {
delegate.clientKill(filter != null ? new io.vertx.redis.op.KillFilter(io.vertx.lang.groovy.InternalHelper.toJsonObject(filter)) : null, handler);
return this;
}
/**
* Get the list of client connections
* @param handler
* @return
*/
public RedisTransaction clientList(Handler> handler) {
delegate.clientList(handler);
return this;
}
/**
* Get the current connection name
* @param handler
* @return
*/
public RedisTransaction clientGetname(Handler> handler) {
delegate.clientGetname(handler);
return this;
}
/**
* Stop processing commands from clients for some time
* @param millis Pause time in milliseconds
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clientPause(long millis, Handler> handler) {
delegate.clientPause(millis, handler);
return this;
}
/**
* Set the current connection name
* @param name New name for current connection
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clientSetname(String name, Handler> handler) {
delegate.clientSetname(name, handler);
return this;
}
/**
* Assign new hash slots to receiving node.
* @param slots
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterAddslots(List slots, Handler> handler) {
delegate.clusterAddslots(slots != null ? (List)slots.collect({it}) : null, handler);
return this;
}
/**
* Return the number of failure reports active for a given node.
* @param nodeId
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterCountFailureReports(String nodeId, Handler> handler) {
delegate.clusterCountFailureReports(nodeId, handler);
return this;
}
/**
* Return the number of local keys in the specified hash slot.
* @param slot
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterCountkeysinslot(long slot, Handler> handler) {
delegate.clusterCountkeysinslot(slot, handler);
return this;
}
/**
* Set hash slots as unbound in receiving node.
* @param slot
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterDelslots(long slot, Handler> handler) {
delegate.clusterDelslots(slot, handler);
return this;
}
/**
* Set hash slots as unbound in receiving node.
* @param slots
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterDelslotsMany(List slots, Handler> handler) {
delegate.clusterDelslotsMany(slots != null ? (List)slots.collect({it}) : null, handler);
return this;
}
/**
* Forces a slave to perform a manual failover of its master.
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterFailover(Handler> handler) {
delegate.clusterFailover(handler);
return this;
}
/**
* Forces a slave to perform a manual failover of its master.
* @param options
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterFailOverWithOptions(FailoverOptions options, Handler> handler) {
delegate.clusterFailOverWithOptions(options, handler);
return this;
}
/**
* Remove a node from the nodes table.
* @param nodeId
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterForget(String nodeId, Handler> handler) {
delegate.clusterForget(nodeId, handler);
return this;
}
/**
* Return local key names in the specified hash slot.
* @param slot
* @param count
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterGetkeysinslot(long slot, long count, Handler> handler) {
delegate.clusterGetkeysinslot(slot, count, handler);
return this;
}
/**
* Provides info about Redis Cluster node state.
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterInfo(Handler> handler) {
delegate.clusterInfo(handler);
return this;
}
/**
* Returns the hash slot of the specified key.
* @param key
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterKeyslot(String key, Handler> handler) {
delegate.clusterKeyslot(key, handler);
return this;
}
/**
* Force a node cluster to handshake with another node.
* @param ip
* @param port
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterMeet(String ip, long port, Handler> handler) {
delegate.clusterMeet(ip, port, handler);
return this;
}
/**
* Get Cluster config for the node.
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterNodes(Handler> handler) {
delegate.clusterNodes(handler);
return this;
}
/**
* Reconfigure a node as a slave of the specified master node.
* @param nodeId
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterReplicate(String nodeId, Handler> handler) {
delegate.clusterReplicate(nodeId, handler);
return this;
}
/**
* Reset a Redis Cluster node.
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterReset(Handler> handler) {
delegate.clusterReset(handler);
return this;
}
/**
* Reset a Redis Cluster node.
* @param options
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterResetWithOptions(ResetOptions options, Handler> handler) {
delegate.clusterResetWithOptions(options, handler);
return this;
}
/**
* Forces the node to save cluster state on disk.
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterSaveconfig(Handler> handler) {
delegate.clusterSaveconfig(handler);
return this;
}
/**
* Set the configuration epoch in a new node.
* @param epoch
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterSetConfigEpoch(long epoch, Handler> handler) {
delegate.clusterSetConfigEpoch(epoch, handler);
return this;
}
/**
* Bind an hash slot to a specific node.
* @param slot
* @param subcommand
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterSetslot(long slot, SlotCmd subcommand, Handler> handler) {
delegate.clusterSetslot(slot, subcommand, handler);
return this;
}
/**
* Bind an hash slot to a specific node.
* @param slot
* @param subcommand
* @param nodeId
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterSetslotWithNode(long slot, SlotCmd subcommand, String nodeId, Handler> handler) {
delegate.clusterSetslotWithNode(slot, subcommand, nodeId, handler);
return this;
}
/**
* List slave nodes of the specified master node.
* @param nodeId
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction clusterSlaves(String nodeId, Handler> handler) {
delegate.clusterSlaves(nodeId, handler);
return this;
}
/**
* Get array of Cluster slot to node mappings
* @param handler
* @return
*/
public RedisTransaction clusterSlots(Handler> handler) {
delegate.clusterSlots(handler);
return this;
}
/**
* Get array of Redis command details
* @param handler
* @return
*/
public RedisTransaction command(Handler> handler) {
delegate.command(handler);
return this;
}
/**
* Get total number of Redis commands
* @param handler
* @return
*/
public RedisTransaction commandCount(Handler> handler) {
delegate.commandCount(handler);
return this;
}
/**
* Extract keys given a full Redis command
* @param handler
* @return
*/
public RedisTransaction commandGetkeys(Handler> handler) {
delegate.commandGetkeys(handler);
return this;
}
/**
* Get array of specific Redis command details
* @param commands List of commands to get info for
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction commandInfo(List commands, Handler> handler) {
delegate.commandInfo(commands != null ? (List)commands.collect({it}) : null, handler);
return this;
}
/**
* Get the value of a configuration parameter
* @param parameter Configuration parameter
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction configGet(String parameter, Handler> handler) {
delegate.configGet(parameter, handler);
return this;
}
/**
* Rewrite the configuration file with the in memory configuration
* @param handler
* @return
*/
public RedisTransaction configRewrite(Handler> handler) {
delegate.configRewrite(handler);
return this;
}
/**
* Set a configuration parameter to the given value
* @param parameter Configuration parameter
* @param value New value
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction configSet(String parameter, String value, Handler> handler) {
delegate.configSet(parameter, value, handler);
return this;
}
/**
* Reset the stats returned by INFO
* @param handler
* @return
*/
public RedisTransaction configResetstat(Handler> handler) {
delegate.configResetstat(handler);
return this;
}
/**
* Return the number of keys in the selected database
* @param handler
* @return
*/
public RedisTransaction dbsize(Handler> handler) {
delegate.dbsize(handler);
return this;
}
/**
* Get debugging information about a key
* @param key Key string
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction debugObject(String key, Handler> handler) {
delegate.debugObject(key, handler);
return this;
}
/**
* Make the server crash
* @param handler
* @return
*/
public RedisTransaction debugSegfault(Handler> handler) {
delegate.debugSegfault(handler);
return this;
}
/**
* Decrement the integer value of a key by one
* @param key Key string
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction decr(String key, Handler> handler) {
delegate.decr(key, handler);
return this;
}
/**
* Decrement the integer value of a key by the given number
* @param key Key string
* @param decrement Value by which to decrement
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction decrby(String key, long decrement, Handler> handler) {
delegate.decrby(key, decrement, handler);
return this;
}
/**
* Delete a key
* @param key Keys to delete
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction del(String key, Handler> handler) {
delegate.del(key, handler);
return this;
}
/**
* Delete many keys
* @param keys List of keys to delete
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction delMany(List keys, Handler> handler) {
delegate.delMany(keys != null ? (List)keys.collect({it}) : null, handler);
return this;
}
/**
* Discard all commands issued after MULTI
* @param handler
* @return
*/
public RedisTransaction discard(Handler> handler) {
delegate.discard(handler);
return this;
}
/**
* Return a serialized version of the value stored at the specified key.
* @param key Key string
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction dump(String key, Handler> handler) {
delegate.dump(key, handler);
return this;
}
/**
* Echo the given string
* @param message String to echo
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction echo(String message, Handler> handler) {
delegate.echo(message, handler);
return this;
}
/**
* Execute a Lua script server side. Due to the dynamic nature of this command any response type could be returned
* for This reason and to ensure type safety the reply is always guaranteed to be a JsonArray.
*
* When a reply if for example a String the handler will be called with a JsonArray with a single element containing
* the String.
* @param script Lua script to evaluate
* @param keys List of keys
* @param args List of argument values
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction eval(String script, List keys, List args, Handler> handler) {
delegate.eval(script, keys != null ? (List)keys.collect({it}) : null, args != null ? (List)args.collect({it}) : null, handler);
return this;
}
/**
* Execute a Lua script server side. Due to the dynamic nature of this command any response type could be returned
* for This reason and to ensure type safety the reply is always guaranteed to be a JsonArray.
*
* When a reply if for example a String the handler will be called with a JsonArray with a single element containing
* the String.
* @param sha1 SHA1 digest of the script cached on the server
* @param keys List of keys
* @param values List of values
* @param handler Handler for the result of this call.
* @return
*/
public RedisTransaction evalsha(String sha1, List keys, List values, Handler> handler) {
delegate.evalsha(sha1, keys != null ? (List)keys.collect({it}) : null, values != null ? (List)values.collect({it}) : null, handler);
return this;
}
/**
* Execute all commands issued after MULTI
* @param handler
* @return
*/
public RedisTransaction exec(Handler>> handler) {
delegate.exec(handler != null ? new Handler>() {
public void handle(AsyncResult ar) {
if (ar.succeeded()) {
handler.handle(io.vertx.core.Future.succeededFuture((List