From a705d5d3290de8494990e680aaf71af832ff82b7 Mon Sep 17 00:00:00 2001 From: Nikita <abracham.mitchell@gmail.com> Date: Mon, 26 Sep 2016 18:30:23 +0300 Subject: [PATCH] javadocs fixed --- .../redisson/RedissonLiveObjectService.java | 2 +- .../src/main/java/org/redisson/api/Node.java | 2 +- .../main/java/org/redisson/api/RBatch.java | 5 +- .../main/java/org/redisson/api/RBucket.java | 2 +- .../java/org/redisson/api/RBucketAsync.java | 2 +- .../org/redisson/api/RExecutorService.java | 1 - .../java/org/redisson/api/RLiveObject.java | 8 +- .../org/redisson/api/RLiveObjectService.java | 62 +++---- .../org/redisson/api/RLocalCachedMap.java | 4 +- .../redisson/api/RLocalCachedMapAsync.java | 100 ----------- .../src/main/java/org/redisson/api/RLock.java | 10 +- .../src/main/java/org/redisson/api/RMap.java | 24 +-- .../main/java/org/redisson/api/RMapAsync.java | 16 +- .../main/java/org/redisson/api/RMapCache.java | 44 ++--- .../java/org/redisson/api/RMapCacheAsync.java | 52 +++--- .../java/org/redisson/api/RMapReactive.java | 6 +- .../main/java/org/redisson/api/RMultimap.java | 6 +- .../java/org/redisson/api/RMultimapAsync.java | 6 +- .../java/org/redisson/api/RMultimapCache.java | 2 +- .../org/redisson/api/RMultimapCacheAsync.java | 2 +- .../java/org/redisson/api/RPatternTopic.java | 12 +- .../redisson/api/RPatternTopicReactive.java | 12 +- .../api/RPermitExpirableSemaphore.java | 18 +- .../api/RPermitExpirableSemaphoreAsync.java | 32 ++-- .../java/org/redisson/api/RRemoteService.java | 66 ++++--- .../api/RScheduledExecutorService.java | 10 +- .../api/RScheduledExecutorServiceAsync.java | 12 +- .../org/redisson/api/RScheduledFuture.java | 4 +- .../org/redisson/api/RScoredSortedSet.java | 30 ++-- .../redisson/api/RScoredSortedSetAsync.java | 26 +-- .../java/org/redisson/api/RSemaphore.java | 18 +- .../org/redisson/api/RSemaphoreAsync.java | 31 ++-- .../org/redisson/executor/CronExpression.java | 161 ------------------ 33 files changed, 277 insertions(+), 511 deletions(-) delete mode 100644 redisson/src/main/java/org/redisson/api/RLocalCachedMapAsync.java diff --git a/redisson/src/main/java/org/redisson/RedissonLiveObjectService.java b/redisson/src/main/java/org/redisson/RedissonLiveObjectService.java index 15ac03fb3..51c8ac9a6 100644 --- a/redisson/src/main/java/org/redisson/RedissonLiveObjectService.java +++ b/redisson/src/main/java/org/redisson/RedissonLiveObjectService.java @@ -185,7 +185,7 @@ public class RedissonLiveObjectService implements RLiveObjectService { } @Override - public <T> RMap asRMap(T instance) { + public <T, K, V> RMap<K, V> asRMap(T instance) { return (RMap) instance; } diff --git a/redisson/src/main/java/org/redisson/api/Node.java b/redisson/src/main/java/org/redisson/api/Node.java index ef2d80625..58b32d836 100644 --- a/redisson/src/main/java/org/redisson/api/Node.java +++ b/redisson/src/main/java/org/redisson/api/Node.java @@ -28,7 +28,7 @@ public interface Node { /** * Returns current Redis server time in seconds * - * @return + * @return time in seconds */ long time(); diff --git a/redisson/src/main/java/org/redisson/api/RBatch.java b/redisson/src/main/java/org/redisson/api/RBatch.java index 9511c7d91..199e6a00c 100644 --- a/redisson/src/main/java/org/redisson/api/RBatch.java +++ b/redisson/src/main/java/org/redisson/api/RBatch.java @@ -405,7 +405,6 @@ public interface RBatch { * If cluster configuration used then operations are grouped by slot ids * and may be executed on different servers. Thus command execution order could be changed * - * @return List with result object for each command * @throws RedisException in case of any error * */ @@ -417,8 +416,8 @@ public interface RBatch { * <p> * If cluster configuration used then operations are grouped by slot ids * and may be executed on different servers. Thus command execution order could be changed - * - * @return List with result object for each command + * + * @return void * @throws RedisException in case of any error * */ diff --git a/redisson/src/main/java/org/redisson/api/RBucket.java b/redisson/src/main/java/org/redisson/api/RBucket.java index f47ab4a54..8384082ee 100644 --- a/redisson/src/main/java/org/redisson/api/RBucket.java +++ b/redisson/src/main/java/org/redisson/api/RBucket.java @@ -29,7 +29,7 @@ public interface RBucket<V> extends RExpirable, RBucketAsync<V> { /** * Returns size of object in bytes * - * @return + * @return object size */ int size(); diff --git a/redisson/src/main/java/org/redisson/api/RBucketAsync.java b/redisson/src/main/java/org/redisson/api/RBucketAsync.java index 79f09f6fc..23508a2d7 100644 --- a/redisson/src/main/java/org/redisson/api/RBucketAsync.java +++ b/redisson/src/main/java/org/redisson/api/RBucketAsync.java @@ -29,7 +29,7 @@ public interface RBucketAsync<V> extends RExpirableAsync { /** * Returns size of object in bytes * - * @return + * @return object size */ RFuture<Integer> sizeAsync(); diff --git a/redisson/src/main/java/org/redisson/api/RExecutorService.java b/redisson/src/main/java/org/redisson/api/RExecutorService.java index 650e47bac..591365a86 100644 --- a/redisson/src/main/java/org/redisson/api/RExecutorService.java +++ b/redisson/src/main/java/org/redisson/api/RExecutorService.java @@ -43,7 +43,6 @@ public interface RExecutorService extends ExecutorService, RExecutorServiceAsync * Register workers * * @param workers - workers amount - * @param executor - executor instance */ void registerWorkers(int workers); diff --git a/redisson/src/main/java/org/redisson/api/RLiveObject.java b/redisson/src/main/java/org/redisson/api/RLiveObject.java index d496fd9dd..ed85eeb02 100644 --- a/redisson/src/main/java/org/redisson/api/RLiveObject.java +++ b/redisson/src/main/java/org/redisson/api/RLiveObject.java @@ -41,7 +41,7 @@ public interface RLiveObject { * naming scheme specified in the REntity annotation of the instance class. * * @param liveObjectId the liveObjectId to set - * @see org.redisson.core.RMap + * @see org.redisson.api.RMap */ void setLiveObjectId(Object liveObjectId); @@ -52,14 +52,14 @@ public interface RLiveObject { * name of the underlying RMap, so to ensure the map exist in redis, set a * non null value to any of the other fields. * - * @return - * @see org.redisson.core.RMap + * @return <code>true</code> is object exists + * @see org.redisson.api.RMap */ boolean isExists(); /** * Deletes the underlying RMap. - * @return + * @return <code>true</code> if object deleted successfully */ boolean delete(); diff --git a/redisson/src/main/java/org/redisson/api/RLiveObjectService.java b/redisson/src/main/java/org/redisson/api/RLiveObjectService.java index e469df380..4072d915a 100644 --- a/redisson/src/main/java/org/redisson/api/RLiveObjectService.java +++ b/redisson/src/main/java/org/redisson/api/RLiveObjectService.java @@ -98,8 +98,8 @@ public interface RLiveObjectService { * with the same RId field value will be created. * * @param <T> Entity type - * @param detachedObject - * @return + * @param detachedObject - not proxied object + * @return proxied object * @throws IllegalArgumentException if the object is is a RLiveObject instance. */ <T> T attach(T detachedObject); @@ -116,8 +116,8 @@ public interface RLiveObjectService { * store it. * * @param <T> Entity type - * @param detachedObject - * @return + * @param detachedObject - not proxied object + * @return proxied object * @throws IllegalArgumentException if the object is is a RLiveObject instance. */ <T> T merge(T detachedObject); @@ -134,8 +134,8 @@ public interface RLiveObjectService { * store it. * * @param <T> Entity type - * @param detachedObject - * @return + * @param detachedObject - not proxied object + * @return proxied object */ <T> T persist(T detachedObject); @@ -143,8 +143,8 @@ public interface RLiveObjectService { * Returns unproxied detached object for the attached object. * * @param <T> Entity type - * @param attachedObject - * @return + * @param attachedObject - proxied object + * @return proxied object */ <T> T detach(T attachedObject); @@ -152,7 +152,7 @@ public interface RLiveObjectService { * Deletes attached object including all nested objects. * * @param <T> Entity type - * @param attachedObject + * @param attachedObject - proxied object */ <T> void delete(T attachedObject); @@ -161,44 +161,46 @@ public interface RLiveObjectService { * * @param <T> Entity type * @param <K> Key type - * @param entityClass - * @param id + * @param entityClass - object class + * @param id - object id */ <T, K> void delete(Class<T> entityClass, K id); /** * To cast the instance to RLiveObject instance. * - * @param <T> - * @param instance - * @return + * @param <T> type of instance + * @param instance - live object + * @return RLiveObject compatible object */ <T> RLiveObject asLiveObject(T instance); /** * To cast the instance to RExpirable instance. * - * @param <T> - * @param instance - * @return + * @param <T> type of instance + * @param instance - live object + * @return RExpirable compatible object */ <T> RExpirable asRExpirable(T instance); /** * To cast the instance to RMap instance. * - * @param <T> - * @param instance - * @return + * @param <T> type of instance + * @param <K> type of key + * @param <V> type of value + * @param instance - live object + * @return RMap compatible object */ - <T> RMap asRMap(T instance); + <T, K, V> RMap<K, V> asRMap(T instance); /** * Returns true if the instance is a instance of RLiveObject. * - * @param <T> - * @param instance - * @return + * @param <T> type of instance + * @param instance - live object + * @return <code>true</code> object is RLiveObject */ <T> boolean isLiveObject(T instance); @@ -206,9 +208,9 @@ public interface RLiveObjectService { * Returns true if the RLiveObject does not yet exist in redis. Also true if * the passed object is not a RLiveObject. * - * @param <T> - * @param instance - * @return + * @param <T> type of instance + * @param instance - live object + * @return <code>true</code> object exists */ <T> boolean isExists(T instance); @@ -224,7 +226,7 @@ public interface RLiveObjectService { * accessible in another RLiveObjectService instance so long as they are * created by the same RedissonClient instance. * - * @param cls + * @param cls - class */ void registerClass(Class<?> cls); @@ -257,8 +259,8 @@ public interface RLiveObjectService { * accessible in another RLiveObjectService instance so long as they are * created by the same RedissonClient instance. * - * @param cls - * @return + * @param cls - type of instance + * @return <code>true</code> if class already registered */ boolean isClassRegistered(Class<?> cls); } diff --git a/redisson/src/main/java/org/redisson/api/RLocalCachedMap.java b/redisson/src/main/java/org/redisson/api/RLocalCachedMap.java index f631241f7..a7f7ed9c6 100644 --- a/redisson/src/main/java/org/redisson/api/RLocalCachedMap.java +++ b/redisson/src/main/java/org/redisson/api/RLocalCachedMap.java @@ -23,8 +23,8 @@ package org.redisson.api; * * @author Nikita Koksharov * - * @param <K> - * @param <V> + * @param <K> map key + * @param <V> map value */ public interface RLocalCachedMap<K, V> extends RMap<K, V>, RDestroyable { diff --git a/redisson/src/main/java/org/redisson/api/RLocalCachedMapAsync.java b/redisson/src/main/java/org/redisson/api/RLocalCachedMapAsync.java deleted file mode 100644 index a7f51a594..000000000 --- a/redisson/src/main/java/org/redisson/api/RLocalCachedMapAsync.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright 2016 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; - -/** - * - * @author Nikita Koksharov - * - * @param <K> - * @param <V> - */ -public interface RLocalCachedMapAsync<K, V> extends RExpirableAsync { - - /** - * Returns map size - * - * @return - */ - RFuture<Integer> sizeAsync(); - - /** - * Checks if map contains the specified <code>key</code> - * - * @return <code>true</code> if map contains <code>key</code>. - * <code>false</code> if map doesn't contain <code>key</code>. - */ - RFuture<Boolean> containsKeyAsync(Object key); - - /** - * Checks if map contains the specified <code>value</code> - * - * @return <code>true</code> if map contains <code>value</code>. - * <code>false</code> if map doesn't contain <code>value</code>. - */ - RFuture<Boolean> containsValueAsync(Object value); - - /** - * Returns value associated with <code>key</code> - * - * @param key - * @return - */ - RFuture<V> getAsync(Object key); - - /** - * Associates the specified <code>value</code> with the specified <code>key</code>. - * - * @param key - * @param value - * @return previous value associated with <code>key</code> - */ - RFuture<V> putAsync(K key, V value); - - /** - * Removes <code>key</code> from map. - * - * @param key - * @return removed value associated with <code>key</code> - */ - RFuture<V> removeAsync(K key); - - /** - * Removes <code>key</code> from map - * <p> - * Works faster than <code>RLocalCachedMap.remove</code> but not returning - * the value associated with <code>key</code> - * - * @param key - * @return <code>true</code> if key has been deleted. - * <code>false</code> if key doesn't exist. - */ - RFuture<Boolean> fastRemoveAsync(K key); - - /** - * Associates the specified <code>value</code> with the specified <code>key</code>. - * <p> - * Works faster than <code>RLocalCachedMap.put</code> but not returning - * the previous value associated with <code>key</code> - * - * @param key - * @param value - * @return <code>true</code> if key is a new key in the hash and value was set. - * <code>false</code> if key already exists in the hash and the value was updated. - */ - RFuture<Boolean> fastPutAsync(K key, V value); - -} diff --git a/redisson/src/main/java/org/redisson/api/RLock.java b/redisson/src/main/java/org/redisson/api/RLock.java index f5ad5ab8c..09395d9b4 100644 --- a/redisson/src/main/java/org/redisson/api/RLock.java +++ b/redisson/src/main/java/org/redisson/api/RLock.java @@ -58,10 +58,10 @@ public interface RLock extends Lock, RExpirable { * have passed since the lock was granted - whichever comes first. * * @param waitTime the maximum time to aquire the lock - * @param leaseTime - * @param unit - * @return - * @throws InterruptedException + * @param leaseTime lease time + * @param unit time unit + * @return <code>true</code> if lock has been successfully acquired + * @throws InterruptedException - if the thread is interrupted before or during this method. */ boolean tryLock(long waitTime, long leaseTime, TimeUnit unit) throws InterruptedException; @@ -100,7 +100,7 @@ public interface RLock extends Lock, RExpirable { /** * Checks if this lock is held by the current thread * - * @return @return <code>true</code> if held by current thread + * @return <code>true</code> if held by current thread * otherwise <code>false</code> */ boolean isHeldByCurrentThread(); diff --git a/redisson/src/main/java/org/redisson/api/RMap.java b/redisson/src/main/java/org/redisson/api/RMap.java index 0043677fc..415985715 100644 --- a/redisson/src/main/java/org/redisson/api/RMap.java +++ b/redisson/src/main/java/org/redisson/api/RMap.java @@ -28,7 +28,7 @@ import java.util.concurrent.ConcurrentMap; * * @author Nikita Koksharov * - * @param <K> key + * @param <K> map key * @param <V> value */ public interface RMap<K, V> extends ConcurrentMap<K, V>, RExpirable, RMapAsync<K, V> { @@ -36,8 +36,8 @@ public interface RMap<K, V> extends ConcurrentMap<K, V>, RExpirable, RMapAsync<K /** * Returns size of value mapped by key in bytes * - * @param key - * @return + * @param key - map key + * @return size of value */ int valueSize(K key); @@ -47,7 +47,7 @@ public interface RMap<K, V> extends ConcurrentMap<K, V>, RExpirable, RMapAsync<K * * Works only for <b>numeric</b> values! * - * @param key + * @param key - map key * @param delta the value to add * @return the updated value */ @@ -60,8 +60,8 @@ public interface RMap<K, V> extends ConcurrentMap<K, V>, RExpirable, RMapAsync<K * * The returned map is <b>NOT</b> backed by the original map. * - * @param keys map keys - * @return + * @param keys - map keys + * @return Map object */ Map<K, V> getAll(Set<K> keys); @@ -71,7 +71,7 @@ public interface RMap<K, V> extends ConcurrentMap<K, V>, RExpirable, RMapAsync<K * Works faster than <code>RMap.remove</code> but not returning * the value associated with <code>key</code> * - * @param keys + * @param keys - map keys * @return the number of keys that were removed from the hash, not including specified but non existing keys */ long fastRemove(K ... keys); @@ -82,8 +82,8 @@ public interface RMap<K, V> extends ConcurrentMap<K, V>, RExpirable, RMapAsync<K * Works faster than <code>RMap.put</code> but not returning * the previous value associated with <code>key</code> * - * @param key - * @param value + * @param key - map key + * @param value - map value * @return <code>true</code> if key is a new key in the hash and value was set. * <code>false</code> if key already exists in the hash and the value was updated. */ @@ -94,21 +94,21 @@ public interface RMap<K, V> extends ConcurrentMap<K, V>, RExpirable, RMapAsync<K /** * Read all keys at once * - * @return + * @return keys */ Set<K> readAllKeySet(); /** * Read all values at once * - * @return + * @return values */ Collection<V> readAllValues(); /** * Read all map entries at once * - * @return + * @return entries */ Set<Entry<K, V>> readAllEntrySet(); diff --git a/redisson/src/main/java/org/redisson/api/RMapAsync.java b/redisson/src/main/java/org/redisson/api/RMapAsync.java index 82c51eae5..e8c1cf60b 100644 --- a/redisson/src/main/java/org/redisson/api/RMapAsync.java +++ b/redisson/src/main/java/org/redisson/api/RMapAsync.java @@ -33,8 +33,8 @@ public interface RMapAsync<K, V> extends RExpirableAsync { /** * Returns size of value mapped by key in bytes * - * @param key - * @return + * @param key - map key + * @return size of value */ RFuture<Integer> valueSizeAsync(K key); @@ -56,7 +56,7 @@ public interface RMapAsync<K, V> extends RExpirableAsync { * Works faster than <code>RMap.removeAsync</code> but doesn't return * the value associated with <code>key</code> * - * @param keys + * @param keys - map keys * @return the number of keys that were removed from the hash, not including specified but non existing keys */ RFuture<Long> fastRemoveAsync(K ... keys); @@ -68,8 +68,8 @@ public interface RMapAsync<K, V> extends RExpirableAsync { * Works faster than <code>RMap.putAsync</code> but not returning * the previous value associated with <code>key</code> * - * @param key - * @param value + * @param key - map key + * @param value - map value * @return <code>true</code> if key is a new key in the hash and value was set. * <code>false</code> if key already exists in the hash and the value was updated. */ @@ -80,21 +80,21 @@ public interface RMapAsync<K, V> extends RExpirableAsync { /** * Read all keys at once * - * @return + * @return keys */ RFuture<Set<K>> readAllKeySetAsync(); /** * Read all values at once * - * @return + * @return values */ RFuture<Collection<V>> readAllValuesAsync(); /** * Read all map entries at once * - * @return + * @return entries */ RFuture<Set<Entry<K, V>>> readAllEntrySetAsync(); diff --git a/redisson/src/main/java/org/redisson/api/RMapCache.java b/redisson/src/main/java/org/redisson/api/RMapCache.java index 0f2652fde..5df58bf73 100644 --- a/redisson/src/main/java/org/redisson/api/RMapCache.java +++ b/redisson/src/main/java/org/redisson/api/RMapCache.java @@ -48,11 +48,11 @@ public interface RMapCache<K, V> extends RMap<K, V>, RMapCacheAsync<K, V> { * If the map previously contained a mapping for * the key, the old value is replaced by the specified value. * - * @param key - * @param value + * @param key - map key + * @param value - map value * @param ttl - time to live for key\value entry. * If <code>0</code> then stores infinitely. - * @param ttlUnit + * @param ttlUnit - time unit * @return previous associated value */ V putIfAbsent(K key, V value, long ttl, TimeUnit ttlUnit); @@ -67,14 +67,14 @@ public interface RMapCache<K, V> extends RMap<K, V>, RMapCacheAsync<K, V> { * If the map previously contained a mapping for * the key, the old value is replaced by the specified value. * - * @param key - * @param value + * @param key - map key + * @param value - map value * @param ttl - time to live for key\value entry. * If <code>0</code> then time to live doesn't affect entry expiration. - * @param ttlUnit + * @param ttlUnit - time unit * @param maxIdleTime - max idle time for key\value entry. * If <code>0</code> then max idle time doesn't affect entry expiration. - * @param maxIdleUnit + * @param maxIdleUnit - time unit * <p> * if <code>maxIdleTime</code> and <code>ttl</code> params are equal to <code>0</code> * then entry stores infinitely. @@ -90,11 +90,11 @@ public interface RMapCache<K, V> extends RMap<K, V>, RMapCacheAsync<K, V> { * If the map previously contained a mapping for * the key, the old value is replaced by the specified value. * - * @param key - * @param value + * @param key - map key + * @param value - map value * @param ttl - time to live for key\value entry. * If <code>0</code> then stores infinitely. - * @param unit + * @param unit - time unit * @return previous associated value */ V put(K key, V value, long ttl, TimeUnit unit); @@ -106,14 +106,14 @@ public interface RMapCache<K, V> extends RMap<K, V>, RMapCacheAsync<K, V> { * If the map previously contained a mapping for * the key, the old value is replaced by the specified value. * - * @param key - * @param value + * @param key - map key + * @param value - map value * @param ttl - time to live for key\value entry. * If <code>0</code> then time to live doesn't affect entry expiration. - * @param ttlUnit + * @param ttlUnit - time unit * @param maxIdleTime - max idle time for key\value entry. * If <code>0</code> then max idle time doesn't affect entry expiration. - * @param maxIdleUnit + * @param maxIdleUnit - time unit * <p> * if <code>maxIdleTime</code> and <code>ttl</code> params are equal to <code>0</code> * then entry stores infinitely. @@ -132,12 +132,12 @@ public interface RMapCache<K, V> extends RMap<K, V>, RMapCacheAsync<K, V> { * Works faster than usual {@link #put(Object, Object, long, TimeUnit)} * as it not returns previous value. * - * @param key - * @param value + * @param key - map key + * @param value - map value * @param ttl - time to live for key\value entry. * If <code>0</code> then stores infinitely. - * @param unit - * @return previous associated value + * @param ttlUnit - time unit + * @return <code>true</code> if value has been set successfully */ boolean fastPut(K key, V value, long ttl, TimeUnit ttlUnit); @@ -151,14 +151,14 @@ public interface RMapCache<K, V> extends RMap<K, V>, RMapCacheAsync<K, V> { * Works faster than usual {@link #put(Object, Object, long, TimeUnit, long, TimeUnit)} * as it not returns previous value. * - * @param key - * @param value + * @param key - map key + * @param value - map value * @param ttl - time to live for key\value entry. * If <code>0</code> then time to live doesn't affect entry expiration. - * @param ttlUnit + * @param ttlUnit - time unit * @param maxIdleTime - max idle time for key\value entry. * If <code>0</code> then max idle time doesn't affect entry expiration. - * @param maxIdleUnit + * @param maxIdleUnit - time unit * <p> * if <code>maxIdleTime</code> and <code>ttl</code> params are equal to <code>0</code> * then entry stores infinitely. diff --git a/redisson/src/main/java/org/redisson/api/RMapCacheAsync.java b/redisson/src/main/java/org/redisson/api/RMapCacheAsync.java index 8397c96e5..15a067cb8 100644 --- a/redisson/src/main/java/org/redisson/api/RMapCacheAsync.java +++ b/redisson/src/main/java/org/redisson/api/RMapCacheAsync.java @@ -19,7 +19,7 @@ import java.util.concurrent.TimeUnit; /** * <p>Async interface for map-based cache with ability to set TTL for each entry via - * {@link #put(Object, Object, long, TimeUnit)} or {@link #putIfAbsent(Object, Object, long, TimeUnit)} + * {RMapCacheAsync#putAsync(K, V, long, TimeUnit)} or {RMapCacheAsync#putIfAbsentAsync(K, V, long, TimeUnit)} * And therefore has an complex lua-scripts inside.</p> * * <p>Current redis implementation doesnt have eviction functionality. @@ -47,11 +47,11 @@ public interface RMapCacheAsync<K, V> extends RMapAsync<K, V> { * If the map previously contained a mapping for * the key, the old value is replaced by the specified value. * - * @param key - * @param value + * @param key - map key + * @param value - map value * @param ttl - time to live for key\value entry. * If <code>0</code> then stores infinitely. - * @param unit + * @param unit - time unit * @return previous associated value */ RFuture<V> putIfAbsentAsync(K key, V value, long ttl, TimeUnit unit); @@ -66,14 +66,14 @@ public interface RMapCacheAsync<K, V> extends RMapAsync<K, V> { * If the map previously contained a mapping for * the key, the old value is replaced by the specified value. * - * @param key - * @param value + * @param key - map key + * @param value - map value * @param ttl - time to live for key\value entry. * If <code>0</code> then time to live doesn't affect entry expiration. - * @param ttlUnit + * @param ttlUnit - time unit * @param maxIdleTime - max idle time for key\value entry. * If <code>0</code> then max idle time doesn't affect entry expiration. - * @param maxIdleUnit + * @param maxIdleUnit - time unit * <p> * if <code>maxIdleTime</code> and <code>ttl</code> params are equal to <code>0</code> * then entry stores infinitely. @@ -88,11 +88,11 @@ public interface RMapCacheAsync<K, V> extends RMapAsync<K, V> { * If the map previously contained a mapping for * the key, the old value is replaced by the specified value. * - * @param key - * @param value + * @param key - map key + * @param value - map value * @param ttl - time to live for key\value entry. * If <code>0</code> then stores infinitely. - * @param unit + * @param unit - time unit * @return previous associated value */ RFuture<V> putAsync(K key, V value, long ttl, TimeUnit unit); @@ -104,14 +104,14 @@ public interface RMapCacheAsync<K, V> extends RMapAsync<K, V> { * If the map previously contained a mapping for * the key, the old value is replaced by the specified value. * - * @param key - * @param value + * @param key - map key + * @param value - map value * @param ttl - time to live for key\value entry. * If <code>0</code> then time to live doesn't affect entry expiration. - * @param ttlUnit + * @param ttlUnit - time unit * @param maxIdleTime - max idle time for key\value entry. * If <code>0</code> then max idle time doesn't affect entry expiration. - * @param maxIdleUnit + * @param maxIdleUnit - time unit * <p> * if <code>maxIdleTime</code> and <code>ttl</code> params are equal to <code>0</code> * then entry stores infinitely. @@ -127,15 +127,15 @@ public interface RMapCacheAsync<K, V> extends RMapAsync<K, V> { * If the map previously contained a mapping for * the key, the old value is replaced by the specified value. * <p> - * Works faster than usual {@link #put(Object, Object, long, TimeUnit)} + * Works faster than usual {@link #putAsync(Object, Object, long, TimeUnit)} * as it not returns previous value. * - * @param key - * @param value + * @param key - map key + * @param value - map value * @param ttl - time to live for key\value entry. * If <code>0</code> then stores infinitely. - * @param unit - * @return previous associated value + * @param unit - time unit + * @return <code>true</code> if value has been set successfully */ RFuture<Boolean> fastPutAsync(K key, V value, long ttl, TimeUnit unit); @@ -146,22 +146,22 @@ public interface RMapCacheAsync<K, V> extends RMapAsync<K, V> { * If the map previously contained a mapping for * the key, the old value is replaced by the specified value. * <p> - * Works faster than usual {@link #put(Object, Object, long, TimeUnit, long, TimeUnit)} + * Works faster than usual {@link #putAsync(Object, Object, long, TimeUnit, long, TimeUnit)} * as it not returns previous value. * - * @param key - * @param value + * @param key - map key + * @param value - map value * @param ttl - time to live for key\value entry. * If <code>0</code> then time to live doesn't affect entry expiration. - * @param ttlUnit + * @param ttlUnit - time unit * @param maxIdleTime - max idle time for key\value entry. * If <code>0</code> then max idle time doesn't affect entry expiration. - * @param maxIdleUnit + * @param maxIdleUnit - time unit * <p> * if <code>maxIdleTime</code> and <code>ttl</code> params are equal to <code>0</code> * then entry stores infinitely. - * @return previous associated value + * @return <code>true</code> if value has been set successfully */ RFuture<Boolean> fastPutAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit); diff --git a/redisson/src/main/java/org/redisson/api/RMapReactive.java b/redisson/src/main/java/org/redisson/api/RMapReactive.java index a2795374d..f70104e85 100644 --- a/redisson/src/main/java/org/redisson/api/RMapReactive.java +++ b/redisson/src/main/java/org/redisson/api/RMapReactive.java @@ -48,7 +48,7 @@ public interface RMapReactive<K, V> extends RExpirableReactive { * Works faster than <code>RMap.remove</code> but not returning * the value associated with <code>key</code> * - * @param keys + * @param keys - map keys * @return the number of keys that were removed from the hash, not including specified but non existing keys */ Publisher<Long> fastRemove(K ... keys); @@ -60,8 +60,8 @@ public interface RMapReactive<K, V> extends RExpirableReactive { * Works faster than <code>RMap.put</code> but not returning * the previous value associated with <code>key</code> * - * @param key - * @param value + * @param key - map key + * @param value - map value * @return <code>true</code> if key is a new key in the hash and value was set. * <code>false</code> if key already exists in the hash and the value was updated. */ diff --git a/redisson/src/main/java/org/redisson/api/RMultimap.java b/redisson/src/main/java/org/redisson/api/RMultimap.java index 1603c3d28..05f9b94f9 100644 --- a/redisson/src/main/java/org/redisson/api/RMultimap.java +++ b/redisson/src/main/java/org/redisson/api/RMultimap.java @@ -135,10 +135,8 @@ public interface RMultimap<K, V> extends RExpirable, RMultimapAsync<K, V> { /** * Removes all values associated with the key {@code key}. * - * <p>Once this method returns, {@code key} will not be mapped to any values, - * so it will not appear in {@link #keySet()}, {@link #asMap()}, or any other - * views. - * <p>Use {@link RMultimap#fastRemove()} if values are not needed.</p> + * <p>Once this method returns, {@code key} will not be mapped to any values + * <p>Use {@link RMultimap#fastRemove} if values are not needed.</p> * * @param key - map key * @return the values that were removed (possibly empty). The returned diff --git a/redisson/src/main/java/org/redisson/api/RMultimapAsync.java b/redisson/src/main/java/org/redisson/api/RMultimapAsync.java index 6b93699e8..6830ae6ba 100644 --- a/redisson/src/main/java/org/redisson/api/RMultimapAsync.java +++ b/redisson/src/main/java/org/redisson/api/RMultimapAsync.java @@ -114,7 +114,7 @@ public interface RMultimapAsync<K, V> extends RExpirableAsync { * values for that key. * * <p>If {@code values} is empty, this is equivalent to - * {@link #removeAll(Object) removeAll(key)}. + * {@link #removeAllAsync(Object)}. * * @param key - map key * @param values - map values @@ -128,9 +128,7 @@ public interface RMultimapAsync<K, V> extends RExpirableAsync { /** * Removes all values associated with the key {@code key}. * - * <p>Once this method returns, {@code key} will not be mapped to any values, - * so it will not appear in {@link #keySet()}, {@link #asMap()}, or any other - * views. + * <p>Once this method returns, {@code key} will not be mapped to any values. * * @param key - map key * @return the values that were removed (possibly empty). The returned diff --git a/redisson/src/main/java/org/redisson/api/RMultimapCache.java b/redisson/src/main/java/org/redisson/api/RMultimapCache.java index 71443fde7..c1f53a64a 100644 --- a/redisson/src/main/java/org/redisson/api/RMultimapCache.java +++ b/redisson/src/main/java/org/redisson/api/RMultimapCache.java @@ -23,7 +23,7 @@ public interface RMultimapCache<K, V> extends RMultimap<K, V>, RMultimapCacheAsy * Set a timeout for key. After the timeout has expired, * the key and its values will automatically be deleted. * - * @param key + * @param key - map key * @param timeToLive - timeout before key will be deleted * @param timeUnit - timeout time unit * @return <code>true</code> if key exists and the timeout was set and <code>false</code> if key not exists diff --git a/redisson/src/main/java/org/redisson/api/RMultimapCacheAsync.java b/redisson/src/main/java/org/redisson/api/RMultimapCacheAsync.java index c1be09a31..4e19aebff 100644 --- a/redisson/src/main/java/org/redisson/api/RMultimapCacheAsync.java +++ b/redisson/src/main/java/org/redisson/api/RMultimapCacheAsync.java @@ -23,7 +23,7 @@ public interface RMultimapCacheAsync<K, V> extends RMultimapAsync<K, V> { * Set a timeout for key in async mode. After the timeout has expired, * the key and its values will automatically be deleted. * - * @param key + * @param key - map key * @param timeToLive - timeout before key will be deleted * @param timeUnit - timeout time unit * @return <code>true</code> if key exists and the timeout was set and <code>false</code> if key not exists diff --git a/redisson/src/main/java/org/redisson/api/RPatternTopic.java b/redisson/src/main/java/org/redisson/api/RPatternTopic.java index 3a29d6cc4..eab373961 100644 --- a/redisson/src/main/java/org/redisson/api/RPatternTopic.java +++ b/redisson/src/main/java/org/redisson/api/RPatternTopic.java @@ -32,7 +32,7 @@ public interface RPatternTopic<M> { /** * Get topic channel patterns * - * @return + * @return list of topic names */ List<String> getPatternNames(); @@ -41,8 +41,8 @@ public interface RPatternTopic<M> { * <code>MessageListener.onMessage</code> is called when any message * is published on this topic. * - * @param listener - * @return locally unique listener id + * @param listener - message listener + * @return local JVM unique listener id * @see org.redisson.api.listener.MessageListener */ int addListener(PatternMessageListener<M> listener); @@ -50,8 +50,8 @@ public interface RPatternTopic<M> { /** * Subscribes to status changes of this topic * - * @param listener - * @return + * @param listener - message listener + * @return local JVM unique listener id * @see org.redisson.api.listener.StatusListener */ int addListener(PatternStatusListener listener); @@ -59,7 +59,7 @@ public interface RPatternTopic<M> { /** * Removes the listener by <code>id</code> for listening this topic * - * @param listenerId + * @param listenerId - id of message listener */ void removeListener(int listenerId); diff --git a/redisson/src/main/java/org/redisson/api/RPatternTopicReactive.java b/redisson/src/main/java/org/redisson/api/RPatternTopicReactive.java index 5b5e87c4b..cf68cd9e2 100644 --- a/redisson/src/main/java/org/redisson/api/RPatternTopicReactive.java +++ b/redisson/src/main/java/org/redisson/api/RPatternTopicReactive.java @@ -33,7 +33,7 @@ public interface RPatternTopicReactive<M> { /** * Get topic channel patterns * - * @return + * @return list of topic names */ List<String> getPatternNames(); @@ -42,8 +42,8 @@ public interface RPatternTopicReactive<M> { * <code>MessageListener.onMessage</code> is called when any message * is published on this topic. * - * @param listener - * @return locally unique listener id + * @param listener - message listener + * @return local JVM unique listener id * @see org.redisson.api.listener.MessageListener */ Publisher<Integer> addListener(PatternMessageListener<M> listener); @@ -51,8 +51,8 @@ public interface RPatternTopicReactive<M> { /** * Subscribes to status changes of this topic * - * @param listener - * @return + * @param listener - message listener + * @return local JVM unique listener id * @see org.redisson.api.listener.StatusListener */ Publisher<Integer> addListener(PatternStatusListener listener); @@ -60,7 +60,7 @@ public interface RPatternTopicReactive<M> { /** * Removes the listener by <code>id</code> for listening this topic * - * @param listenerId + * @param listenerId - message listener id */ void removeListener(int listenerId); diff --git a/redisson/src/main/java/org/redisson/api/RPermitExpirableSemaphore.java b/redisson/src/main/java/org/redisson/api/RPermitExpirableSemaphore.java index f7a71ad5b..1188910d4 100644 --- a/redisson/src/main/java/org/redisson/api/RPermitExpirableSemaphore.java +++ b/redisson/src/main/java/org/redisson/api/RPermitExpirableSemaphore.java @@ -71,8 +71,8 @@ public interface RPermitExpirableSemaphore extends RExpirable, RPermitExpirableS * </ul> * * @param leaseTime - permit lease time - * @param unit - * @return + * @param unit - time unit + * @return permit id * @throws InterruptedException if the current thread is interrupted */ String acquire(long leaseTime, TimeUnit unit) throws InterruptedException; @@ -175,7 +175,7 @@ public interface RPermitExpirableSemaphore extends RExpirable, RPermitExpirableS * Correct usage of a semaphore is established by programming convention * in the application. * - * @param permitId + * @param permitId - permit id * @return {@code true} if a permit has been released and {@code false} * otherwise */ @@ -195,7 +195,7 @@ public interface RPermitExpirableSemaphore extends RExpirable, RPermitExpirableS * * <p>Throws an exception if permit id doesn't exist or has already been release * - * @param permitId + * @param permitId - permit id */ void release(String permitId); @@ -207,19 +207,17 @@ public interface RPermitExpirableSemaphore extends RExpirable, RPermitExpirableS int availablePermits(); /** - * Sets new number of permits. + * Sets number of permits. * - * @param count - number of times {@link #countDown} must be invoked - * before threads can pass through {@link #await} - * @result <code>true</code> if semaphore has not initialized yet, otherwise <code>false</code>. - * + * @param permits - number of permits + * @return <code>true</code> if permits has been set successfully, otherwise <code>false</code>. */ boolean trySetPermits(int permits); /** * Increases or decreases the number of available permits by defined value. * - * @param number of permits to add/remove + * @param permits - number of permits to add/remove */ void addPermits(int permits); diff --git a/redisson/src/main/java/org/redisson/api/RPermitExpirableSemaphoreAsync.java b/redisson/src/main/java/org/redisson/api/RPermitExpirableSemaphoreAsync.java index c07aef69c..a55c0863f 100644 --- a/redisson/src/main/java/org/redisson/api/RPermitExpirableSemaphoreAsync.java +++ b/redisson/src/main/java/org/redisson/api/RPermitExpirableSemaphoreAsync.java @@ -41,7 +41,7 @@ public interface RPermitExpirableSemaphoreAsync extends RExpirableAsync { * disabled for thread scheduling purposes and lies dormant until * one of two things happens: * <ul> - * <li>Some other thread invokes the {@link #release} method for this + * <li>Some other thread invokes the {@link #releaseAsync(String)} method for this * semaphore and the current thread is next to be assigned a permit; or * <li>Some other thread {@linkplain Thread#interrupt interrupts} * the current thread. @@ -63,15 +63,15 @@ public interface RPermitExpirableSemaphoreAsync extends RExpirableAsync { * disabled for thread scheduling purposes and lies dormant until * one of two things happens: * <ul> - * <li>Some other thread invokes the {@link #release} method for this + * <li>Some other thread invokes the {@link #releaseAsync} method for this * semaphore and the current thread is next to be assigned a permit; or * <li>Some other thread {@linkplain Thread#interrupt interrupts} * the current thread. * </ul> * * @param leaseTime - permit lease time - * @param unit - * @return + * @param unit - time unit + * @return permit id */ RFuture<String> acquireAsync(long leaseTime, TimeUnit unit); @@ -104,7 +104,7 @@ public interface RPermitExpirableSemaphoreAsync extends RExpirableAsync { * disabled for thread scheduling purposes and lies dormant until * one of three things happens: * <ul> - * <li>Some other thread invokes the {@link #release} method for this + * <li>Some other thread invokes the {@link #releaseAsync(String)} method for this * semaphore and the current thread is next to be assigned a permit; or * <li>Some other thread {@linkplain Thread#interrupt interrupts} * the current thread; or @@ -138,7 +138,7 @@ public interface RPermitExpirableSemaphoreAsync extends RExpirableAsync { * disabled for thread scheduling purposes and lies dormant until * one of three things happens: * <ul> - * <li>Some other thread invokes the {@link #release} method for this + * <li>Some other thread invokes the {@link #releaseAsync(String)} method for this * semaphore and the current thread is next to be assigned a permit; or * <li>Some other thread {@linkplain Thread#interrupt interrupts} * the current thread; or @@ -167,11 +167,11 @@ public interface RPermitExpirableSemaphoreAsync extends RExpirableAsync { * then one is selected and given the permit that was just released. * * <p>There is no requirement that a thread that releases a permit must - * have acquired that permit by calling {@link #acquire}. + * have acquired that permit by calling {@link #acquireAsync()}. * Correct usage of a semaphore is established by programming convention * in the application. * - * @param permitId + * @param permitId - permit id * @return {@code true} if a permit has been released and {@code false} * otherwise */ @@ -185,13 +185,14 @@ public interface RPermitExpirableSemaphoreAsync extends RExpirableAsync { * then one is selected and given the permit that was just released. * * <p>There is no requirement that a thread that releases a permit must - * have acquired that permit by calling {@link #acquire}. + * have acquired that permit by calling {@link #acquireAsync()}. * Correct usage of a semaphore is established by programming convention * in the application. * * <p>Throws an exception if permit id doesn't exist or has already been release * - * @param permitId + * @param permitId - permit id + * @return void */ RFuture<Void> releaseAsync(String permitId); @@ -203,19 +204,18 @@ public interface RPermitExpirableSemaphoreAsync extends RExpirableAsync { RFuture<Integer> availablePermitsAsync(); /** - * Sets new number of permits. + * Sets number of permits. * - * @param count - number of times {@link #countDown} must be invoked - * before threads can pass through {@link #await} - * @result <code>true</code> if semaphore has not initialized yet, otherwise <code>false</code>. - * + * @param permits - number of permits + * @return <code>true</code> if permits has been set successfully, otherwise <code>false</code>. */ RFuture<Boolean> trySetPermitsAsync(int permits); /** * Increases or decreases the number of available permits by defined value. * - * @param number of permits to add/remove + * @param permits - number of permits to add/remove + * @return void */ RFuture<Void> addPermitsAsync(int permits); diff --git a/redisson/src/main/java/org/redisson/api/RRemoteService.java b/redisson/src/main/java/org/redisson/api/RRemoteService.java index 7c06da6d6..48c2c82cb 100644 --- a/redisson/src/main/java/org/redisson/api/RRemoteService.java +++ b/redisson/src/main/java/org/redisson/api/RRemoteService.java @@ -24,22 +24,21 @@ import java.util.concurrent.TimeUnit; * <b>1. Server side instance (worker instance).</b> Register object with RRemoteService instance. * <p> * <code> - * RRemoteService remoteService = redisson.getRemoteService();<br/> - * <br/> - * // register remote service before any remote invocation<br/> + * RRemoteService remoteService = redisson.getRemoteService();<br> + * <br> + * // register remote service before any remote invocation<br> * remoteService.register(SomeServiceInterface.class, someServiceImpl); * </code> * <p> * <b>2. Client side instance.</b> Invokes method remotely. * <p> * <code> - * RRemoteService remoteService = redisson.getRemoteService();<br/> - * SomeServiceInterface service = remoteService.get(SomeServiceInterface.class);<br/> - * <br/> + * RRemoteService remoteService = redisson.getRemoteService();<br> + * SomeServiceInterface service = remoteService.get(SomeServiceInterface.class);<br> + * <br> * String result = service.doSomeStuff(1L, "secondParam", new AnyParam()); * </code> * <p> - * <p> * There are two timeouts during execution: * <p> * <b>Acknowledge (Ack) timeout.</b>Client side instance waits for acknowledge message from Server side instance. @@ -60,18 +59,20 @@ public interface RRemoteService { /** * Register remote service with single worker - * - * @param remoteInterface - * @param object + * + * @param <T> type of remote service + * @param remoteInterface - remote service interface + * @param object - remote service object */ <T> void register(Class<T> remoteInterface, T object); /** * Register remote service with custom workers amount - * - * @param remoteInterface - * @param object - * @param workersAmount + * + * @param <T> type of remote service + * @param remoteInterface - remote service interface + * @param object - remote service object + * @param workersAmount - workers amount */ <T> void register(Class<T> remoteInterface, T object, int workersAmount); @@ -79,10 +80,11 @@ public interface RRemoteService { * Register remote service with custom workers amount * and executor for running them * - * @param remoteInterface - * @param object - * @param workers - * @param executor + * @param <T> type of remote service + * @param remoteInterface - remote service interface + * @param object - remote service object + * @param workers - workers amount + * @param executor - executor service */ <T> void register(Class<T> remoteInterface, T object, int workers, ExecutorService executor); @@ -97,8 +99,9 @@ public interface RRemoteService { * @see RemoteInvocationOptions#defaults() * @see #get(Class, RemoteInvocationOptions) * - * @param remoteInterface - * @return + * @param <T> type of remote service + * @param remoteInterface - remote service interface + * @return remote service instance */ <T> T get(Class<T> remoteInterface); @@ -115,10 +118,11 @@ public interface RRemoteService { * @see RemoteInvocationOptions#defaults() * @see #get(Class, RemoteInvocationOptions) * - * @param remoteInterface + * @param <T> type of remote service + * @param remoteInterface - remote service interface * @param executionTimeout - invocation timeout - * @param executionTimeUnit - * @return + * @param executionTimeUnit - time unit + * @return remote service instance */ <T> T get(Class<T> remoteInterface, long executionTimeout, TimeUnit executionTimeUnit); @@ -135,13 +139,14 @@ public interface RRemoteService { * * @see RemoteInvocationOptions * @see #get(Class, RemoteInvocationOptions) - * - * @param remoteInterface + * + * @param <T> type of remote service + * @param remoteInterface - remote service interface * @param executionTimeout - invocation timeout - * @param executionTimeUnit + * @param executionTimeUnit - time unit * @param ackTimeout - ack timeout - * @param ackTimeUnit - * @return + * @param ackTimeUnit - time unit + * @return remote service object */ <T> T get(Class<T> remoteInterface, long executionTimeout, TimeUnit executionTimeUnit, long ackTimeout, TimeUnit ackTimeUnit); @@ -154,6 +159,11 @@ public interface RRemoteService { * or else IllegalArgumentException will be thrown. * * @see RemoteInvocationOptions + * + * @param <T> type of remote service + * @param remoteInterface - remote service interface + * @param options - service options + * @return remote service object */ <T> T get(Class<T> remoteInterface, RemoteInvocationOptions options); diff --git a/redisson/src/main/java/org/redisson/api/RScheduledExecutorService.java b/redisson/src/main/java/org/redisson/api/RScheduledExecutorService.java index 17a1da1c7..32dc52da7 100644 --- a/redisson/src/main/java/org/redisson/api/RScheduledExecutorService.java +++ b/redisson/src/main/java/org/redisson/api/RScheduledExecutorService.java @@ -33,8 +33,8 @@ public interface RScheduledExecutorService extends RExecutorService, ScheduledEx * * @see RScheduledFuture#getTaskId() * - * @param taskId - * @return + * @param taskId - id of task + * @return <code>true</code> if task has been canceled successfully */ boolean cancelScheduledTask(String taskId); @@ -47,9 +47,9 @@ public interface RScheduledExecutorService extends RExecutorService, ScheduledEx * takes longer than its period, then subsequent executions * may start late, but will not concurrently execute. * - * @param command the task to execute - * @param cron schedule object - * @return + * @param task - command the task to execute + * @param cronSchedule- cron schedule object + * @return future object */ ScheduledFuture<?> schedule(Runnable task, CronSchedule cronSchedule); diff --git a/redisson/src/main/java/org/redisson/api/RScheduledExecutorServiceAsync.java b/redisson/src/main/java/org/redisson/api/RScheduledExecutorServiceAsync.java index 22fc1bb60..13de21ea5 100644 --- a/redisson/src/main/java/org/redisson/api/RScheduledExecutorServiceAsync.java +++ b/redisson/src/main/java/org/redisson/api/RScheduledExecutorServiceAsync.java @@ -32,7 +32,7 @@ public interface RScheduledExecutorServiceAsync extends RExecutorServiceAsync { * Creates in async mode and executes a one-shot action that becomes enabled * after the given delay. * - * @param command the task to execute + * @param task the task to execute * @param delay the time from now to delay execution * @param unit the time unit of the delay parameter * @return RScheduledFuture with listeners support @@ -43,7 +43,7 @@ public interface RScheduledExecutorServiceAsync extends RExecutorServiceAsync { * Creates in async mode and executes a ScheduledFuture that becomes enabled after the * given delay. * - * @param callable the function to execute + * @param task the function to execute * @param delay the time from now to delay execution * @param unit the time unit of the delay parameter * @param <V> the type of the callable's result @@ -62,7 +62,7 @@ public interface RScheduledExecutorServiceAsync extends RExecutorServiceAsync { * takes longer than its period, then subsequent executions * may start late, but will not concurrently execute. * - * @param command the task to execute + * @param task the task to execute * @param initialDelay the time to delay first execution * @param period the period between successive executions * @param unit the time unit of the initialDelay and period parameters @@ -79,7 +79,7 @@ public interface RScheduledExecutorServiceAsync extends RExecutorServiceAsync { * Otherwise, the task will only terminate via cancellation or * termination of the executor. * - * @param command the task to execute + * @param task the task to execute * @param initialDelay the time to delay first execution * @param delay the delay between the termination of one * execution and the commencement of the next @@ -97,8 +97,8 @@ public interface RScheduledExecutorServiceAsync extends RExecutorServiceAsync { * takes longer than its period, then subsequent executions * may start late, but will not concurrently execute. * - * @param command the task to execute - * @param cron schedule object + * @param task the task to execute + * @param cronSchedule cron schedule object * @return RScheduledFuture with listeners support */ RScheduledFuture<?> scheduleAsync(Runnable task, CronSchedule cronSchedule); diff --git a/redisson/src/main/java/org/redisson/api/RScheduledFuture.java b/redisson/src/main/java/org/redisson/api/RScheduledFuture.java index 4a8fc94e0..7fde6b241 100644 --- a/redisson/src/main/java/org/redisson/api/RScheduledFuture.java +++ b/redisson/src/main/java/org/redisson/api/RScheduledFuture.java @@ -21,7 +21,7 @@ import java.util.concurrent.ScheduledFuture; * * @author Nikita Koksharov * - * @param <V> + * @param <V> value */ public interface RScheduledFuture<V> extends RFuture<V>, ScheduledFuture<V> { @@ -31,7 +31,7 @@ public interface RScheduledFuture<V> extends RFuture<V>, ScheduledFuture<V> { * * @see RScheduledExecutorService#cancelScheduledTask(String) * - * @return + * @return task id */ String getTaskId(); diff --git a/redisson/src/main/java/org/redisson/api/RScoredSortedSet.java b/redisson/src/main/java/org/redisson/api/RScoredSortedSet.java index 4d5d3e716..978ea14df 100644 --- a/redisson/src/main/java/org/redisson/api/RScoredSortedSet.java +++ b/redisson/src/main/java/org/redisson/api/RScoredSortedSet.java @@ -20,6 +20,12 @@ import java.util.Map; import org.redisson.client.protocol.ScoredEntry; +/** + * + * @author Nikita Koksharov + * + * @param <V> value + */ public interface RScoredSortedSet<V> extends RScoredSortedSetAsync<V>, Iterable<V>, RExpirable { public enum Aggregate { @@ -45,7 +51,7 @@ public interface RScoredSortedSet<V> extends RScoredSortedSetAsync<V>, Iterable< /** * Returns rank of value, with the scores ordered from low to high. * - * @param o + * @param o - object * @return rank or <code>null</code> if value does not exist */ Integer rank(V o); @@ -53,7 +59,7 @@ public interface RScoredSortedSet<V> extends RScoredSortedSetAsync<V>, Iterable< /** * Returns rank of value, with the scores ordered from high to low. * - * @param o + * @param o - object * @return rank or <code>null</code> if value does not exist */ Integer revRank(V o); @@ -63,8 +69,8 @@ public interface RScoredSortedSet<V> extends RScoredSortedSetAsync<V>, Iterable< /** * Adds element to this set, overrides previous score if it has been already added. * - * @param score - * @param object + * @param score - object score + * @param object - object itself * @return <code>true</code> if element has added and <code>false</code> if not. */ boolean add(double score, V object); @@ -74,8 +80,8 @@ public interface RScoredSortedSet<V> extends RScoredSortedSetAsync<V>, Iterable< * <p> * Works only with <b>Redis 3.0.2 and higher.</b> * - * @param score - * @param object + * @param score - object score + * @param object - object itself * @return <code>true</code> if element has added and <code>false</code> if not. */ boolean tryAdd(double score, V object); @@ -127,18 +133,18 @@ public interface RScoredSortedSet<V> extends RScoredSortedSetAsync<V>, Iterable< /** * Returns the number of elements with a score between <code>startScore</code> and <code>endScore</code>. * - * @param startScore - * @param startScoreInclusive - * @param endScore - * @param endScoreInclusive - * @return + * @param startScore - start score + * @param startScoreInclusive - start score inclusive + * @param endScore - end score + * @param endScoreInclusive - end score inclusive + * @return count of elements */ Long count(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive); /** * Read all values at once. * - * @return + * @return values */ Collection<V> readAll(); diff --git a/redisson/src/main/java/org/redisson/api/RScoredSortedSetAsync.java b/redisson/src/main/java/org/redisson/api/RScoredSortedSetAsync.java index f4649fcbd..6288b9cc4 100644 --- a/redisson/src/main/java/org/redisson/api/RScoredSortedSetAsync.java +++ b/redisson/src/main/java/org/redisson/api/RScoredSortedSetAsync.java @@ -21,6 +21,12 @@ import java.util.Map; import org.redisson.api.RScoredSortedSet.Aggregate; import org.redisson.client.protocol.ScoredEntry; +/** + * + * @author Nikita Koksharov + * + * @param <V> value + */ public interface RScoredSortedSetAsync<V> extends RExpirableAsync { RFuture<V> pollLastAsync(); @@ -46,8 +52,8 @@ public interface RScoredSortedSetAsync<V> extends RExpirableAsync { /** * Adds element to this set, overrides previous score if it has been already added. * - * @param score - * @param object + * @param score - object score + * @param object - object itself * @return <code>true</code> if element has added and <code>false</code> if not. */ RFuture<Boolean> addAsync(double score, V object); @@ -57,8 +63,8 @@ public interface RScoredSortedSetAsync<V> extends RExpirableAsync { * <p> * Works only with <b>Redis 3.0.2 and higher.</b> * - * @param score - * @param object + * @param score - object score + * @param object - object itself * @return <code>true</code> if element has added and <code>false</code> if not. */ RFuture<Boolean> tryAddAsync(double score, V object); @@ -102,18 +108,18 @@ public interface RScoredSortedSetAsync<V> extends RExpirableAsync { /** * Returns the number of elements with a score between <code>startScore</code> and <code>endScore</code>. * - * @param startScore - * @param startScoreInclusive - * @param endScore - * @param endScoreInclusive - * @return + * @param startScore - start score + * @param startScoreInclusive - start score inclusive + * @param endScore - end score + * @param endScoreInclusive - end score inclusive + * @return count */ RFuture<Long> countAsync(double startScore, boolean startScoreInclusive, double endScore, boolean endScoreInclusive); /** * Read all values at once. * - * @return + * @return values */ RFuture<Collection<V>> readAllAsync(); diff --git a/redisson/src/main/java/org/redisson/api/RSemaphore.java b/redisson/src/main/java/org/redisson/api/RSemaphore.java index 223ceb2a0..12732b07a 100644 --- a/redisson/src/main/java/org/redisson/api/RSemaphore.java +++ b/redisson/src/main/java/org/redisson/api/RSemaphore.java @@ -133,7 +133,7 @@ public interface RSemaphore extends RExpirable, RSemaphoreAsync { * is returned. If the time is less than or equal to zero, the method * will not wait at all. * - * @param timeout the maximum time to wait for a permit + * @param waitTime the maximum time to wait for a permit * @param unit the time unit of the {@code timeout} argument * @return {@code true} if a permit was acquired and {@code false} * if the waiting time elapsed before a permit was acquired @@ -167,7 +167,7 @@ public interface RSemaphore extends RExpirable, RSemaphoreAsync { * is returned. If the time is less than or equal to zero, the method * will not wait at all. * - * @param permits + * @param permits amount * @param waitTime the maximum time to wait for a permit * @param unit the time unit of the {@code timeout} argument * @return {@code true} if a permit was acquired and {@code false} @@ -201,6 +201,8 @@ public interface RSemaphore extends RExpirable, RSemaphoreAsync { * have acquired that permit by calling {@link #acquire}. * Correct usage of a semaphore is established by programming convention * in the application. + * + * @param permits amount */ void release(int permits); @@ -220,17 +222,17 @@ public interface RSemaphore extends RExpirable, RSemaphoreAsync { /** * Use {@link #trySetPermits(int)} + * + * @param permits amount */ @Deprecated void setPermits(int permits); /** - * Sets new number of permits. + * Sets number of permits. * - * @param count - number of times {@link #countDown} must be invoked - * before threads can pass through {@link #await} - * @result <code>true</code> if semaphore has not initialized yet, otherwise <code>false</code>. - * + * @param permits - number of permits + * @return <code>true</code> if permits has been set successfully, otherwise <code>false</code>. */ boolean trySetPermits(int permits); @@ -238,7 +240,7 @@ public interface RSemaphore extends RExpirable, RSemaphoreAsync { * Shrinks the number of available permits by the indicated * reduction. * - * @param reduction the number of permits to remove + * @param permits - reduction the number of permits to remove * @throws IllegalArgumentException if {@code reduction} is negative */ void reducePermits(int permits); diff --git a/redisson/src/main/java/org/redisson/api/RSemaphoreAsync.java b/redisson/src/main/java/org/redisson/api/RSemaphoreAsync.java index 49c9af4ed..371afa72f 100644 --- a/redisson/src/main/java/org/redisson/api/RSemaphoreAsync.java +++ b/redisson/src/main/java/org/redisson/api/RSemaphoreAsync.java @@ -65,6 +65,8 @@ public interface RSemaphoreAsync extends RExpirableAsync { * * <p>Acquires a permit, if one is available and returns immediately, * reducing the number of available permits by one. + * + * @return void * */ RFuture<Void> acquireAsync(); @@ -76,6 +78,7 @@ public interface RSemaphoreAsync extends RExpirableAsync { * * @param permits the number of permits to acquire * @throws IllegalArgumentException if {@code permits} is negative + * @return void */ RFuture<Void> acquireAsync(int permits); @@ -87,9 +90,11 @@ public interface RSemaphoreAsync extends RExpirableAsync { * then one is selected and given the permit that was just released. * * <p>There is no requirement that a thread that releases a permit must - * have acquired that permit by calling {@link #acquire}. + * have acquired that permit by calling {@link #acquireAsync()}. * Correct usage of a semaphore is established by programming convention * in the application. + * + * @return void */ RFuture<Void> releaseAsync(); @@ -101,25 +106,29 @@ public interface RSemaphoreAsync extends RExpirableAsync { * acquire a permits, then next threads is selected and tries to acquire the permits that was just released. * * <p>There is no requirement that a thread that releases a permits must - * have acquired that permit by calling {@link #acquire}. + * have acquired that permit by calling {@link #acquireAsync()}. * Correct usage of a semaphore is established by programming convention * in the application. + * + * @param permits amount + * @return void */ RFuture<Void> releaseAsync(int permits); /** * Use {@link #trySetPermitsAsync(int)} + * + * @param permits amount + * @return void */ @Deprecated RFuture<Void> setPermitsAsync(int permits); /** - * Sets new number of permits. + * Sets number of permits. * - * @param count - number of times {@link #countDown} must be invoked - * before threads can pass through {@link #await} - * @result <code>true</code> if semaphore has not initialized yet, otherwise <code>false</code>. - * + * @param permits - number of permits + * @return <code>true</code> if permits has been set successfully, otherwise <code>false</code>. */ RFuture<Boolean> trySetPermitsAsync(int permits); @@ -155,12 +164,11 @@ public interface RSemaphoreAsync extends RExpirableAsync { * is returned. If the time is less than or equal to zero, the method * will not wait at all. * - * @param permits + * @param permits amount * @param waitTime the maximum time to wait for a available permits * @param unit the time unit of the {@code timeout} argument * @return {@code true} if a permit was acquired and {@code false} * if the waiting time elapsed before a permit was acquired - * @throws InterruptedException if the current thread is interrupted */ RFuture<Boolean> tryAcquireAsync(int permits, long waitTime, TimeUnit unit); @@ -168,10 +176,11 @@ public interface RSemaphoreAsync extends RExpirableAsync { * Shrinks the number of available permits by the indicated * reduction. This method can be useful in subclasses that use * semaphores to track resources that become unavailable. This - * method differs from {@code acquire} in that it does not block + * method differs from {@link #acquireAsync()} in that it does not block * waiting for permits to become available. * - * @param reduction the number of permits to remove + * @param permits - reduction the number of permits to remove + * @return void * @throws IllegalArgumentException if {@code reduction} is negative */ RFuture<Void> reducePermitsAsync(int permits); diff --git a/redisson/src/main/java/org/redisson/executor/CronExpression.java b/redisson/src/main/java/org/redisson/executor/CronExpression.java index f0588c177..d5016af02 100644 --- a/redisson/src/main/java/org/redisson/executor/CronExpression.java +++ b/redisson/src/main/java/org/redisson/executor/CronExpression.java @@ -47,167 +47,6 @@ import java.util.TimeZone; import java.util.TreeSet; /** - * Provides a parser and evaluator for unix-like cron expressions. Cron - * expressions provide the ability to specify complex time combinations such as - * "At 8:00am every Monday through Friday" or "At 1:30am every - * last Friday of the month". - * <P> - * Cron expressions are comprised of 6 required fields and one optional field - * separated by white space. The fields respectively are described as follows: - * - * <table cellspacing="8"> - * <tr> - * <th align="left">Field Name</th> - * <th align="left"> </th> - * <th align="left">Allowed Values</th> - * <th align="left"> </th> - * <th align="left">Allowed Special Characters</th> - * </tr> - * <tr> - * <td align="left"><code>Seconds</code></td> - * <td align="left"> </th> - * <td align="left"><code>0-59</code></td> - * <td align="left"> </th> - * <td align="left"><code>, - * /</code></td> - * </tr> - * <tr> - * <td align="left"><code>Minutes</code></td> - * <td align="left"> </th> - * <td align="left"><code>0-59</code></td> - * <td align="left"> </th> - * <td align="left"><code>, - * /</code></td> - * </tr> - * <tr> - * <td align="left"><code>Hours</code></td> - * <td align="left"> </th> - * <td align="left"><code>0-23</code></td> - * <td align="left"> </th> - * <td align="left"><code>, - * /</code></td> - * </tr> - * <tr> - * <td align="left"><code>Day-of-month</code></td> - * <td align="left"> </th> - * <td align="left"><code>1-31</code></td> - * <td align="left"> </th> - * <td align="left"><code>, - * ? / L W</code></td> - * </tr> - * <tr> - * <td align="left"><code>Month</code></td> - * <td align="left"> </th> - * <td align="left"><code>0-11 or JAN-DEC</code></td> - * <td align="left"> </th> - * <td align="left"><code>, - * /</code></td> - * </tr> - * <tr> - * <td align="left"><code>Day-of-Week</code></td> - * <td align="left"> </th> - * <td align="left"><code>1-7 or SUN-SAT</code></td> - * <td align="left"> </th> - * <td align="left"><code>, - * ? / L #</code></td> - * </tr> - * <tr> - * <td align="left"><code>Year (Optional)</code></td> - * <td align="left"> </th> - * <td align="left"><code>empty, 1970-2199</code></td> - * <td align="left"> </th> - * <td align="left"><code>, - * /</code></td> - * </tr> - * </table> - * <P> - * The '*' character is used to specify all values. For example, "*" - * in the minute field means "every minute". - * <P> - * The '?' character is allowed for the day-of-month and day-of-week fields. It - * is used to specify 'no specific value'. This is useful when you need to - * specify something in one of the two fields, but not the other. - * <P> - * The '-' character is used to specify ranges For example "10-12" in - * the hour field means "the hours 10, 11 and 12". - * <P> - * The ',' character is used to specify additional values. For example - * "MON,WED,FRI" in the day-of-week field means "the days Monday, - * Wednesday, and Friday". - * <P> - * The '/' character is used to specify increments. For example "0/15" - * in the seconds field means "the seconds 0, 15, 30, and 45". And - * "5/15" in the seconds field means "the seconds 5, 20, 35, and - * 50". Specifying '*' before the '/' is equivalent to specifying 0 is - * the value to start with. Essentially, for each field in the expression, there - * is a set of numbers that can be turned on or off. For seconds and minutes, - * the numbers range from 0 to 59. For hours 0 to 23, for days of the month 0 to - * 31, and for months 0 to 11 (JAN to DEC). The "/" character simply helps you turn - * on every "nth" value in the given set. Thus "7/6" in the - * month field only turns on month "7", it does NOT mean every 6th - * month, please note that subtlety. - * <P> - * The 'L' character is allowed for the day-of-month and day-of-week fields. - * This character is short-hand for "last", but it has different - * meaning in each of the two fields. For example, the value "L" in - * the day-of-month field means "the last day of the month" - day 31 - * for January, day 28 for February on non-leap years. If used in the - * day-of-week field by itself, it simply means "7" or - * "SAT". But if used in the day-of-week field after another value, it - * means "the last xxx day of the month" - for example "6L" - * means "the last friday of the month". You can also specify an offset - * from the last day of the month, such as "L-3" which would mean the third-to-last - * day of the calendar month. <i>When using the 'L' option, it is important not to - * specify lists, or ranges of values, as you'll get confusing/unexpected results.</i> - * <P> - * The 'W' character is allowed for the day-of-month field. This character - * is used to specify the weekday (Monday-Friday) nearest the given day. As an - * example, if you were to specify "15W" as the value for the - * day-of-month field, the meaning is: "the nearest weekday to the 15th of - * the month". So if the 15th is a Saturday, the trigger will fire on - * Friday the 14th. If the 15th is a Sunday, the trigger will fire on Monday the - * 16th. If the 15th is a Tuesday, then it will fire on Tuesday the 15th. - * However if you specify "1W" as the value for day-of-month, and the - * 1st is a Saturday, the trigger will fire on Monday the 3rd, as it will not - * 'jump' over the boundary of a month's days. The 'W' character can only be - * specified when the day-of-month is a single day, not a range or list of days. - * <P> - * The 'L' and 'W' characters can also be combined for the day-of-month - * expression to yield 'LW', which translates to "last weekday of the - * month". - * <P> - * The '#' character is allowed for the day-of-week field. This character is - * used to specify "the nth" XXX day of the month. For example, the - * value of "6#3" in the day-of-week field means the third Friday of - * the month (day 6 = Friday and "#3" = the 3rd one in the month). - * Other examples: "2#1" = the first Monday of the month and - * "4#5" = the fifth Wednesday of the month. Note that if you specify - * "#5" and there is not 5 of the given day-of-week in the month, then - * no firing will occur that month. If the '#' character is used, there can - * only be one expression in the day-of-week field ("3#1,6#3" is - * not valid, since there are two expressions). - * <P> - * <!--The 'C' character is allowed for the day-of-month and day-of-week fields. - * This character is short-hand for "calendar". This means values are - * calculated against the associated calendar, if any. If no calendar is - * associated, then it is equivalent to having an all-inclusive calendar. A - * value of "5C" in the day-of-month field means "the first day included by the - * calendar on or after the 5th". A value of "1C" in the day-of-week field - * means "the first day included by the calendar on or after Sunday".--> - * <P> - * The legal characters and the names of months and days of the week are not - * case sensitive. - * - * <p> - * <b>NOTES:</b> - * <ul> - * <li>Support for specifying both a day-of-week and a day-of-month value is - * not complete (you'll need to use the '?' character in one of these fields). - * </li> - * <li>Overflowing ranges is supported - that is, having a larger number on - * the left hand side than the right. You might do 22-2 to catch 10 o'clock - * at night until 2 o'clock in the morning, or you might have NOV-FEB. It is - * very important to note that overuse of overflowing ranges creates ranges - * that don't make sense and no effort has been made to determine which - * interpretation CronExpression chooses. An example would be - * "0 0 14-6 ? * FRI-MON". </li> - * </ul> - * </p> - * - * * @author Sharada Jambula, James House * @author Contributions from Mads Henderson * @author Refactoring from CronTrigger to CronExpression by Aaron Craven