2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-12-23 02:28:01 +00:00

more java docs stuff + added jedis pool method and deprecate it

This commit is contained in:
mohammed jasem alaajel 2022-04-14 14:34:56 +04:00
parent 102f8591ab
commit 070e416fac
4 changed files with 28 additions and 6 deletions

View File

@ -1,7 +1,7 @@
package com.imaginarycode.minecraft.redisbungee;
/**
* This used to be old plugin instance of redis-bungee but now its used to get the api for old plugins
* This used to be old plugin instance of redis-bungee, but now it's used to get the api for old plugins
*
* @deprecated its deprecated but won't be removed, so please use {@link RedisBungeeAPI#getRedisBungeeApi()}
*
@ -16,7 +16,7 @@ public class RedisBungee {
}
/**
* This returns instance of {@link RedisBungeeAPI}
* This returns an instance of {@link RedisBungeeAPI}
*
* @deprecated Please use {@link RedisBungeeAPI#getRedisBungeeApi()} this class intended to for old plugins that no longer updated.
*

View File

@ -297,20 +297,33 @@ public class RedisBungeeAPI {
*
* @param name the UUID to fetch the name for
* @param expensiveLookups whether or not to perform potentially expensive lookups
* @return the UUID for the name
* @return the {@link UUID} for the name
* @since 0.3.2
*/
public final UUID getUuidFromName(@NonNull String name, boolean expensiveLookups) {
return plugin.getUuidTranslator().getTranslatedUuid(name, expensiveLookups);
}
/**
* This gives you instance of Jedis!
*
* This gets Redis Bungee {@link JedisPool}
* @return {@link JedisPool}
* @deprecated this secluded to be removed when support for redis sentinel or redis cluster is finished, use {@link RedisBungeeAPI#requestJedis()}
* @since 0.6.5
*/
@Deprecated
public JedisPool getJedisPool() {
return this.plugin.getJedisPool();
}
/**
* This gives you instance of Jedis
* @return {@link Jedis}
* @since 0.7.0
*/
public Jedis getJedisPool() {
public Jedis requestJedis() {
return this.plugin.requestJedis();
}

View File

@ -1,6 +1,7 @@
package com.imaginarycode.minecraft.redisbungee.internal;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
/**
@ -16,4 +17,7 @@ public interface JedisSummoner {
boolean isJedisAvailable();
@Deprecated
JedisPool getJedisPool();
}

View File

@ -134,6 +134,11 @@ public class RedisBungeeBungeePlugin extends Plugin implements RedisBungeePlugin
return !jedisPool.isClosed();
}
@Override
public JedisPool getJedisPool() {
return this.jedisPool;
}
@Override
public RedisBungeeAPI getApi() {
return this.api;