javadocs fixed

pull/653/head
Nikita 8 years ago
parent f657a42ef7
commit c39e624428

@ -39,8 +39,8 @@ public class CronSchedule {
/**
* Creates cron expression object with defined expression string
*
* @param expression
* @return
* @param expression of cron
* @return object
* @throws IllegalArgumentException
* wrapping a ParseException if the expression is invalid
*/
@ -52,9 +52,9 @@ public class CronSchedule {
* Creates cron expression which schedule task execution
* every day at the given time
*
* @param hour
* @param minute
* @return
* @param hour of schedule
* @param minute of schedule
* @return object
* @throws IllegalArgumentException
* wrapping a ParseException if the expression is invalid
*/
@ -68,18 +68,10 @@ public class CronSchedule {
* every given days of the week at the given time.
* Use Calendar object constants to define day.
*
* @see Calendar#SUNDAY
* @see Calendar#MONDAY
* @see Calendar#TUESDAY
* @see Calendar#WEDNESDAY
* @see Calendar#THURSDAY
* @see Calendar#FRIDAY
* @see Calendar#SATURDAY
*
* @param hour
* @param minute
* @param hour of schedule
* @param minute of schedule
* @param daysOfWeek - Calendar object constants
* @return
* @return object
*/
public static CronSchedule weeklyOnDayAndHourAndMinute(int hour, int minute, Integer... daysOfWeek) {
if (daysOfWeek == null || daysOfWeek.length == 0) {
@ -98,10 +90,10 @@ public class CronSchedule {
* Creates cron expression which schedule task execution
* every given day of the month at the given time
*
* @param hour
* @param minute
* @param daysOfWeek
* @return
* @param hour of schedule
* @param minute of schedule
* @param dayOfMonth of schedule
* @return object
*/
public static CronSchedule monthlyOnDayAndHourAndMinute(int dayOfMonth, int hour, int minute) {
String expression = String.format("0 %d %d %d * ?", minute, hour, dayOfMonth);

@ -23,8 +23,7 @@ import org.redisson.client.protocol.pubsub.PubSubType;
*
* @author Nikita Koksharov
*
* @param <K>
* @param <V>
* @param <V> value
*/
public class PubSubMessageListener<V> implements RedisPubSubListener<Object> {

@ -15,7 +15,6 @@
*/
package org.redisson;
import org.redisson.api.listener.MessageListener;
import org.redisson.api.listener.PatternMessageListener;
import org.redisson.client.RedisPubSubListener;
import org.redisson.client.protocol.pubsub.PubSubType;
@ -24,8 +23,7 @@ import org.redisson.client.protocol.pubsub.PubSubType;
*
* @author Nikita Koksharov
*
* @param <K>
* @param <V>
* @param <V> value
*/
public class PubSubPatternMessageListener<V> implements RedisPubSubListener<V> {

@ -23,8 +23,7 @@ import org.redisson.client.protocol.pubsub.PubSubType;
*
* @author Nikita Koksharov
*
* @param <K>
* @param <V>
* @param <V> value
*/
public class PubSubPatternStatusListener<V> implements RedisPubSubListener<V> {

@ -23,8 +23,7 @@ import org.redisson.client.protocol.pubsub.PubSubType;
*
* @author Nikita Koksharov
*
* @param <K>
* @param <V>
* @param <V> value
*/
public class PubSubStatusListener<V> implements RedisPubSubListener<V> {

@ -135,7 +135,7 @@ public class Redisson implements RedissonClient {
/**
* Create sync/async Redisson instance with provided config
*
* @param config
* @param config for Redisson
* @return Redisson instance
*/
public static RedissonClient create(Config config) {
@ -163,6 +163,7 @@ public class Redisson implements RedissonClient {
/**
* Create reactive Redisson instance with provided config
*
* @param config for Redisson
* @return Redisson instance
*/
public static RedissonReactiveClient createReactive(Config config) {

@ -45,7 +45,7 @@ import net.openhft.hashing.LongHashFunction;
*
* @author Nikita Koksharov
*
* @param <T>
* @param <T> type of object
*/
public class RedissonBloomFilter<T> extends RedissonExpirable implements RBloomFilter<T> {

@ -47,7 +47,7 @@ import org.redisson.connection.decoder.MapGetAllDecoder;
*
* @author Nikita Koksharov
*
* @param <V>
* @param <V> value
*/
public class RedissonGeo<V> extends RedissonExpirable implements RGeo<V> {

@ -30,7 +30,7 @@ import org.redisson.command.CommandAsyncExecutor;
*
* @author Nikita Koksharov
*
* @param <V>
* @param <V> value
*/
public class RedissonHyperLogLog<V> extends RedissonExpirable implements RHyperLogLog<V> {

@ -46,7 +46,7 @@ public class RedissonMultiLock implements Lock {
* Creates instance with multiple {@link RLock} objects.
* Each RLock object could be created by own Redisson instance.
*
* @param locks
* @param locks - array of locks
*/
public RedissonMultiLock(RLock... locks) {
if (locks.length == 0) {

@ -170,7 +170,7 @@ public class RedissonNode {
/**
* Create Redisson node instance with provided config
*
* @param config
* @param config of RedissonNode
* @return RedissonNode instance
*/
public static RedissonNode create(RedissonNodeConfig config) {
@ -180,8 +180,8 @@ public class RedissonNode {
/**
* Create Redisson node instance with provided config and Redisson instance
*
* @param config
* @param redisson
* @param config of RedissonNode
* @param redisson instance
* @return RedissonNode instance
*/
public static RedissonNode create(RedissonNodeConfig config, Redisson redisson) {

@ -38,7 +38,7 @@ public class RedissonRedLock extends RedissonMultiLock {
* Creates instance with multiple {@link RLock} objects.
* Each RLock object could be created by own Redisson instance.
*
* @param locks
* @param locks - array of locks
*/
public RedissonRedLock(RLock... locks) {
super(locks);

@ -15,7 +15,6 @@
*/
package org.redisson;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Arrays;
@ -37,11 +36,9 @@ import org.redisson.client.protocol.convertor.BooleanReplayConvertor;
import org.redisson.client.protocol.decoder.ListScanResult;
import org.redisson.command.CommandAsyncExecutor;
import io.netty.util.concurrent.Future;
/**
* <p>Set-based cache with ability to set TTL for each entry via
* {@link #put(Object, Object, long, TimeUnit)} method.
* {@link RSetCache#add(Object, long, TimeUnit)} method.
* </p>
*
* <p>Current Redis implementation doesn't have set entry eviction functionality.
@ -51,11 +48,10 @@ import io.netty.util.concurrent.Future;
* In addition there is {@link org.redisson.EvictionScheduler}. This scheduler
* deletes expired entries in time interval between 5 seconds to 2 hours.</p>
*
* <p>If eviction is not required then it's better to use {@link org.redisson.reactive.RedissonSet}.</p>
* <p>If eviction is not required then it's better to use {@link org.redisson.api.RSet}.</p>
*
* @author Nikita Koksharov
*
* @param <K> key
* @param <V> value
*/
public class RedissonSetCache<V> extends RedissonExpirable implements RSetCache<V> {

@ -44,7 +44,7 @@ import io.netty.channel.EventLoopGroup;
*
* @author Nikita Koksharov
*
* @param <V>
* @param <V> value
*/
public class RedissonSortedSet<V> extends RedissonObject implements RSortedSet<V> {

@ -17,6 +17,12 @@ package org.redisson.api;
import java.util.Collection;
/**
*
* @author Nikita Koksharov
*
* @param <V> type of value
*/
public interface RCollectionAsync<V> extends RExpirableAsync {
/**

@ -19,6 +19,12 @@ import java.util.Collection;
import org.reactivestreams.Publisher;
/**
*
* @author Nikita Koksharov
*
* @param <V> value
*/
public interface RCollectionReactive<V> extends RExpirableReactive {
Publisher<V> iterator();

@ -17,6 +17,12 @@ package org.redisson.api;
import java.util.Collection;
/**
*
* @author Nikita Koksharov
*
* @param <V> value
*/
public interface RHyperLogLog<V> extends RExpirable, RHyperLogLogAsync<V> {
boolean add(V obj);

@ -17,6 +17,12 @@ package org.redisson.api;
import java.util.Collection;
/**
*
* @author Nikita Koksharov
*
* @param <V> value
*/
public interface RHyperLogLogAsync<V> extends RExpirableAsync {
RFuture<Boolean> addAsync(V obj);

@ -29,14 +29,14 @@ public interface RSet<V> extends Set<V>, RExpirable, RSetAsync<V> {
/**
* Removes and returns random element from set
*
* @return
* @return value
*/
V removeRandom();
/**
* Returns random element from set
*
* @return
* @return value
*/
V random();
@ -53,7 +53,7 @@ public interface RSet<V> extends Set<V>, RExpirable, RSetAsync<V> {
/**
* Read all elements at once
*
* @return
* @return values
*/
Set<V> readAll();
@ -61,17 +61,17 @@ public interface RSet<V> extends Set<V>, RExpirable, RSetAsync<V> {
* Union sets specified by name and write to current set.
* If current set already exists, it is overwritten.
*
* @param names
* @return
* @param names - name of sets
* @return size of union
*/
int union(String... names);
/**
* Union sets specified by name with current set.
* Without current set state change.
*
* @param names
* @return
* Union sets specified by name with current set
* without current set state change.
*
* @param names - name of sets
* @return values
*/
Set<V> readUnion(String... names);
@ -79,17 +79,17 @@ public interface RSet<V> extends Set<V>, RExpirable, RSetAsync<V> {
* Diff sets specified by name and write to current set.
* If current set already exists, it is overwritten.
*
* @param names
* @return
* @param names - name of sets
* @return values
*/
int diff(String... names);
/**
* Diff sets specified by name with current set.
* Without current set state change.
*
* @param names
* @return
*
* @param names - name of sets
* @return values
*/
Set<V> readDiff(String... names);
@ -97,17 +97,17 @@ public interface RSet<V> extends Set<V>, RExpirable, RSetAsync<V> {
* Intersection sets specified by name and write to current set.
* If current set already exists, it is overwritten.
*
* @param names
* @return
* @param names - name of sets
* @return size of intersection
*/
int intersection(String... names);
/**
* Intersection sets specified by name with current set.
* Without current set state change.
*
* @param names
* @return
* Intersection sets specified by name with current set
* without current set state change.
*
* @param names - name of sets
* @return values
*/
Set<V> readIntersection(String... names);

@ -29,16 +29,16 @@ public interface RSetAsync<V> extends RCollectionAsync<V> {
/**
* Removes and returns random element from set
* in async mode
*
* @return
*
* @return value
*/
RFuture<V> removeRandomAsync();
/**
* Returns random element from set
* in async mode
*
* @return
*
* @return value
*/
RFuture<V> randomAsync();
@ -47,7 +47,7 @@ public interface RSetAsync<V> extends RCollectionAsync<V> {
*
* @param destination the destination set
* @param member the member to move
* @return true if the element is moved, false if the element is not a
* @return <code>true</code> if the element is moved, <code>false</code> if the element is not a
* member of this set or no operation was performed
*/
RFuture<Boolean> moveAsync(String destination, V member);
@ -55,7 +55,7 @@ public interface RSetAsync<V> extends RCollectionAsync<V> {
/**
* Read all elements at once
*
* @return
* @return values
*/
RFuture<Set<V>> readAllAsync();
@ -63,54 +63,54 @@ public interface RSetAsync<V> extends RCollectionAsync<V> {
* Union sets specified by name and write to current set.
* If current set already exists, it is overwritten.
*
* @param names
* @return
* @param names - name of sets
* @return size of union
*/
RFuture<Integer> unionAsync(String... keys);
RFuture<Integer> unionAsync(String... names);
/**
* Union sets specified by name with current set.
* Without current set state change.
*
* @param names
* @return
* @param names - name of sets
* @return values
*/
RFuture<Set<V>> readUnionAsync(String... keys);
RFuture<Set<V>> readUnionAsync(String... names);
/**
* Diff sets specified by name and write to current set.
* If current set already exists, it is overwritten.
*
* @param names
* @return
* @param names - name of sets
* @return size of diff
*/
RFuture<Integer> diffAsync(String... keys);
RFuture<Integer> diffAsync(String... names);
/**
* Diff sets specified by name with current set.
* Without current set state change.
*
* @param names
* @return
*
* @param names - name of sets
* @return values
*/
RFuture<Set<V>> readDiffAsync(String... keys);
RFuture<Set<V>> readDiffAsync(String... names);
/**
* Intersection sets specified by name and write to current set.
* If current set already exists, it is overwritten.
*
* @param names
* @return
* @param names - name of sets
* @return size of intersection
*/
RFuture<Integer> intersectionAsync(String... keys);
RFuture<Integer> intersectionAsync(String... names);
/**
* Intersection sets specified by name with current set.
* Without current set state change.
*
* @param names
* @return
*
* @param names - name of sets
* @return values
*/
RFuture<Set<V>> readIntersectionAsync(String... keys);
RFuture<Set<V>> readIntersectionAsync(String... names);
}

@ -29,11 +29,10 @@ import java.util.concurrent.TimeUnit;
* In addition there is {@link org.redisson.EvictionScheduler}. This scheduler
* deletes expired entries in time interval between 5 seconds to 2 hours.</p>
*
* <p>If eviction is not required then it's better to use {@link org.redisson.reactive.RedissonSet}.</p>
* <p>If eviction is not required then it's better to use {@link org.redisson.api.RSet}.</p>
*
* @author Nikita Koksharov
*
* @param <K> key
* @param <V> value
*/
public interface RSetCache<V> extends Set<V>, RExpirable, RSetCacheAsync<V> {
@ -42,11 +41,10 @@ public interface RSetCache<V> extends Set<V>, RExpirable, RSetCacheAsync<V> {
* Stores value with specified time to live.
* Value expires after specified time to live.
*
* @param key
* @param value
* @param value to add
* @param ttl - time to live for key\value entry.
* If <code>0</code> then stores infinitely.
* @param unit
* @param unit - time unit
* @return <code>true</code> if value has been added. <code>false</code>
* if value already been in collection.
*/
@ -57,6 +55,7 @@ public interface RSetCache<V> extends Set<V>, RExpirable, RSetCacheAsync<V> {
* This number can reflects expired elements too
* due to non realtime cleanup process.
*
* @return size of set
*/
@Override
int size();
@ -64,7 +63,7 @@ public interface RSetCache<V> extends Set<V>, RExpirable, RSetCacheAsync<V> {
/**
* Read all elements at once
*
* @return
* @return values
*/
Set<V> readAll();

@ -31,11 +31,10 @@ public interface RSetCacheAsync<V> extends RCollectionAsync<V> {
* Stores value with specified time to live.
* Value expires after specified time to live.
*
* @param key
* @param value
* @param value to add
* @param ttl - time to live for key\value entry.
* If <code>0</code> then stores infinitely.
* @param unit
* @param unit - time unit
* @return <code>true</code> if value has been added. <code>false</code>
* if value already been in collection.
*/
@ -46,6 +45,7 @@ public interface RSetCacheAsync<V> extends RCollectionAsync<V> {
* This number can reflects expired elements too
* due to non realtime cleanup process.
*
* @return size of set
*/
@Override
RFuture<Integer> sizeAsync();
@ -53,7 +53,7 @@ public interface RSetCacheAsync<V> extends RCollectionAsync<V> {
/**
* Read all elements at once
*
* @return
* @return values
*/
RFuture<Set<V>> readAllAsync();

@ -32,7 +32,7 @@ public interface RSetReactive<V> extends RCollectionReactive<V> {
* Removes and returns random element from set
* in async mode
*
* @return
* @return value
*/
Publisher<V> removeRandom();
@ -40,7 +40,7 @@ public interface RSetReactive<V> extends RCollectionReactive<V> {
* Returns random element from set
* in async mode
*
* @return
* @return value
*/
Publisher<V> random();
@ -58,8 +58,8 @@ public interface RSetReactive<V> extends RCollectionReactive<V> {
* Union sets specified by name and write to current set.
* If current set already exists, it is overwritten.
*
* @param names
* @return
* @param names - name of sets
* @return size of union
*/
Publisher<Long> union(String... names);
@ -67,8 +67,8 @@ public interface RSetReactive<V> extends RCollectionReactive<V> {
* Union sets specified by name with current set.
* Without current set state change.
*
* @param names
* @return
* @param names - name of sets
* @return size of union
*/
Publisher<Set<V>> readUnion(String... names);
@ -76,8 +76,8 @@ public interface RSetReactive<V> extends RCollectionReactive<V> {
* Diff sets specified by name and write to current set.
* If current set already exists, it is overwritten.
*
* @param names
* @return
* @param names - name of sets
* @return size of diff
*/
Publisher<Long> diff(String... names);
@ -85,8 +85,8 @@ public interface RSetReactive<V> extends RCollectionReactive<V> {
* Intersection sets specified by name and write to current set.
* If current set already exists, it is overwritten.
*
* @param names
* @return
* @param names - name of sets
* @return size of intersection
*/
Publisher<Long> intersection(String... names);
@ -94,8 +94,8 @@ public interface RSetReactive<V> extends RCollectionReactive<V> {
* Intersection sets specified by name with current set.
* Without current set state change.
*
* @param names
* @return
* @param names - name of sets
* @return values
*/
Publisher<Set<V>> readIntersection(String... names);

@ -27,7 +27,7 @@ public interface RSortedSet<V> extends SortedSet<V>, RObject {
/**
* Sets new comparator only if current set is empty
*
* @param comparator
* @param comparator for values
* @return <code>true</code> if new comparator setted
* <code>false</code> otherwise
*/

@ -32,14 +32,14 @@ public interface RTopic<M> extends RTopicAsync<M> {
/**
* Get topic channel names
*
* @return
* @return channel names
*/
List<String> getChannelNames();
/**
* Publish the message to all subscribers of this topic
*
* @param message
* @param message to send
* @return the number of clients that received the message
*/
long publish(M message);
@ -49,7 +49,7 @@ public interface RTopic<M> extends RTopicAsync<M> {
* <code>MessageListener.onMessage</code> is called when any message
* is published on this topic.
*
* @param listener
* @param listener for messages
* @return locally unique listener id
* @see org.redisson.api.listener.MessageListener
*/
@ -58,8 +58,8 @@ public interface RTopic<M> extends RTopicAsync<M> {
/**
* Subscribes to status changes of this topic
*
* @param listener
* @return
* @param listener for messages
* @return listener id
* @see org.redisson.api.listener.StatusListener
*/
int addListener(StatusListener listener);
@ -67,7 +67,7 @@ public interface RTopic<M> extends RTopicAsync<M> {
/**
* Removes the listener by <code>id</code> for listening this topic
*
* @param listenerId
* @param listenerId - listener id
*/
void removeListener(int listenerId);

@ -27,7 +27,7 @@ public interface RTopicAsync<M> {
/**
* Publish the message to all subscribers of this topic asynchronously
*
* @param message
* @param message to send
* @return the <code>RFuture</code> object with number of clients that received the message
*/
RFuture<Long> publishAsync(M message);

@ -35,7 +35,7 @@ public interface RTopicReactive<M> {
/**
* Publish the message to all subscribers of this topic asynchronously
*
* @param message
* @param message to send
* @return the <code>Future</code> object with number of clients that received the message
*/
Publisher<Long> publish(M message);

@ -31,6 +31,7 @@ public interface MessageListener<M> extends EventListener {
/**
* Invokes on every message in topic
*
* @param channel of topic
* @param msg topic message
*/
void onMessage(String channel, M msg);

@ -31,6 +31,8 @@ public interface PatternMessageListener<M> extends EventListener {
/**
* Invokes on every message in topic
*
* @param pattern of channel name
* @param channel of topic
* @param msg topic message
*/
void onMessage(String pattern, String channel, M msg);

@ -30,14 +30,14 @@ public interface StatusListener extends EventListener {
* Executes then Redisson successfully subscribed to channel.
* Invoked during re-connection
*
* @param channel
* @param channel to subscribe
*/
void onSubscribe(String channel);
/**
* Executes then Redisson successfully unsubscribed from channel.
*
* @param channel
* @param channel to unsubscribe
*/
void onUnsubscribe(String channel);

@ -223,7 +223,8 @@ public class RedisConnection implements RedisCommands {
/**
* Access to Netty channel.
* This method is provided to use in debug info only.
*
*
* @return channel
*/
public Channel getChannel() {
return channel;

@ -29,42 +29,42 @@ public interface Codec {
/**
* Returns object decoder used for hash map values in HMAP Redis structure
*
* @return
* @return decoder
*/
Decoder<Object> getMapValueDecoder();
/**
* Returns object encoder used for hash map values in HMAP Redis structure
*
* @return
* @return encoder
*/
Encoder getMapValueEncoder();
/**
* Returns object decoder used for hash map keys in HMAP Redis structure
*
* @return
* @return decoder
*/
Decoder<Object> getMapKeyDecoder();
/**
* Returns object encoder used for hash map keys in HMAP Redis structure
*
* @return
* @return encoder
*/
Encoder getMapKeyEncoder();
/**
* Returns object decoder used for any objects stored Redis structure except HMAP
*
* @return
* @return decoder
*/
Decoder<Object> getValueDecoder();
/**
* Returns object encoder used for any objects stored Redis structure except HMAP
*
* @return
* @return encoder
*/
Encoder getValueEncoder();

@ -21,7 +21,7 @@ import com.fasterxml.jackson.dataformat.cbor.CBORFactory;
/**
*
* @author Faye Li
* @date 2015-10-16
*
*/
public class CborJacksonCodec extends JsonJacksonCodec {

@ -30,8 +30,8 @@ import net.jpountz.lz4.LZ4SafeDecompressor;
/**
* LZ4 compression codec.
* Uses inner <code>Codec</codec> to convert object to binary stream.
* <codec>FstCodec</codec> used by default.
* Uses inner <code>Codec</code> to convert object to binary stream.
* <code>FstCodec</code> used by default.
*
* https://github.com/jpountz/lz4-java
*

@ -28,8 +28,8 @@ import io.netty.buffer.Unpooled;
/**
* Snappy compression codec.
* Uses inner <code>Codec</codec> to convert object to binary stream.
* <codec>FstCodec</codec> used by default.
* Uses inner <code>Codec</code> to convert object to binary stream.
* <code>FstCodec</code> used by default.
*
* https://github.com/xerial/snappy-java
*

@ -15,6 +15,12 @@
*/
package org.redisson.config;
/**
*
* @author Nikita Koksharov
*
* @param <T> config type
*/
class BaseConfig<T extends BaseConfig<T>> {
/**
@ -106,7 +112,8 @@ class BaseConfig<T extends BaseConfig<T>> {
* Subscriptions per Redis connection limit
* Default is 5
*
* @param subscriptionsPerConnection
* @param subscriptionsPerConnection amount
* @return config
*/
public T setSubscriptionsPerConnection(int subscriptionsPerConnection) {
this.subscriptionsPerConnection = subscriptionsPerConnection;
@ -121,7 +128,8 @@ class BaseConfig<T extends BaseConfig<T>> {
* Password for Redis authentication. Should be null if not needed
* Default is <code>null</code>
*
* @param password
* @param password for connection
* @return config
*/
public T setPassword(String password) {
this.password = password;
@ -139,7 +147,8 @@ class BaseConfig<T extends BaseConfig<T>> {
* Default is <code>3</code> attempts
*
* @see #timeout
* @param retryAttempts
* @param retryAttempts - retry attempts
* @return config
*/
public T setRetryAttempts(int retryAttempts) {
this.retryAttempts = retryAttempts;
@ -157,6 +166,7 @@ class BaseConfig<T extends BaseConfig<T>> {
*
* @see retryAttempts
* @param retryInterval - time in milliseconds
* @return config
*/
public T setRetryInterval(int retryInterval) {
this.retryInterval = retryInterval;
@ -173,6 +183,7 @@ class BaseConfig<T extends BaseConfig<T>> {
* Default is <code>3000</code> milliseconds
*
* @param timeout in milliseconds
* @return config
*/
public T setTimeout(int timeout) {
this.timeout = timeout;
@ -187,7 +198,8 @@ class BaseConfig<T extends BaseConfig<T>> {
* Setup connection name during connection init
* via CLIENT SETNAME command
*
* @param name
* @param clientName - name of client
* @return config
*/
public T setClientName(String clientName) {
this.clientName = clientName;
@ -199,9 +211,10 @@ class BaseConfig<T extends BaseConfig<T>> {
}
/**
* Ping timeout used in <code>Node.ping</code> and <code>Node.pingAll<code> operation
* Ping timeout used in <code>Node.ping</code> and <code>Node.pingAll</code> operation
*
* @param ping timeout in milliseconds
* @param pingTimeout - timeout in milliseconds
* @return config
*/
public T setPingTimeout(int pingTimeout) {
this.pingTimeout = pingTimeout;
@ -218,7 +231,7 @@ class BaseConfig<T extends BaseConfig<T>> {
* Default is <code>10000</code> milliseconds.
*
* @param connectTimeout - timeout in milliseconds
* @return
* @return config
*/
public T setConnectTimeout(int connectTimeout) {
this.connectTimeout = connectTimeout;
@ -235,7 +248,7 @@ class BaseConfig<T extends BaseConfig<T>> {
* then it will closed and removed from pool.
*
* @param idleConnectionTimeout - timeout in milliseconds
* @return
* @return config
*/
public T setIdleConnectionTimeout(int idleConnectionTimeout) {
this.idleConnectionTimeout = idleConnectionTimeout;
@ -257,6 +270,8 @@ class BaseConfig<T extends BaseConfig<T>> {
*
* @see #failedAttempts
*
* @param slaveRetryTimeout - retry timeout in milliseconds
* @return config
*/
public T setReconnectionTimeout(int slaveRetryTimeout) {
@ -275,6 +290,8 @@ class BaseConfig<T extends BaseConfig<T>> {
* <p>
* Default is 3
*
* @param slaveFailedAttempts - attempts
* @return config
*/
public T setFailedAttempts(int slaveFailedAttempts) {
this.failedAttempts = slaveFailedAttempts;

@ -18,6 +18,12 @@ package org.redisson.config;
import org.redisson.connection.balancer.LoadBalancer;
import org.redisson.connection.balancer.RoundRobinLoadBalancer;
/**
*
* @author Nikita Koksharov
*
* @param <T> config type
*/
public class BaseMasterSlaveServersConfig<T extends BaseMasterSlaveServersConfig<T>> extends BaseConfig<T> {
/**
@ -79,8 +85,8 @@ public class BaseMasterSlaveServersConfig<T extends BaseMasterSlaveServersConfig
* <p>
* @see #setSlaveConnectionMinimumIdleSize(int)
*
* @param slaveConnectionPoolSize
* @return
* @param slaveConnectionPoolSize - size of pool
* @return config
*/
public T setSlaveConnectionPoolSize(int slaveConnectionPoolSize) {
this.slaveConnectionPoolSize = slaveConnectionPoolSize;
@ -96,6 +102,9 @@ public class BaseMasterSlaveServersConfig<T extends BaseMasterSlaveServersConfig
* Default is <code>250</code>
*
* @see #setMasterConnectionMinimumIdleSize(int)
*
* @param masterConnectionPoolSize - pool size
* @return config
*
*/
public T setMasterConnectionPoolSize(int masterConnectionPoolSize) {
@ -110,11 +119,12 @@ public class BaseMasterSlaveServersConfig<T extends BaseMasterSlaveServersConfig
* Сonnection load balancer to multiple Redis slave servers.
* Uses Round-robin algorithm by default
*
* @param loadBalancer
* @return
* @param loadBalancer object
* @return config
*
* @see org.redisson.connection.balancer.RandomLoadBalancer
* @see org.redisson.connection.balancer.RoundRobinLoadBalancer
* @see org.redisson.connection.BaseLoadBalancer
* @see org.redisson.connection.balancer.WeightedRoundRobinBalancer
*/
public T setLoadBalancer(LoadBalancer loadBalancer) {
this.loadBalancer = loadBalancer;
@ -130,7 +140,9 @@ public class BaseMasterSlaveServersConfig<T extends BaseMasterSlaveServersConfig
* Default is <code>50</code>
* <p>
* @see #setSlaveSubscriptionConnectionMinimumIdleSize(int)
*
*
* @param slaveSubscriptionConnectionPoolSize - pool size
* @return config
*/
public T setSlaveSubscriptionConnectionPoolSize(int slaveSubscriptionConnectionPoolSize) {
this.slaveSubscriptionConnectionPoolSize = slaveSubscriptionConnectionPoolSize;
@ -146,7 +158,9 @@ public class BaseMasterSlaveServersConfig<T extends BaseMasterSlaveServersConfig
* Default is <code>5</code>
* <p>
* @see #setSlaveConnectionPoolSize(int)
*
*
* @param slaveConnectionMinimumIdleSize - pool size
* @return config
*/
public T setSlaveConnectionMinimumIdleSize(int slaveConnectionMinimumIdleSize) {
this.slaveConnectionMinimumIdleSize = slaveConnectionMinimumIdleSize;
@ -162,7 +176,9 @@ public class BaseMasterSlaveServersConfig<T extends BaseMasterSlaveServersConfig
* Default is <code>5</code>
* <p>
* @see #setMasterConnectionPoolSize(int)
*
*
* @param masterConnectionMinimumIdleSize - pool size
* @return config
*/
public T setMasterConnectionMinimumIdleSize(int masterConnectionMinimumIdleSize) {
this.masterConnectionMinimumIdleSize = masterConnectionMinimumIdleSize;
@ -178,7 +194,9 @@ public class BaseMasterSlaveServersConfig<T extends BaseMasterSlaveServersConfig
* Default is <code>1</code>
* <p>
* @see #setSlaveSubscriptionConnectionPoolSize(int)
*
*
* @param slaveSubscriptionConnectionMinimumIdleSize - pool size
* @return config
*/
public T setSlaveSubscriptionConnectionMinimumIdleSize(int slaveSubscriptionConnectionMinimumIdleSize) {
this.slaveSubscriptionConnectionMinimumIdleSize = slaveSubscriptionConnectionMinimumIdleSize;
@ -193,8 +211,8 @@ public class BaseMasterSlaveServersConfig<T extends BaseMasterSlaveServersConfig
* <p>
* Default is <code>SLAVE</code>
*
* @param readMode
* @return
* @param readMode param
* @return config
*/
public T setReadMode(ReadMode readMode) {
this.readMode = readMode;

@ -46,7 +46,7 @@ public class ClusterServersConfig extends BaseMasterSlaveServersConfig<ClusterSe
* Add Redis cluster node address. Use follow format -- <code>host:port</code>
*
* @param addresses in <code>host:port</code> format
* @return
* @return config
*/
public ClusterServersConfig addNodeAddress(String ... addresses) {
for (String address : addresses) {
@ -68,7 +68,7 @@ public class ClusterServersConfig extends BaseMasterSlaveServersConfig<ClusterSe
* Redis cluster scan interval in milliseconds
*
* @param scanInterval in milliseconds
* @return
* @return config
*/
public ClusterServersConfig setScanInterval(int scanInterval) {
this.scanInterval = scanInterval;

@ -20,18 +20,17 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.net.URL;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import org.redisson.client.codec.Codec;
import org.redisson.codec.JsonJacksonCodec;
import io.netty.channel.EventLoopGroup;
import org.redisson.codec.CodecProvider;
import org.redisson.codec.DefaultCodecProvider;
import org.redisson.codec.JsonJacksonCodec;
import org.redisson.liveobject.provider.DefaultResolverProvider;
import org.redisson.liveobject.provider.ResolverProvider;
import io.netty.channel.EventLoopGroup;
/**
* Redisson configuration
*
@ -125,6 +124,9 @@ public class Config {
* Redis key/value codec. Default is json-codec
*
* @see org.redisson.client.codec.Codec
*
* @param codec object
* @return config
*/
public Config setCodec(Codec codec) {
this.codec = codec;
@ -138,8 +140,8 @@ public class Config {
/**
* For codec registry and look up. DefaultCodecProvider used by default.
*
* @param codecProvider
* @return this
* @param codecProvider object
* @return config
* @see org.redisson.codec.CodecProvider
*/
public Config setCodecProvider(CodecProvider codecProvider) {
@ -159,7 +161,7 @@ public class Config {
/**
* For resolver registry and look up. DefaultResolverProvider used by default.
*
* @param resolverProvider
* @param resolverProvider object
* @return this
*/
public Config setResolverProvider(ResolverProvider resolverProvider) {
@ -178,9 +180,10 @@ public class Config {
/**
* Config option indicate whether Redisson Reference feature is enabled.
* Default value is TRUE
* <p>
* Default value is <code>true</code>
*
* @return boolean
* @return <code>true</code> if Redisson Reference feature enabled
*/
public boolean isRedissonReferenceEnabled() {
return redissonReferenceEnabled;
@ -188,8 +191,10 @@ public class Config {
/**
* Config option for enabling Redisson Reference feature
* Default value is TRUE
* @param redissonReferenceEnabled
* <p>
* Default value is <code>true</code>
*
* @param redissonReferenceEnabled flag
*/
public void setRedissonReferenceEnabled(boolean redissonReferenceEnabled) {
this.redissonReferenceEnabled = redissonReferenceEnabled;
@ -198,7 +203,7 @@ public class Config {
/**
* Init cluster servers configuration
*
* @return
* @return config
*/
public ClusterServersConfig useClusterServers() {
return useClusterServers(new ClusterServersConfig());
@ -227,7 +232,7 @@ public class Config {
/**
* Init AWS Elasticache servers configuration.
*
* @return
* @return ElasticacheServersConfig
*/
public ElasticacheServersConfig useElasticacheServers() {
return useElasticacheServers(new ElasticacheServersConfig());
@ -256,7 +261,7 @@ public class Config {
/**
* Init single server configuration.
*
* @return
* @return SingleServerConfig
*/
public SingleServerConfig useSingleServer() {
return useSingleServer(new SingleServerConfig());
@ -285,18 +290,13 @@ public class Config {
/**
* Init sentinel servers configuration.
*
* @return
* @return SentinelServersConfig
*/
public SentinelServersConfig useSentinelServers() {
return useSentinelServers(new SentinelServersConfig());
}
/**
* Init sentinel servers configuration by config object.
*
* @return
*/
public SentinelServersConfig useSentinelServers(SentinelServersConfig sentinelServersConfig) {
SentinelServersConfig useSentinelServers(SentinelServersConfig sentinelServersConfig) {
checkClusterServersConfig();
checkSingleServerConfig();
checkMasterSlaveServersConfig();
@ -319,18 +319,13 @@ public class Config {
/**
* Init master/slave servers configuration.
*
* @return
* @return MasterSlaveServersConfig
*/
public MasterSlaveServersConfig useMasterSlaveServers() {
return useMasterSlaveServers(new MasterSlaveServersConfig());
}
/**
* Init master/slave servers configuration by config object.
*
* @return
*/
public MasterSlaveServersConfig useMasterSlaveServers(MasterSlaveServersConfig config) {
MasterSlaveServersConfig useMasterSlaveServers(MasterSlaveServersConfig config) {
checkClusterServersConfig();
checkSingleServerConfig();
checkSentinelServersConfig();
@ -367,8 +362,8 @@ public class Config {
* <p>
* <code>0</code> means <code>current_processors_amount * 2</code>
*
* @param threads
* @return
* @param threads amount
* @return config
*/
public Config setThreads(int threads) {
this.threads = threads;
@ -410,8 +405,8 @@ public class Config {
* Also used for epoll transport activation.
* <b>netty-transport-native-epoll</b> library should be in classpath
*
* @param useLinuxNativeEpoll
* @return
* @param useLinuxNativeEpoll flag
* @return config
*/
public Config setUseLinuxNativeEpoll(boolean useLinuxNativeEpoll) {
this.useLinuxNativeEpoll = useLinuxNativeEpoll;
@ -429,8 +424,8 @@ public class Config {
* <p>
* <code>0</code> means <code>current_processors_amount * 2</code>
*
* @param nettyThreads
* @return
* @param nettyThreads amount
* @return config
*/
public Config setNettyThreads(int nettyThreads) {
this.nettyThreads = nettyThreads;
@ -447,8 +442,8 @@ public class Config {
* <code>RRemoteService</code> invocation handlers
* and <code>RExecutorService</code> tasks.
*
* @param executor
* @return
* @param executor object
* @return config
*/
public Config setExecutor(ExecutorService executor) {
this.executor = executor;
@ -469,8 +464,8 @@ public class Config {
* Only {@link io.netty.channel.epoll.EpollEventLoopGroup} or
* {@link io.netty.channel.nio.NioEventLoopGroup} can be used.
*
* @param eventLoopGroup
* @return
* @param eventLoopGroup object
* @return config
*/
public Config setEventLoopGroup(EventLoopGroup eventLoopGroup) {
this.eventLoopGroup = eventLoopGroup;
@ -484,9 +479,9 @@ public class Config {
/**
* Read config object stored in JSON format from <code>String</code>
*
* @param content
* @return
* @throws IOException
* @param content of config
* @return config
* @throws IOException error
*/
public static Config fromJSON(String content) throws IOException {
ConfigSupport support = new ConfigSupport();
@ -496,9 +491,9 @@ public class Config {
/**
* Read config object stored in JSON format from <code>InputStream</code>
*
* @param inputStream
* @return
* @throws IOException
* @param inputStream object
* @return config
* @throws IOException error
*/
public static Config fromJSON(InputStream inputStream) throws IOException {
ConfigSupport support = new ConfigSupport();
@ -508,9 +503,9 @@ public class Config {
/**
* Read config object stored in JSON format from <code>File</code>
*
* @param file
* @return
* @throws IOException
* @param file object
* @return config
* @throws IOException error
*/
public static Config fromJSON(File file) throws IOException {
ConfigSupport support = new ConfigSupport();
@ -520,9 +515,9 @@ public class Config {
/**
* Read config object stored in JSON format from <code>URL</code>
*
* @param url
* @return
* @throws IOException
* @param url object
* @return config
* @throws IOException error
*/
public static Config fromJSON(URL url) throws IOException {
ConfigSupport support = new ConfigSupport();
@ -532,9 +527,9 @@ public class Config {
/**
* Read config object stored in JSON format from <code>Reader</code>
*
* @param reader
* @return
* @throws IOException
* @param reader object
* @return config
* @throws IOException error
*/
public static Config fromJSON(Reader reader) throws IOException {
ConfigSupport support = new ConfigSupport();
@ -544,8 +539,8 @@ public class Config {
/**
* Convert current configuration to JSON format
*
* @return
* @throws IOException
* @return config in json format
* @throws IOException error
*/
public String toJSON() throws IOException {
ConfigSupport support = new ConfigSupport();
@ -555,9 +550,9 @@ public class Config {
/**
* Read config object stored in YAML format from <code>String</code>
*
* @param content
* @return
* @throws IOException
* @param content of config
* @return config
* @throws IOException error
*/
public static Config fromYAML(String content) throws IOException {
ConfigSupport support = new ConfigSupport();
@ -567,9 +562,9 @@ public class Config {
/**
* Read config object stored in YAML format from <code>InputStream</code>
*
* @param inputStream
* @return
* @throws IOException
* @param inputStream object
* @return config
* @throws IOException error
*/
public static Config fromYAML(InputStream inputStream) throws IOException {
ConfigSupport support = new ConfigSupport();
@ -579,9 +574,9 @@ public class Config {
/**
* Read config object stored in YAML format from <code>File</code>
*
* @param file
* @return
* @throws IOException
* @param file object
* @return config
* @throws IOException error
*/
public static Config fromYAML(File file) throws IOException {
ConfigSupport support = new ConfigSupport();
@ -591,9 +586,9 @@ public class Config {
/**
* Read config object stored in YAML format from <code>URL</code>
*
* @param url
* @return
* @throws IOException
* @param url object
* @return config
* @throws IOException error
*/
public static Config fromYAML(URL url) throws IOException {
ConfigSupport support = new ConfigSupport();
@ -603,9 +598,9 @@ public class Config {
/**
* Read config object stored in YAML format from <code>Reader</code>
*
* @param reader
* @return
* @throws IOException
* @param reader object
* @return config
* @throws IOException error
*/
public static Config fromYAML(Reader reader) throws IOException {
ConfigSupport support = new ConfigSupport();
@ -615,8 +610,8 @@ public class Config {
/**
* Convert current configuration to YAML format
*
* @return
* @throws IOException
* @return config in yaml format
* @throws IOException error
*/
public String toYAML() throws IOException {
ConfigSupport support = new ConfigSupport();

@ -58,7 +58,7 @@ public class ElasticacheServersConfig extends BaseMasterSlaveServersConfig<Elast
* Add Redis cluster node address. Use follow format -- <code>host:port</code>
*
* @param addresses in <code>host:port</code> format
* @return
* @return config
*/
public ElasticacheServersConfig addNodeAddress(String ... addresses) {
for (String address : addresses) {
@ -80,7 +80,7 @@ public class ElasticacheServersConfig extends BaseMasterSlaveServersConfig<Elast
* Elasticache node scan interval in milliseconds
*
* @param scanInterval in milliseconds
* @return
* @return config
*/
public ElasticacheServersConfig setScanInterval(int scanInterval) {
this.scanInterval = scanInterval;
@ -91,7 +91,8 @@ public class ElasticacheServersConfig extends BaseMasterSlaveServersConfig<Elast
* Database index used for Redis connection
* Default is <code>0</code>
*
* @param database
* @param database number
* @return config
*/
public ElasticacheServersConfig setDatabase(int database) {
this.database = database;

@ -54,7 +54,8 @@ public class MasterSlaveServersConfig extends BaseMasterSlaveServersConfig<Maste
/**
* Set Redis master server address. Use follow format -- host:port
*
* @param masterAddress
* @param masterAddress of Redis
* @return config
*/
public MasterSlaveServersConfig setMasterAddress(String masterAddress) {
if (masterAddress != null) {
@ -77,11 +78,11 @@ public class MasterSlaveServersConfig extends BaseMasterSlaveServersConfig<Maste
/**
* Add Redis slave server address. Use follow format -- host:port
*
* @param addresses
* @return
* @param addresses of Redis
* @return config
*/
public MasterSlaveServersConfig addSlaveAddress(String ... sAddresses) {
for (String address : sAddresses) {
public MasterSlaveServersConfig addSlaveAddress(String ... addresses) {
for (String address : addresses) {
slaveAddresses.add(URIBuilder.create(address));
}
return this;
@ -101,7 +102,8 @@ public class MasterSlaveServersConfig extends BaseMasterSlaveServersConfig<Maste
* Database index used for Redis connection
* Default is <code>0</code>
*
* @param database
* @param database number
* @return config
*/
public MasterSlaveServersConfig setDatabase(int database) {
this.database = database;

@ -49,8 +49,8 @@ public class RedissonNodeConfig extends Config {
/**
* Executor service workers amount per service name
*
* @param workers
* @return
* @param workers mapping
* @return config
*/
public RedissonNodeConfig setExecutorServiceWorkers(Map<String, Integer> workers) {
this.executorServiceWorkers = workers;
@ -67,8 +67,8 @@ public class RedissonNodeConfig extends Config {
/**
* Redisson node initializer
*
* @param redissonNodeInitializer
* @return
* @param redissonNodeInitializer object
* @return config
*/
public RedissonNodeConfig setRedissonNodeInitializer(RedissonNodeInitializer redissonNodeInitializer) {
this.redissonNodeInitializer = redissonNodeInitializer;
@ -78,9 +78,9 @@ public class RedissonNodeConfig extends Config {
/**
* Read config object stored in JSON format from <code>File</code>
*
* @param file
* @return
* @throws IOException
* @param file object
* @return config
* @throws IOException error
*/
public static RedissonNodeConfig fromJSON(File file) throws IOException {
ConfigSupport support = new ConfigSupport();
@ -90,9 +90,9 @@ public class RedissonNodeConfig extends Config {
/**
* Read config object stored in YAML format from <code>File</code>
*
* @param file
* @return
* @throws IOException
* @param file object
* @return config
* @throws IOException error
*/
public static RedissonNodeConfig fromYAML(File file) throws IOException {
ConfigSupport support = new ConfigSupport();

@ -45,8 +45,8 @@ public class SentinelServersConfig extends BaseMasterSlaveServersConfig<Sentinel
/**
* Master server name used by Redis Sentinel servers and master change monitoring task.
*
* @param masterName
* @return
* @param masterName of Redis
* @return config
*/
public SentinelServersConfig setMasterName(String masterName) {
this.masterName = masterName;
@ -59,8 +59,8 @@ public class SentinelServersConfig extends BaseMasterSlaveServersConfig<Sentinel
/**
* Add Redis Sentinel node address in host:port format. Multiple nodes at once could be added.
*
* @param addresses
* @return
* @param addresses of Redis
* @return config
*/
public SentinelServersConfig addSentinelAddress(String ... addresses) {
for (String address : addresses) {
@ -79,7 +79,8 @@ public class SentinelServersConfig extends BaseMasterSlaveServersConfig<Sentinel
* Database index used for Redis connection
* Default is <code>0</code>
*
* @param database
* @param database number
* @return config
*/
public SentinelServersConfig setDatabase(int database) {
this.database = database;

@ -21,6 +21,11 @@ import java.util.List;
import org.redisson.misc.URIBuilder;
/**
*
* @author Nikita Koksharov
*
*/
public class SingleServerConfig extends BaseConfig<SingleServerConfig> {
/**
@ -86,9 +91,11 @@ public class SingleServerConfig extends BaseConfig<SingleServerConfig> {
/**
* Redis connection pool size
* Default is 250
* <p>
* Default is <code>250</code>
*
* @param connectionPoolSize
* @param connectionPoolSize - pool size
* @return config
*/
public SingleServerConfig setConnectionPoolSize(int connectionPoolSize) {
this.connectionPoolSize = connectionPoolSize;
@ -100,10 +107,11 @@ public class SingleServerConfig extends BaseConfig<SingleServerConfig> {
/**
* Redis subscription-connection pool size limit
* <p>
* Default is 50
*
* @param connectionPoolSize
* @return
* @param subscriptionConnectionPoolSize - pool size
* @return config
*/
public SingleServerConfig setSubscriptionConnectionPoolSize(int subscriptionConnectionPoolSize) {
this.subscriptionConnectionPoolSize = subscriptionConnectionPoolSize;
@ -116,7 +124,8 @@ public class SingleServerConfig extends BaseConfig<SingleServerConfig> {
/**
* Set server address. Use follow format -- host:port
*
* @param address
* @param address of Redis
* @return config
*/
public SingleServerConfig setAddress(String address) {
if (address != null) {
@ -141,8 +150,8 @@ public class SingleServerConfig extends BaseConfig<SingleServerConfig> {
*
* Default is false
*
* @param dnsMonitoring
* @return
* @param dnsMonitoring flag
* @return config
*/
public SingleServerConfig setDnsMonitoring(boolean dnsMonitoring) {
this.dnsMonitoring = dnsMonitoring;
@ -157,8 +166,8 @@ public class SingleServerConfig extends BaseConfig<SingleServerConfig> {
*
* Default is 5000
*
* @param dnsMonitoringInterval
* @return
* @param dnsMonitoringInterval time
* @return config
*/
public SingleServerConfig setDnsMonitoringInterval(long dnsMonitoringInterval) {
this.dnsMonitoringInterval = dnsMonitoringInterval;
@ -170,8 +179,11 @@ public class SingleServerConfig extends BaseConfig<SingleServerConfig> {
/**
* Minimum idle subscription connection amount.
*
* <p>
* Default is 1
*
* @param subscriptionConnectionMinimumIdleSize - connections amount
* @return config
*
*/
public SingleServerConfig setSubscriptionConnectionMinimumIdleSize(int subscriptionConnectionMinimumIdleSize) {
@ -184,9 +196,11 @@ public class SingleServerConfig extends BaseConfig<SingleServerConfig> {
/**
* Minimum idle Redis connection amount.
*
* <p>
* Default is 5
*
* @param connectionMinimumIdleSize - connections amount
* @return config
*/
public SingleServerConfig setConnectionMinimumIdleSize(int connectionMinimumIdleSize) {
this.connectionMinimumIdleSize = connectionMinimumIdleSize;
@ -200,7 +214,8 @@ public class SingleServerConfig extends BaseConfig<SingleServerConfig> {
* Database index used for Redis connection
* Default is <code>0</code>
*
* @param database
* @param database index
* @return config
*/
public SingleServerConfig setDatabase(int database) {
this.database = database;

@ -46,12 +46,6 @@ public class CRC16 {
private CRC16() {
}
/**
* Create a CRC16 checksum from the bytes.
*
* @param bytes
* @return CRC16 as interger value
*/
public static int crc16(byte[] bytes) {
int crc = 0x0000;

@ -312,7 +312,9 @@ public class MasterSlaveEntry {
* Freeze slave with <code>host:port</code> from slaves list.
* Re-attach pub/sub listeners from it to other slave.
* Shutdown old master client.
*
*
* @param host of Redis
* @param port of Redis
*/
public void changeMaster(String host, int port) {
ClientConnectionsEntry oldMaster = masterEntry;

@ -21,6 +21,11 @@ import java.util.Random;
import org.redisson.connection.ClientConnectionsEntry;
/**
*
* @author Nikita Koksharov
*
*/
public class RandomLoadBalancer implements LoadBalancer {
private final Random random = new SecureRandom();

@ -20,6 +20,11 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.redisson.connection.ClientConnectionsEntry;
/**
*
* @author Nikita Koksharov
*
*/
public class RoundRobinLoadBalancer implements LoadBalancer {
private final AtomicInteger index = new AtomicInteger(-1);

@ -117,9 +117,6 @@ public final class CronExpression implements Serializable, Cloneable {
*
* @param cronExpression String representation of the cron expression the
* new object should represent
* @throws java.text.ParseException
* if the string expression cannot be parsed into a valid
* <CODE>CronExpression</CODE>
*/
public CronExpression(String cronExpression) {
if (cronExpression == null) {
@ -235,6 +232,8 @@ public final class CronExpression implements Serializable, Cloneable {
/**
* Returns the time zone for which this <code>CronExpression</code>
* will be resolved.
*
* @return time zone
*/
public TimeZone getTimeZone() {
if (timeZone == null) {
@ -247,6 +246,8 @@ public final class CronExpression implements Serializable, Cloneable {
/**
* Sets the time zone for which this <code>CronExpression</code>
* will be resolved.
*
* @param timeZone object
*/
public void setTimeZone(TimeZone timeZone) {
this.timeZone = timeZone;
@ -1434,19 +1435,11 @@ public final class CronExpression implements Serializable, Cloneable {
}
}
/**
* NOT YET IMPLEMENTED: Returns the time before the given time
* that the <code>CronExpression</code> matches.
*/
public Date getTimeBefore(Date endTime) {
// FUTURE_TODO: implement QUARTZ-423
return null;
}
/**
* NOT YET IMPLEMENTED: Returns the final time that the
* <code>CronExpression</code> will match.
*/
public Date getFinalFireTime() {
// FUTURE_TODO: implement QUARTZ-423
return null;

@ -25,7 +25,7 @@ import org.redisson.misc.PromiseDelegator;
*
* @author Nikita Koksharov
*
* @param <V>
* @param <V> value
*/
public class RedissonScheduledFuture<V> extends PromiseDelegator<V> implements RScheduledFuture<V> {

@ -60,6 +60,12 @@ public class ClassUtils {
* findConstructor() method and has the similar limitations that it doesn't
* do a real widening scope search and simply processes the methods in
* order.
*
* @param type param
* @param name of class
* @param parms classes
*
* @return Method object
*/
public static Method searchForMethod(Class type, String name, Class[] parms) {
try {
@ -107,6 +113,9 @@ public class ClassUtils {
* If this specified class represents a primitive type (int, float, etc.)
* then it is translated into its wrapper type (Integer, Float, etc.). If
* the passed class is not a primitive then it is just returned.
*
* @param primitive class
* @return class
*/
private static Class<?> translateFromPrimitive(Class<?> primitive) {
if (!primitive.isPrimitive()) {

@ -40,9 +40,9 @@ public interface ResolverProvider {
* To register a resolver based on the the class it can provide value to,
* the resolver type, the resolver instance to be cached.
*
* @param cls
* @param resolverClass
* @param resolver
* @param cls object
* @param resolverClass object
* @param resolver object
*/
void registerResolver(Class<?> cls, Class<? extends Resolver> resolverClass, Resolver resolver);

@ -32,7 +32,7 @@ public interface RIdResolver<A extends RId, V> extends Resolver<Class, A, V>{
*
* @param cls the class of the LiveObject.
* @param annotation the RId annotation used in the class.
* @param redisson
* @param redisson instance
* @return resolved RId field value.
*/
public V resolve(Class cls, A annotation, String idFieldName, RedissonClient redisson);

@ -34,10 +34,10 @@ public interface Resolver<T, A extends Annotation, V> {
*
* Actual behavior may vary depending on implementation
*
* @param value
* @param annotation
* @param idFieldName
* @param redisson
* @param value object
* @param annotation object
* @param idFieldName name of field
* @param redisson instance
* @return resolved value
*/
public V resolve(T value, A annotation, String idFieldName, RedissonClient redisson);

@ -32,8 +32,8 @@ import io.netty.util.internal.PlatformDependent;
*
* @author Nikita Koksharov
*
* @param <K>
* @param <V>
* @param <K> key
* @param <V> value
*/
public abstract class AbstractCacheMap<K, V> implements Cache<K, V> {

@ -25,8 +25,8 @@ import java.util.Set;
* This is not a concurrent map.
*
* @author Rui Gu (https://github.com/jackygurui)
* @param <K>
* @param <V>
* @param <K> key
* @param <V> value
*/
public class BiHashMap<K, V> implements Map<K, V> {

@ -22,8 +22,8 @@ import java.util.concurrent.TimeUnit;
*
* @author Nikita Koksharov
*
* @param <K>
* @param <V>
* @param <K> key
* @param <V> valu
*/
public interface Cache<K, V> extends Map<K, V> {

@ -25,8 +25,8 @@ import java.util.concurrent.atomic.AtomicLong;
*
* @author Nikita Koksharov
*
* @param <K>
* @param <V>
* @param <K> key
* @param <V> value
*/
public class LFUCacheMap<K, V> extends AbstractCacheMap<K, V> {

@ -23,8 +23,8 @@ import java.util.concurrent.ConcurrentLinkedQueue;
*
* @author Nikita Koksharov
*
* @param <K>
* @param <V>
* @param <K> key
* @param <V> value
*/
public class LRUCacheMap<K, V> extends AbstractCacheMap<K, V> {

@ -19,8 +19,8 @@ package org.redisson.misc;
*
* @author Nikita Koksharov
*
* @param <K>
* @param <V>
* @param <K> key
* @param <V> value
*/
public class NoneCacheMap<K, V> extends AbstractCacheMap<K, V> {

@ -24,14 +24,15 @@ import io.netty.util.concurrent.Promise;
*
* @author Nikita Koksharov
*
* @param <T>
* @param <T> type
*/
public interface RPromise<T> extends RFuture<T> {
/**
* Marks this future as a success and notifies all
* listeners.
*
*
* @param result object
* @return {@code true} if and only if successfully marked this future as
* a success. Otherwise {@code false} because this future is
* already marked as either a success or a failure.
@ -41,7 +42,8 @@ public interface RPromise<T> extends RFuture<T> {
/**
* Marks this future as a failure and notifies all
* listeners.
*
*
* @param cause object
* @return {@code true} if and only if successfully marked this future as
* a failure. Otherwise {@code false} because this future is
* already marked as either a success or a failure.

@ -29,7 +29,7 @@ import io.netty.util.concurrent.Promise;
*
* @author Nikita Koksharov
*
* @param <T>
* @param <T> type of object
*/
public class RedissonPromise<T> implements RPromise<T> {

@ -24,7 +24,7 @@ import io.netty.util.concurrent.FutureListener;
*
* @author Nikita Koksharov
*
* @param <T>
* @param <T> type
*/
public class TransferListener<T> implements FutureListener<T> {

@ -34,7 +34,7 @@ import org.redisson.command.CommandReactiveExecutor;
/**
* <p>Set-based cache with ability to set TTL for each entry via
* {@link #put(Object, Object, long, TimeUnit)} method.
* {@link #add(Object, long, TimeUnit)} method.
* And therefore has an complex lua-scripts inside.
* Uses map(value_hash, value) to tie with sorted set which contains expiration record for every value with TTL.
* </p>
@ -46,11 +46,10 @@ import org.redisson.command.CommandReactiveExecutor;
* In addition there is {@link org.redisson.EvictionScheduler}. This scheduler
* deletes expired entries in time interval between 5 seconds to 2 hours.</p>
*
* <p>If eviction is not required then it's better to use {@link org.redisson.reactive.RedissonSet}.</p>
* <p>If eviction is not required then it's better to use {@link org.redisson.api.RSet}.</p>
*
* @author Nikita Koksharov
*
* @param <K> key
* @param <V> value
*/
public class RedissonSetCacheReactive<V> extends RedissonExpirableReactive implements RSetCacheReactive<V> {

@ -47,10 +47,7 @@ public class CacheConfig {
*
* @param ttl - time to live for key\value entry in milliseconds.
* If <code>0</code> then time to live doesn't affect entry expiration.
* @param ttlUnit
* @param maxIdleTime - max idle time for key\value entry in milliseconds.
* If <code>0</code> then max idle time doesn't affect entry expiration.
* @param maxIdleUnit
* <p>
* if <code>maxIdleTime</code> and <code>ttl</code> params are equal to <code>0</code>
* then entry stores infinitely.
@ -92,9 +89,9 @@ public class CacheConfig {
/**
* Read config objects stored in JSON format from <code>String</code>
*
* @param content
* @return
* @throws IOException
* @param content of config
* @return config
* @throws IOException error
*/
public static Map<String, CacheConfig> fromJSON(String content) throws IOException {
return new CacheConfigSupport().fromJSON(content);
@ -103,9 +100,9 @@ public class CacheConfig {
/**
* Read config objects stored in JSON format from <code>InputStream</code>
*
* @param inputStream
* @return
* @throws IOException
* @param inputStream of config
* @return config
* @throws IOException error
*/
public static Map<String, CacheConfig> fromJSON(InputStream inputStream) throws IOException {
return new CacheConfigSupport().fromJSON(inputStream);
@ -114,9 +111,9 @@ public class CacheConfig {
/**
* Read config objects stored in JSON format from <code>File</code>
*
* @param file
* @return
* @throws IOException
* @param file of config
* @return config
* @throws IOException error
*/
public static Map<String, CacheConfig> fromJSON(File file) throws IOException {
return new CacheConfigSupport().fromJSON(file);
@ -125,9 +122,9 @@ public class CacheConfig {
/**
* Read config objects stored in JSON format from <code>URL</code>
*
* @param url
* @return
* @throws IOException
* @param url of config
* @return config
* @throws IOException error
*/
public static Map<String, CacheConfig> fromJSON(URL url) throws IOException {
return new CacheConfigSupport().fromJSON(url);
@ -136,9 +133,9 @@ public class CacheConfig {
/**
* Read config objects stored in JSON format from <code>Reader</code>
*
* @param reader
* @return
* @throws IOException
* @param reader of config
* @return config
* @throws IOException error
*/
public static Map<String, CacheConfig> fromJSON(Reader reader) throws IOException {
return new CacheConfigSupport().fromJSON(reader);
@ -147,19 +144,19 @@ public class CacheConfig {
/**
* Convert current configuration to JSON format
*
* @return
* @throws IOException
* @return config object
* @throws IOException error
*/
public static String toJSON(Map<String, CacheConfig> configs) throws IOException {
return new CacheConfigSupport().toJSON(configs);
public static String toJSON(Map<String, CacheConfig> config) throws IOException {
return new CacheConfigSupport().toJSON(config);
}
/**
* Read config objects stored in YAML format from <code>String</code>
*
* @param content
* @return
* @throws IOException
* @param content of config
* @return config
* @throws IOException error
*/
public static Map<String, CacheConfig> fromYAML(String content) throws IOException {
return new CacheConfigSupport().fromYAML(content);
@ -168,9 +165,9 @@ public class CacheConfig {
/**
* Read config objects stored in YAML format from <code>InputStream</code>
*
* @param inputStream
* @return
* @throws IOException
* @param inputStream of config
* @return config
* @throws IOException error
*/
public static Map<String, CacheConfig> fromYAML(InputStream inputStream) throws IOException {
return new CacheConfigSupport().fromYAML(inputStream);
@ -179,9 +176,9 @@ public class CacheConfig {
/**
* Read config objects stored in YAML format from <code>File</code>
*
* @param file
* @return
* @throws IOException
* @param file of config
* @return config
* @throws IOException error
*/
public static Map<String, CacheConfig> fromYAML(File file) throws IOException {
return new CacheConfigSupport().fromYAML(file);
@ -190,9 +187,9 @@ public class CacheConfig {
/**
* Read config objects stored in YAML format from <code>URL</code>
*
* @param url
* @return
* @throws IOException
* @param url of config
* @return config
* @throws IOException error
*/
public static Map<String, CacheConfig> fromYAML(URL url) throws IOException {
return new CacheConfigSupport().fromYAML(url);
@ -201,9 +198,9 @@ public class CacheConfig {
/**
* Read config objects stored in YAML format from <code>Reader</code>
*
* @param reader
* @return
* @throws IOException
* @param reader of config
* @return config
* @throws IOException error
*/
public static Map<String, CacheConfig> fromYAML(Reader reader) throws IOException {
return new CacheConfigSupport().fromYAML(reader);
@ -212,11 +209,11 @@ public class CacheConfig {
/**
* Convert current configuration to YAML format
*
* @return
* @throws IOException
* @return config in yaml format
* @throws IOException error
*/
public static String toYAML(Map<String, CacheConfig> configs) throws IOException {
return new CacheConfigSupport().toYAML(configs);
public static String toYAML(Map<String, CacheConfig> config) throws IOException {
return new CacheConfigSupport().toYAML(config);
}
}

@ -59,8 +59,8 @@ public class RedissonSpringCacheManager implements CacheManager, ResourceLoaderA
* Creates CacheManager supplied by Redisson instance and
* Cache config mapped by Cache name
*
* @param redisson
* @param config
* @param redisson object
* @param config object
*/
public RedissonSpringCacheManager(RedissonClient redisson, Map<String, CacheConfig> config) {
this(redisson, config, null);
@ -72,8 +72,9 @@ public class RedissonSpringCacheManager implements CacheManager, ResourceLoaderA
* <p>
* Each Cache instance share one Codec instance.
*
* @param redisson
* @param config
* @param redisson object
* @param config object
* @param codec object
*/
public RedissonSpringCacheManager(RedissonClient redisson, Map<String, CacheConfig> config, Codec codec) {
this.redisson = redisson;
@ -88,8 +89,8 @@ public class RedissonSpringCacheManager implements CacheManager, ResourceLoaderA
* Loads the config file from the class path, interpreting plain paths as class path resource names
* that include the package path (e.g. "mypackage/myresource.txt").
*
* @param redisson
* @param config
* @param redisson object
* @param configLocation path
*/
public RedissonSpringCacheManager(RedissonClient redisson, String configLocation) {
this(redisson, configLocation, null);
@ -104,8 +105,9 @@ public class RedissonSpringCacheManager implements CacheManager, ResourceLoaderA
* Loads the config file from the class path, interpreting plain paths as class path resource names
* that include the package path (e.g. "mypackage/myresource.txt").
*
* @param redisson
* @param config
* @param redisson object
* @param configLocation path
* @param codec object
*/
public RedissonSpringCacheManager(RedissonClient redisson, String configLocation, Codec codec) {
this.redisson = redisson;
@ -116,8 +118,7 @@ public class RedissonSpringCacheManager implements CacheManager, ResourceLoaderA
/**
* Set cache config location
*
* @param config
* @throws IOException
* @param configLocation object
*/
public void setConfigLocation(String configLocation) {
this.configLocation = configLocation;
@ -126,7 +127,7 @@ public class RedissonSpringCacheManager implements CacheManager, ResourceLoaderA
/**
* Set cache config mapped by cache name
*
* @param config
* @param config object
*/
public void setConfig(Map<String, CacheConfig> config) {
this.configMap = config;
@ -135,7 +136,7 @@ public class RedissonSpringCacheManager implements CacheManager, ResourceLoaderA
/**
* Set Redisson instance
*
* @param config
* @param redisson instance
*/
public void setRedisson(RedissonClient redisson) {
this.redisson = redisson;
@ -144,7 +145,7 @@ public class RedissonSpringCacheManager implements CacheManager, ResourceLoaderA
/**
* Set Codec instance shared between all Cache instances
*
* @param codec
* @param codec object
*/
public void setCodec(Codec codec) {
this.codec = codec;

Loading…
Cancel
Save