DATAREDIS-359 - Fix redis javadoc generation.

This commit is contained in:
Thomas Darimont
2014-11-27 23:11:26 +01:00
parent 7ea72f3682
commit ca469958ef
21 changed files with 138 additions and 95 deletions

View File

@@ -75,8 +75,6 @@ abstract public class FutureResult<T> {
/**
* Indicates if this result is the status of an operation. Typically status results will be discarded on conversion.
*
* @return true if this is a status result (i.e. OK)
*/
public void setStatus(boolean status) {
this.status = status;

View File

@@ -25,16 +25,18 @@ public interface RedisConnectionCommands {
/**
* Select the DB with given positive {@code dbIndex}.
* <p>
* See http://redis.io/commands/select
*
* @see http://redis.io/commands/select
* @param dbIndex
*/
void select(int dbIndex);
/**
* Returns {@code message} via server roundtrip.
* <p>
* See http://redis.io/commands/echo
*
* @see http://redis.io/commands/echo
* @param message
* @return
*/
@@ -42,8 +44,9 @@ public interface RedisConnectionCommands {
/**
* Test connection.
* <p>
* See http://redis.io/commands/ping
*
* @see http://redis.io/commands/ping
* @return Server response message - usually {@literal PONG}.
*/
String ping();

View File

@@ -24,7 +24,7 @@ import org.springframework.dao.InvalidDataAccessResourceUsageException;
/**
* Exception thrown when executing/closing a pipeline that contains one or multiple invalid/incorrect statements. The
* exception might also contain the pipeline result (if the driver returns it), allowing for analysis and tracing.
* <p/>
* <p>
* Typically, the first exception returned by the pipeline is used as the <i>cause</i> of this exception for easier
* debugging.
*

View File

@@ -48,7 +48,7 @@ public interface RedisPubSubCommands {
/**
* Subscribes the connection to the given channels. Once subscribed, a connection enters listening mode and can only
* subscribe to other channels or unsubscribe. No other commands are accepted until the connection is unsubscribed.
* <p/>
* <p>
* Note that this operation is blocking and the current thread starts waiting for new messages immediately.
*
* @param listener message listener
@@ -60,7 +60,7 @@ public interface RedisPubSubCommands {
* Subscribes the connection to all channels matching the given patterns. Once subscribed, a connection enters
* listening mode and can only subscribe to other channels or unsubscribe. No other commands are accepted until the
* connection is unsubscribed.
* <p/>
* <p>
* Note that this operation is blocking and the current thread starts waiting for new messages immediately.
*
* @param listener message listener

View File

@@ -28,23 +28,24 @@ public interface RedisScriptingCommands {
/**
* Flush lua script cache.
*
* @see http://redis.io/commands/script-flush
* <p>
* See http://redis.io/commands/script-flush
*/
void scriptFlush();
/**
* Kill current lua script execution.
*
* @see http://redis.io/commands/script-kill
* <p>
* See http://redis.io/commands/script-kill
*/
void scriptKill();
/**
* Load lua script into scripts cache, without executing it.<br />
* Load lua script into scripts cache, without executing it.<br>
* Execute the script by calling {@link #evalSha(String, ReturnType, int, byte[])}.
* <p>
* See http://redis.io/commands/script-load
*
* @see http://redis.io/commands/script-load
* @param script
* @return
*/
@@ -52,8 +53,9 @@ public interface RedisScriptingCommands {
/**
* Check if given {@code scriptShas} exist in script cache.
* <p>
* See http://redis.io/commands/script-exits
*
* @see http://redis.io/commands/script-exits
* @param scriptShas
* @return one entry per given scriptSha in returned list.
*/
@@ -61,8 +63,9 @@ public interface RedisScriptingCommands {
/**
* Evaluate given {@code script}.
* <p>
* See http://redis.io/commands/eval
*
* @see http://redis.io/commands/eval
* @param script
* @param returnType
* @param numKeys
@@ -73,9 +76,10 @@ public interface RedisScriptingCommands {
/**
* Evaluate given {@code scriptSha}.
* <p>
* See http://redis.io/commands/evalsha
*
* @see http://redis.io/commands/evalsha
* @param script
* @param scriptSha
* @param returnType
* @param numKeys
* @param keysAndArgs
@@ -85,9 +89,10 @@ public interface RedisScriptingCommands {
/**
* Evaluate given {@code scriptSha}.
* <p>
* See http://redis.io/commands/evalsha
*
* @see http://redis.io/commands/evalsha
* @param script
* @param scriptSha
* @param returnType
* @param numKeys
* @param keysAndArgs

View File

@@ -35,8 +35,9 @@ public interface RedisServerCommands {
/**
* Start an {@literal Append Only File} rewrite process on server.
* <p>
* See http://redis.io/commands/bgrewriteaof
*
* @see http://redis.io/commands/bgrewriteaof
* @deprecated As of 1.3, use {@link #bgReWriteAof}.
*/
@Deprecated
@@ -44,53 +45,56 @@ public interface RedisServerCommands {
/**
* Start an {@literal Append Only File} rewrite process on server.
* <p>
* See http://redis.io/commands/bgrewriteaof
*
* @see http://redis.io/commands/bgrewriteaof
* @since 1.3
*/
void bgReWriteAof();
/**
* Start background saving of db on server.
*
* @see http://redis.io/commands/bgsave
* <p>
* See http://redis.io/commands/bgsave
*/
void bgSave();
/**
* Get time of last {@link #bgSave()} operation in seconds.
* <p>
* See http://redis.io/commands/lastsave
*
* @see http://redis.io/commands/lastsave
* @return
*/
Long lastSave();
/**
* Synchronous save current db snapshot on server.
*
* @see http://redis.io/commands/save
* <p>
* See http://redis.io/commands/save
*/
void save();
/**
* Get the total number of available keys in currently selected database.
* <p>
* See http://redis.io/commands/dbsize
*
* @see http://redis.io/commands/dbsize
* @return
*/
Long dbSize();
/**
* Delete all keys of the currently selected database.
*
* @see http://redis.io/commands/flushdb
* <p>
* See http://redis.io/commands/flushdb
*/
void flushDb();
/**
* Delete all <b>all keys</b> from <b>all databases</b>.
*
* @see http://redis.io/commands/flushall
* <p>
* See http://redis.io/commands/flushall
*/
void flushAll();
@@ -101,58 +105,63 @@ public interface RedisServerCommands {
* <li>cpu utilization</li>
* <li>replication</li>
* </ul>
* <p>
* See http://redis.io/commands/info
*
* @see http://redis.io/commands/info
* @return
*/
Properties info();
/**
* Load server information for given {@code selection}.
* <p>
* See http://redis.io/commands/info
*
* @see http://redis.io/commands/info
* @return
*/
Properties info(String section);
/**
* Shutdown server.
*
* @see http://redis.io/commands/shutdown
* <p>
* See http://redis.io/commands/shutdown
*/
void shutdown();
/**
* Shutdown server.
* <p>
* See http://redis.io/commands/shutdown
*
* @see http://redis.io/commands/shutdown
* @since 1.3
*/
void shutdown(ShutdownOption option);
/**
* Load configuration parameters for given {@code pattern} from server.
* <p>
* See http://redis.io/commands/config-get
*
* @see http://redis.io/commands/config-get
* @param pattern
* @return
*/
List<String> getConfig(String pattern);
/**
* Set server configuration for {@code key} to {@code value}.
* Set server configuration for {@code param} to {@code value}.
* <p>
* See http://redis.io/commands/config-set
*
* @see http://redis.io/commands/config-set
* @param param
* @param value
*/
void setConfig(String param, String value);
/**
* Reset statistic counters on server. <br />
* Reset statistic counters on server. <br>
* Counters can be retrieved using {@link #info()}.
*
* @see http://redis.io/commands/config-resetstat
* <p>
* See http://redis.io/commands/config-resetstat
*/
void resetConfigStats();
@@ -165,7 +174,7 @@ public interface RedisServerCommands {
Long time();
/**
* <<<<<<< HEAD Closes a given client connection identified by {@literal ip:port}.
* Closes a given client connection identified by {@literal host:port}.
*
* @param host of connection to close.
* @param port of connection to close
@@ -176,14 +185,16 @@ public interface RedisServerCommands {
/**
* Assign given name to current connection.
*
* @param name
* @since 1.3
*/
void setClientName(byte[] name);
/**
* Returns the name of the current connection.
* <p>
* See http://redis.io/commands/client-getname
*
* @see http://redis.io/commands/client-getname
* @return
* @since 1.3
*/
@@ -191,28 +202,31 @@ public interface RedisServerCommands {
/**
* Request information and statistics about connected clients.
* <p>
* See http://redis.io/commands/client-list
*
* @return {@link List} of {@link RedisClientInfo} objects.
* @since 1.3
* @see http://redis.io/commands/client-list
*/
List<RedisClientInfo> getClientList();
/**
* Change redis replication setting to new master.
* <p>
* See http://redis.io/commands/slaveof
*
* @param host
* @param port
* @since 1.3
* @see http://redis.io/commands/slaveof
*/
void slaveOf(String host, int port);
/**
* Change server into master.
* <p>
* See http://redis.io/commands/slaveof
*
* @since 1.3
* @see http://redis.io/commands/slaveof
*/
void slaveOfNoOne();
}

View File

@@ -62,7 +62,7 @@ public interface RedisSetCommands {
byte[] sPop(byte[] key);
/**
* Move {@code value} from {@code srcKey} to {@destKey}
* Move {@code value} from {@code srcKey} to {@code destKey}
* <p>
* See http://redis.io/commands/smove
*

View File

@@ -26,42 +26,43 @@ import java.util.List;
public interface RedisTxCommands {
/**
* Mark the start of a transaction block. <br />
* Mark the start of a transaction block. <br>
* Commands will be queued and can then be executed by calling {@link #exec()} or rolled back using {@link #discard()}
* .
*
* @see http://redis.io/commands/multi
* <p>
* See http://redis.io/commands/multi
*/
void multi();
/**
* Executes all queued commands in a transaction started with {@link #multi()}. <br />
* Executes all queued commands in a transaction started with {@link #multi()}. <br>
* If used along with {@link #watch(byte[])} the operation will fail if any of watched keys has been modified.
* <p>
* See http://redis.io/commands/exec
*
* @see http://redis.io/commands/exec
* @return List of replies for each executed command.
*/
List<Object> exec();
/**
* Discard all commands issued after {@link #multi()}.
*
* @see http://redis.io/commands/discard
* <p>
* See http://redis.io/commands/discard
*/
void discard();
/**
* Watch given {@code keys} for modifications during transaction started with {@link #multi()}.
* <p>
* See http://redis.io/commands/watch
*
* @see http://redis.io/commands/watch
* @param keys
*/
void watch(byte[]... keys);
/**
* Flushes all the previously {@link #watch(byte[])} keys.
*
* @see http://redis.io/commands/unwatch
* <p>
* See http://redis.io/commands/unwatch
*/
void unwatch();
}

View File

@@ -194,7 +194,7 @@ public interface RedisZSetCommands {
Set<Tuple> zRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count);
/**
* Get elements in range from {@code begin} to {@code end} from sorted set ordered high -> low.
* Get elements in range from {@code begin} to {@code end} from sorted set ordered from high to low.
* <p>
* See http://redis.io/commands/zrevrange
*
@@ -206,7 +206,7 @@ public interface RedisZSetCommands {
Set<byte[]> zRevRange(byte[] key, long begin, long end);
/**
* Get set of {@link Tuple}s in range from {@code begin} to {@code end} from sorted set ordered high -> low.
* Get set of {@link Tuple}s in range from {@code begin} to {@code end} from sorted set ordered from high to low.
* <p>
* See http://redis.io/commands/zrevrange
*
@@ -218,7 +218,7 @@ public interface RedisZSetCommands {
Set<Tuple> zRevRangeWithScores(byte[] key, long begin, long end);
/**
* Get elements where score is between {@code min} and {@code max} from sorted set ordered high -> low.
* Get elements where score is between {@code min} and {@code max} from sorted set ordered from high to low.
* <p>
* See http://redis.io/commands/zrevrange
*
@@ -230,7 +230,8 @@ public interface RedisZSetCommands {
Set<byte[]> zRevRangeByScore(byte[] key, double min, double max);
/**
* Get set of {@link Tuple} where score is between {@code min} and {@code max} from sorted set ordered high -> low.
* Get set of {@link Tuple} where score is between {@code min} and {@code max} from sorted set ordered from high to
* low.
* <p>
* See http://redis.io/commands/zrevrange
*

View File

@@ -25,19 +25,29 @@ import java.util.List;
*/
public enum ReturnType {
/** Returned as Boolean **/
/**
* Returned as Boolean
*/
BOOLEAN,
/** Returned as Long **/
/**
* Returned as {@link Long}
*/
INTEGER,
/** Returned as List<Object> **/
/**
* Returned as {@link List<Object>}
*/
MULTI,
/** Returned as byte[] **/
/**
* Returned as {@literal byte[]}
*/
STATUS,
/** Returned as byte[] **/
/**
* Returned as {@literal byte[]}
*/
VALUE;
public static ReturnType fromJavaType(Class<?> javaType) {

View File

@@ -101,10 +101,11 @@ public interface StringRedisConnection extends RedisConnection {
/**
* Set the {@code value} and expiration in {@code milliseconds} for {@code key}.
* <p>
* See http://redis.io/commands/psetex
*
* @see http://redis.io/commands/psetex
* @param key
* @param seconds
* @param milliseconds
* @param value
* @since 1.3
*/
@@ -311,7 +312,7 @@ public interface StringRedisConnection extends RedisConnection {
*
* @param name
* @see #setClientName(byte[])
* @sice 1.3
* @since 1.3
*/
void setClientName(String name);

View File

@@ -2,7 +2,7 @@
* Connection package providing low-level abstractions for interacting with
* the various Redis 'drivers'/libraries.
*
* <p/>Performs exception translation between the underlying library exceptions to Spring's DAO hierarchy.
* <p>Performs exception translation between the underlying library exceptions to Spring's DAO hierarchy.
*/
package org.springframework.data.redis.connection;

View File

@@ -57,9 +57,9 @@ public interface BoundHashOperations<H, HK, HV> extends BoundKeyOperations<H> {
Map<HK, HV> entries();
/**
* @since 1.4
* @param key
* @param options
* @return
* @since 1.4
*/
Cursor<Map.Entry<HK, HV>> scan(ScanOptions options);
}

View File

@@ -25,7 +25,7 @@ import org.springframework.data.redis.connection.DataType;
* <p>
* As the rest of the APIs, if the underlying connection is pipelined or queued/in multi mode, all methods will return
* null.
* </p>
* <p>
*
* @author Costin Leau
* @author Christoph Strobl
@@ -78,7 +78,7 @@ public interface BoundKeyOperations<K> {
Boolean persist();
/**
* Renames the key. <br />
* Renames the key. <br>
* <b>Note:</b> The new name for empty collections will be propagated on add of first element.
*
* @param newKey new key

View File

@@ -20,7 +20,7 @@ import java.util.List;
/**
* Mapper translating Redis bulk value responses (typically returned by a sort query) to actual objects. Implementations
* of this interface do not have to worry about exception or connection handling.
* <p/>
* <p>
* Typically used by {@link RedisTemplate} <tt>sort</tt> methods.
*
* @author Costin Leau

View File

@@ -26,7 +26,7 @@ import java.util.Iterator;
public interface Cursor<T> extends Iterator<T>, Closeable {
/**
* Get the reference cursor. <br />
* Get the reference cursor. <br>
* <strong>NOTE:</strong> the id might change while iterating items.
*
* @return

View File

@@ -33,7 +33,7 @@ public interface HyperLogLogOperations<K, V> {
/**
* Gets the current number of elements within the {@literal key}.
*
* @param keys must not be {@literal null) or {@literal empty}.
* @param keys must not be {@literal null} or {@literal empty}.
* @return
*/
Long size(K... keys);
@@ -42,7 +42,7 @@ public interface HyperLogLogOperations<K, V> {
* Merges all values of given {@literal sourceKeys} into {@literal destination} key.
*
* @param destination key of HyperLogLog to move source keys into.
* @param sourceKeys must not be {@literal null) or {@literal empty}.
* @param sourceKeys must not be {@literal null} or {@literal empty}.
*/
Long union(K destination, K... sourceKeys);

View File

@@ -324,7 +324,7 @@ public enum RedisCommand {
* Validates given argument count against expected ones.
*
* @param nrArguments
* @throws {@link IllegalArgumentException} in case argument count does not match expected.
* @exception IllegalArgumentException in case argument count does not match expected.
*/
public void validateArgumentCount(int nrArguments) {

View File

@@ -15,7 +15,12 @@
*/
package org.springframework.data.redis.listener;
import java.util.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.Executor;
@@ -30,7 +35,12 @@ import org.springframework.context.SmartLifecycle;
import org.springframework.core.task.SimpleAsyncTaskExecutor;
import org.springframework.core.task.TaskExecutor;
import org.springframework.data.redis.RedisConnectionFailureException;
import org.springframework.data.redis.connection.*;
import org.springframework.data.redis.connection.ConnectionUtils;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.Subscription;
import org.springframework.data.redis.connection.util.ByteArrayWrapper;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
@@ -43,13 +53,13 @@ import org.springframework.util.ErrorHandler;
/**
* Container providing asynchronous behaviour for Redis message listeners. Handles the low level details of listening,
* converting and message dispatching.
* <p/>
* <p>
* As oppose to the low level Redis (one connection per subscription), the container uses only one connection that is
* 'multiplexed' for all registered listeners, the message dispatch being done through the task executor.
* <p/>
* <p>
* Note the container uses the connection in a lazy fashion (the connection is used only if at least one listener is
* configured).
* <p/>
* <p>
* Adding and removing listeners at the same time has undefined results. It is strongly recommended to synchronize/order
* these methods accordingly.
*
@@ -313,7 +323,7 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab
* Sets the task execution used for subscribing to Redis channels. By default, if no executor is set, the
* {@link #setTaskExecutor(Executor)} will be used. In some cases, this might be undersired as the listening to the
* connection is a long running task.
* <p/>
* <p>
* Note: This implementation uses at most one long running thread (depending on whether there are any listeners
* registered or not) and up to two threads during the initial registration.
*
@@ -343,7 +353,7 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab
/**
* Attaches the given listeners (and their topics) to the container.
* <p/>
* <p>
* Note: it's possible to call this method while the container is running forcing a reinitialization of the container.
* Note however that this might cause some messages to be lost (while the container reinitializes) - hence calling
* this method at runtime is considered advanced usage.
@@ -380,7 +390,7 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab
/**
* Removes a message listener from the given topics. If the container is running, the listener stops receiving
* (matching) messages as soon as possible.
* <p/>
* <p>
* Note that this method obeys the Redis (p)unsubscribe semantics - meaning an empty/null collection will remove
* listener from all channels. Similarly a null listener will unsubscribe all listeners from the given topic.
*
@@ -394,7 +404,7 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab
/**
* Removes a message listener from the from the given topic. If the container is running, the listener stops receiving
* (matching) messages as soon as possible.
* <p/>
* <p>
* Note that this method obeys the Redis (p)unsubscribe semantics - meaning an empty/null collection will remove
* listener from all channels. Similarly a null listener will unsubscribe all listeners from the given topic.
*

View File

@@ -27,7 +27,7 @@ import com.fasterxml.jackson.databind.type.TypeFactory;
/**
* {@link RedisSerializer} that can read and write JSON using <a
* href="https://github.com/FasterXML/jackson-core">Jackson's</a> and <a
* href="https://github.com/FasterXML/jackson-databind">Jackson Databind<a> {@link ObjectMapper}.
* href="https://github.com/FasterXML/jackson-databind">Jackson Databind</a> {@link ObjectMapper}.
* <p>
* This converter can be used to bind to typed beans, or untyped {@link java.util.HashMap HashMap} instances.
* <b>Note:</b>Null objects are serialized as empty arrays and vice versa.
@@ -55,7 +55,7 @@ public class Jackson2JsonRedisSerializer<T> implements RedisSerializer<T> {
/**
* Creates a new {@link Jackson2JsonRedisSerializer} for the given target {@link JavaType}.
*
* @param type
* @param javaType
*/
public Jackson2JsonRedisSerializer(JavaType javaType) {
this.javaType = javaType;

View File

@@ -22,9 +22,9 @@ import org.springframework.util.Assert;
/**
* Simple String to byte[] (and back) serializer. Converts Strings into bytes and vice-versa using the specified charset
* (by default UTF-8).
* <p/>
* <p>
* Useful when the interaction with the Redis happens mainly through Strings.
* <p/>
* <p>
* Does not perform any null conversion since empty strings are valid keys/values.
*
* @author Costin Leau