Skip to content

Commit 5624f12

Browse files
committed
Bundle Javadoc with Antora documentation site.
Closes #2950
1 parent 8b5f29e commit 5624f12

20 files changed

+95
-83
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ work
1919
build/
2020
node_modules
2121
node
22-
package.json
2322
package-lock.json
2423
.mvn/.gradle-enterprise

package.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"dependencies": {
3+
"antora": "3.2.0-alpha.6",
4+
"@antora/atlas-extension": "1.0.0-alpha.2",
5+
"@antora/collector-extension": "1.0.0-alpha.7",
6+
"@asciidoctor/tabs": "1.0.0-beta.6",
7+
"@springio/antora-extensions": "1.13.0",
8+
"@springio/asciidoctor-extensions": "1.0.0-alpha.11"
9+
}
10+
}

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@
367367
<build>
368368
<plugins>
369369
<plugin>
370-
<groupId>io.spring.maven.antora</groupId>
370+
<groupId>org.antora</groupId>
371371
<artifactId>antora-maven-plugin</artifactId>
372372
</plugin>
373373
</plugins>

src/main/antora/antora-playbook.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
# The purpose of this Antora playbook is to build the docs in the current branch.
44
antora:
55
extensions:
6-
- '@antora/collector-extension'
7-
- require: '@springio/antora-extensions/root-component-extension'
6+
- require: '@springio/antora-extensions'
87
root_component_name: 'data-redis'
98
site:
109
title: Spring Data Redis
@@ -22,13 +21,12 @@ content:
2221
start_path: src/main/antora
2322
asciidoc:
2423
attributes:
25-
page-pagination: ''
2624
hide-uri-scheme: '@'
2725
tabs-sync-option: '@'
28-
chomp: 'all'
2926
extensions:
3027
- '@asciidoctor/tabs'
3128
- '@springio/asciidoctor-extensions'
29+
- '@springio/asciidoctor-extensions/javadoc-extension'
3230
sourcemap: true
3331
urls:
3432
latest_version_segment: ''
@@ -38,5 +36,5 @@ runtime:
3836
format: pretty
3937
ui:
4038
bundle:
41-
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.5/ui-bundle.zip
39+
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.16/ui-bundle.zip
4240
snapshot: true

src/main/antora/antora.yml

+5
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ ext:
1010
local: true
1111
scan:
1212
dir: target/classes/
13+
- run:
14+
command: ./mvnw package -Pdistribute
15+
local: true
16+
scan:
17+
dir: target/antora

src/main/antora/modules/ROOT/nav.adoc

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,6 @@
4444
4545
* xref:appendix.adoc[]
4646
47-
* https://github.com/spring-projects/spring-data-commons/wiki[Wiki]
47+
48+
* xref:attachment$api/java/index.html[Javadoc,role=link-external,window=_blank]
49+
* https://github.com/spring-projects/spring-data-commons/wiki[Wiki,role=link-external,window=_blank]

src/main/antora/modules/ROOT/pages/redis/connection-modes.adoc

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Each mode of operation requires specific configuration that is explained in the
99

1010
The easiest way to get started is by using Redis Standalone with a single Redis server,
1111

12-
Configure `LettuceClientConfiguration` or `JedisConnectionFactory`, as shown in the following example:
12+
Configure javadoc:org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory[] or javadoc:org.springframework.data.redis.connection.jedis.JedisConnectionFactory[], as shown in the following example:
1313

1414
[source,java]
1515
----
@@ -60,12 +60,12 @@ class WriteToMasterReadFromReplicaConfiguration {
6060
}
6161
----
6262

63-
TIP: For environments reporting non-public addresses through the `INFO` command (for example, when using AWS), use `RedisStaticMasterReplicaConfiguration` instead of `RedisStandaloneConfiguration`. Please note that `RedisStaticMasterReplicaConfiguration` does not support Pub/Sub because of missing Pub/Sub message propagation across individual servers.
63+
TIP: For environments reporting non-public addresses through the `INFO` command (for example, when using AWS), use javadoc:org.springframework.data.redis.connection.RedisStaticMasterReplicaConfiguration[] instead of javadoc:org.springframework.data.redis.connection.RedisStandaloneConfiguration[]. Please note that `RedisStaticMasterReplicaConfiguration` does not support Pub/Sub because of missing Pub/Sub message propagation across individual servers.
6464

6565
[[redis:sentinel]]
6666
== Redis Sentinel
6767

68-
For dealing with high-availability Redis, Spring Data Redis has support for https://redis.io/topics/sentinel[Redis Sentinel], using `RedisSentinelConfiguration`, as shown in the following example:
68+
For dealing with high-availability Redis, Spring Data Redis has support for https://redis.io/topics/sentinel[Redis Sentinel], using javadoc:org.springframework.data.redis.connection.RedisSentinelConfiguration[], as shown in the following example:
6969

7070
[source,java]
7171
----
@@ -113,8 +113,8 @@ Sometimes, direct interaction with one of the Sentinels is required. Using `Redi
113113
[[cluster.enable]]
114114
== Redis Cluster
115115

116-
xref:redis/cluster.adoc[Cluster support] is based on the same building blocks as non-clustered communication. `RedisClusterConnection`, an extension to `RedisConnection`, handles the communication with the Redis Cluster and translates errors into the Spring DAO exception hierarchy.
117-
`RedisClusterConnection` instances are created with the `RedisConnectionFactory`, which has to be set up with the associated `RedisClusterConfiguration`, as shown in the following example:
116+
xref:redis/cluster.adoc[Cluster support] is based on the same building blocks as non-clustered communication. javadoc:org.springframework.data.redis.connection.RedisClusterConnection[], an extension to `RedisConnection`, handles the communication with the Redis Cluster and translates errors into the Spring DAO exception hierarchy.
117+
`RedisClusterConnection` instances are created with the `RedisConnectionFactory`, which has to be set up with the associated javadoc:org.springframework.data.redis.connection.RedisClusterConfiguration[], as shown in the following example:
118118

119119
.Sample RedisConnectionFactory Configuration for Redis Cluster
120120
====

src/main/antora/modules/ROOT/pages/redis/drivers.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public LettuceConnectionFactory lettuceConnectionFactory() {
154154
}
155155
----
156156

157-
For more detailed client configuration tweaks, see https://docs.spring.io/spring-data/redis/docs/current/api/org/springframework/data/redis/connection/lettuce/LettuceClientConfiguration.html[`LettuceClientConfiguration`].
157+
For more detailed client configuration tweaks, see javadoc:org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration[].
158158

159159
Lettuce integrates with Netty's https://netty.io/wiki/native-transports.html[native transports], letting you use Unix domain sockets to communicate with Redis.
160160
Make sure to include the appropriate native transport dependencies that match your runtime environment.

src/main/antora/modules/ROOT/pages/redis/getting-started.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ include::example$examples/ReactiveRedisApplication.java[tags=file]
3737

3838
Even in this simple example, there are a few notable things to point out:
3939

40-
* You can create an instance of `RedisTemplate` (or `ReactiveRedisTemplate` for reactive usage) with a `RedisConnectionFactory`. Connection factories are an abstraction on top of the supported drivers.
40+
* You can create an instance of javadoc:org.springframework.data.redis.core.RedisTemplate[] (or javadoc:org.springframework.data.redis.core.ReactiveRedisTemplate[]for reactive usage) with a javadoc:org.springframework.data.redis.connection.RedisConnectionFactory[]. Connection factories are an abstraction on top of the supported drivers.
4141
* There's no single way to use Redis as it comes with support for a wide range of data structures such as plain keys ("strings"), lists, sets, sorted sets, streams, hashes and so on.

src/main/antora/modules/ROOT/pages/redis/hash-mappers.adoc

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
[[redis.hashmappers.root]]
22
= Hash Mapping
33

4-
Data can be stored by using various data structures within Redis. `Jackson2JsonRedisSerializer` can convert objects in https://en.wikipedia.org/wiki/JSON[JSON] format. Ideally, JSON can be stored as a value by using plain keys. You can achieve a more sophisticated mapping of structured objects by using Redis hashes. Spring Data Redis offers various strategies for mapping data to hashes (depending on the use case):
4+
Data can be stored by using various data structures within Redis. javadoc:org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer[] can convert objects in https://en.wikipedia.org/wiki/JSON[JSON] format. Ideally, JSON can be stored as a value by using plain keys. You can achieve a more sophisticated mapping of structured objects by using Redis hashes. Spring Data Redis offers various strategies for mapping data to hashes (depending on the use case):
55

6-
* Direct mapping, by using `HashOperations` and a xref:redis.adoc#redis:serializer[serializer]
6+
* Direct mapping, by using javadoc:org.springframework.data.redis.core.HashOperations[] and a xref:redis.adoc#redis:serializer[serializer]
77
* Using xref:repositories.adoc[Redis Repositories]
8-
* Using `HashMapper` and `HashOperations`
8+
* Using javadoc:org.springframework.data.redis.hash.HashMapper[] and javadoc:org.springframework.data.redis.core.HashOperations[]
99

1010
[[redis.hashmappers.mappers]]
1111
== Hash Mappers
1212

13-
Hash mappers are converters of map objects to a `Map<K, V>` and back. `HashMapper` is intended for using with Redis Hashes.
13+
Hash mappers are converters of map objects to a `Map<K, V>` and back. javadoc:org.springframework.data.redis.hash.HashMapper[] is intended for using with Redis Hashes.
1414

1515
Multiple implementations are available:
1616

17-
* `BeanUtilsHashMapper` using Spring's {spring-framework-javadoc}/org/springframework/beans/BeanUtils.html[BeanUtils].
18-
* `ObjectHashMapper` using xref:redis/redis-repositories/mapping.adoc[Object-to-Hash Mapping].
17+
* javadoc:org.springframework.data.redis.hash.BeanUtilsHashMapper[] using Spring's {spring-framework-javadoc}/org/springframework/beans/BeanUtils.html[BeanUtils].
18+
* javadoc:org.springframework.data.redis.hash.ObjectHashMapper[] using xref:redis/redis-repositories/mapping.adoc[Object-to-Hash Mapping].
1919
* <<redis.hashmappers.jackson2,`Jackson2HashMapper`>> using https://github.com/FasterXML/jackson[FasterXML Jackson].
2020

2121
The following example shows one way to implement hash mapping:
@@ -53,7 +53,7 @@ public class HashMapping {
5353
[[redis.hashmappers.jackson2]]
5454
=== Jackson2HashMapper
5555

56-
`Jackson2HashMapper` provides Redis Hash mapping for domain objects by using https://github.com/FasterXML/jackson[FasterXML Jackson].
56+
javadoc:org.springframework.data.redis.hash.Jackson2HashMapper[] provides Redis Hash mapping for domain objects by using https://github.com/FasterXML/jackson[FasterXML Jackson].
5757
`Jackson2HashMapper` can map top-level properties as Hash field names and, optionally, flatten the structure.
5858
Simple types map to simple values. Complex types (nested objects, collections, maps, and so on) are represented as nested JSON.
5959

src/main/antora/modules/ROOT/pages/redis/pubsub.adoc

+9-9
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,21 @@ In order to subscribe to messages, one needs to implement the `MessageListener`
6666
[[redis:pubsub:subscribe:containers]]
6767
=== Message Listener Containers
6868

69-
Due to its blocking nature, low-level subscription is not attractive, as it requires connection and thread management for every single listener. To alleviate this problem, Spring Data offers `RedisMessageListenerContainer`, which does all the heavy lifting. If you are familiar with EJB and JMS, you should find the concepts familiar, as it is designed to be as close as possible to the support in Spring Framework and its message-driven POJOs (MDPs).
69+
Due to its blocking nature, low-level subscription is not attractive, as it requires connection and thread management for every single listener. To alleviate this problem, Spring Data offers javadoc:org.springframework.data.redis.listener.RedisMessageListenerContainer[], which does all the heavy lifting. If you are familiar with EJB and JMS, you should find the concepts familiar, as it is designed to be as close as possible to the support in Spring Framework and its message-driven POJOs (MDPs).
7070

71-
`RedisMessageListenerContainer` acts as a message listener container. It is used to receive messages from a Redis channel and drive the `MessageListener` instances that are injected into it. The listener container is responsible for all threading of message reception and dispatches into the listener for processing. A message listener container is the intermediary between an MDP and a messaging provider and takes care of registering to receive messages, resource acquisition and release, exception conversion, and the like. This lets you as an application developer write the (possibly complex) business logic associated with receiving a message (and reacting to it) and delegates boilerplate Redis infrastructure concerns to the framework.
71+
javadoc:org.springframework.data.redis.listener.RedisMessageListenerContainer[] acts as a message listener container. It is used to receive messages from a Redis channel and drive the javadoc:org.springframework.data.redis.connection.MessageListener[] instances that are injected into it. The listener container is responsible for all threading of message reception and dispatches into the listener for processing. A message listener container is the intermediary between an MDP and a messaging provider and takes care of registering to receive messages, resource acquisition and release, exception conversion, and the like. This lets you as an application developer write the (possibly complex) business logic associated with receiving a message (and reacting to it) and delegates boilerplate Redis infrastructure concerns to the framework.
7272

73-
A `MessageListener` can additionally implement `SubscriptionListener` to receive notifications upon subscription/unsubscribe confirmation. Listening to subscription notifications can be useful when synchronizing invocations.
73+
A javadoc:org.springframework.data.redis.connection.MessageListener[] can additionally implement javadoc:org.springframework.data.redis.connection.SubscriptionListener[] to receive notifications upon subscription/unsubscribe confirmation. Listening to subscription notifications can be useful when synchronizing invocations.
7474

75-
Furthermore, to minimize the application footprint, `RedisMessageListenerContainer` lets one connection and one thread be shared by multiple listeners even though they do not share a subscription. Thus, no matter how many listeners or channels an application tracks, the runtime cost remains the same throughout its lifetime. Moreover, the container allows runtime configuration changes so that you can add or remove listeners while an application is running without the need for a restart. Additionally, the container uses a lazy subscription approach, using a `RedisConnection` only when needed. If all the listeners are unsubscribed, cleanup is automatically performed, and the thread is released.
75+
Furthermore, to minimize the application footprint, javadoc:org.springframework.data.redis.listener.RedisMessageListenerContainer[] lets one connection and one thread be shared by multiple listeners even though they do not share a subscription. Thus, no matter how many listeners or channels an application tracks, the runtime cost remains the same throughout its lifetime. Moreover, the container allows runtime configuration changes so that you can add or remove listeners while an application is running without the need for a restart. Additionally, the container uses a lazy subscription approach, using a `RedisConnection` only when needed. If all the listeners are unsubscribed, cleanup is automatically performed, and the thread is released.
7676

7777
To help with the asynchronous nature of messages, the container requires a `java.util.concurrent.Executor` (or Spring's `TaskExecutor`) for dispatching the messages. Depending on the load, the number of listeners, or the runtime environment, you should change or tweak the executor to better serve your needs. In particular, in managed environments (such as app servers), it is highly recommended to pick a proper `TaskExecutor` to take advantage of its runtime.
7878

7979

8080
[[redis:pubsub:subscribe:adapter]]
8181
=== The MessageListenerAdapter
8282

83-
The `MessageListenerAdapter` class is the final component in Spring's asynchronous messaging support. In a nutshell, it lets you expose almost *any* class as a MDP (though there are some constraints).
83+
The javadoc:org.springframework.data.redis.listener.adapter.MessageListenerAdapter[] class is the final component in Spring's asynchronous messaging support. In a nutshell, it lets you expose almost *any* class as a MDP (though there are some constraints).
8484

8585
Consider the following interface definition:
8686

@@ -96,7 +96,7 @@ public interface MessageDelegate {
9696
}
9797
----
9898

99-
Notice that, although the interface does not extend the `MessageListener` interface, it can still be used as a MDP by using the `MessageListenerAdapter` class. Notice also how the various message handling methods are strongly typed according to the *contents* of the various `Message` types that they can receive and handle. In addition, the channel or pattern to which a message is sent can be passed in to the method as the second argument of type `String`:
99+
Notice that, although the interface does not extend the `MessageListener` interface, it can still be used as a MDP by using the javadoc:org.springframework.data.redis.listener.adapter.MessageListenerAdapter[] class. Notice also how the various message handling methods are strongly typed according to the *contents* of the various `Message` types that they can receive and handle. In addition, the channel or pattern to which a message is sent can be passed in to the method as the second argument of type `String`:
100100

101101
[source,java]
102102
----
@@ -105,7 +105,7 @@ public class DefaultMessageDelegate implements MessageDelegate {
105105
}
106106
----
107107

108-
Notice how the above implementation of the `MessageDelegate` interface (the above `DefaultMessageDelegate` class) has *no* Redis dependencies at all. It truly is a POJO that we make into an MDP with the following configuration:
108+
Notice how the above implementation of the `MessageDelegate` interface (the above `DefaultMessageDelegate` class) has *no* Redis dependencies at all. It truly is a POJO that we make into an MDP with the following configuration:
109109

110110
[tabs]
111111
======
@@ -193,7 +193,7 @@ Each time a message is received, the adapter automatically and transparently per
193193
[[redis:reactive:pubsub:subscribe:containers]]
194194
== Reactive Message Listener Container
195195

196-
Spring Data offers `ReactiveRedisMessageListenerContainer` which does all the heavy lifting of conversion and subscription state management on behalf of the user.
196+
Spring Data offers javadoc:org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer[] which does all the heavy lifting of conversion and subscription state management on behalf of the user.
197197

198198
The message listener container itself does not require external threading resources. It uses the driver threads to publish messages.
199199

@@ -223,7 +223,7 @@ stream.doOnNext(inner -> // notification hook when Redis subscriptions are synch
223223
[[redis:reactive:pubsub:subscribe:template]]
224224
=== Subscribing via template API
225225

226-
As mentioned above you can directly use `ReactiveRedisTemplate` to subscribe to channels / patterns. This approach
226+
As mentioned above you can directly use javadoc:org.springframework.data.redis.core.ReactiveRedisTemplate[] to subscribe to channels / patterns. This approach
227227
offers a straight forward, though limited solution as you lose the option to add subscriptions after the initial
228228
ones. Nevertheless you still can control the message stream via the returned `Flux` using eg. `take(Duration)`. When
229229
done reading, on error or cancellation all bound resources are freed again.

0 commit comments

Comments
 (0)