public interface ServerCommands
Modifier and Type | Method and Description |
---|---|
String |
auth(String password)
Request for authentication in a password-protected Redis server.
|
String |
auth(String user,
String password)
Request for authentication with username and password, based on the ACL feature introduced in
Redis 6.0 see https://redis.io/topics/acl
|
String |
bgrewriteaof()
Instruct Redis to start an Append Only File rewrite process.
|
String |
bgsave()
Save the DB in background.
|
String |
bgsaveSchedule() |
byte[] |
echo(byte[] arg) |
String |
echo(String string) |
String |
flushAll()
Delete all the keys of all the existing databases, not just the currently selected one.
|
String |
flushAll(FlushMode flushMode)
Delete all the keys of all the existing databases, not just the currently selected one.
|
String |
flushDB()
Delete all the keys of the currently selected DB.
|
String |
info()
The INFO command returns information and statistics about the server in a format that is simple
to parse by computers and easy to read by humans.
|
String |
info(String section)
The INFO command returns information and statistics about the server in a format that is simple
to parse by computers and easy to read by humans.
|
long |
lastsave()
Return the UNIX TIME of the last DB save executed with success.
|
String |
lolwut() |
String |
lolwut(LolwutParams lolwutParams) |
String |
ping()
This command is often used to test if a connection is still alive, or to measure latency.
|
String |
ping(String message) |
String |
quit()
Ask the server to close the connection.
|
String |
replicaof(String host,
int port)
The REPLICAOF command can change the replication settings of a replica on the fly.
|
String |
replicaofNoOne()
REPLICAOF NO ONE will stop replication, turning the server into a MASTER, but will not discard
the replication.
|
String |
save()
The SAVE commands performs a synchronous save of the dataset producing a point in time snapshot
of all the data inside the Redis instance, in the form of an RDB file.
|
void |
shutdown()
Stop all the client.
|
void |
shutdown(SaveMode saveMode)
Deprecated.
|
void |
shutdown(ShutdownParams shutdownParams) |
String |
shutdownAbort() |
String |
slaveof(String host,
int port)
Deprecated.
|
String |
slaveofNoOne()
Deprecated.
Use
replicaofNoOne() . |
long |
waitReplicas(int replicas,
long timeout)
Syncrhonous replication of Redis as described here: http://antirez.com/news/66.
|
String ping()
byte[] echo(byte[] arg)
String quit()
String flushDB()
String flushAll()
String flushAll(FlushMode flushMode)
flushMode
- String auth(String password)
password
- String auth(String user, String password)
user
- password
- String save()
String bgsave()
String bgsaveSchedule()
String bgrewriteaof()
long lastsave()
void shutdown() throws JedisException
JedisException
- only in case of error.@Deprecated void shutdown(SaveMode saveMode) throws JedisException
shutdown(redis.clients.jedis.params.ShutdownParams)
.saveMode
- modifier to alter the data save behavior of SHUTDOWN. null
would
trigger the default behavior.JedisException
SaveMode
void shutdown(ShutdownParams shutdownParams) throws JedisException
shutdownParams
- set commands parametersJedisException
SaveMode
String shutdownAbort()
String info()
String info(String section)
section
- (all: Return all sections, default: Return only the default set of sections,
server: General information about the Redis server, clients: Client connections
section, memory: Memory consumption related information, persistence: RDB and AOF
related information, stats: General statistics, replication: Master/slave replication
information, cpu: CPU consumption statistics, commandstats: Redis command statistics,
cluster: Redis Cluster section, keyspace: Database related statistics)@Deprecated String slaveof(String host, int port)
replicaof(java.lang.String, int)
.host
- listening at the specified hostnameport
- server listening at the specified port@Deprecated String slaveofNoOne()
replicaofNoOne()
.String replicaof(String host, int port)
host
- listening at the specified hostnameport
- server listening at the specified portString replicaofNoOne()
long waitReplicas(int replicas, long timeout)
Blocks until all the previous write commands are successfully transferred and acknowledged by at least the specified number of replicas. If the timeout, specified in milliseconds, is reached, the command returns even if the specified number of replicas were not yet reached.
Since Java Object class has implemented wait
method, we cannot use it.
replicas
- successfully transferred and acknowledged by at least the specified number of
replicastimeout
- the time to block in milliseconds, a timeout of 0 means to block foreverString lolwut()
String lolwut(LolwutParams lolwutParams)
Copyright © 2022. All rights reserved.