Skip to content

Commit be382d7

Browse files
authored
Add missing package-infos and Javadoc in plugins package (#817)
1 parent c9a4f06 commit be382d7

18 files changed

+191
-32
lines changed

rsocket-core/src/main/java/io/rsocket/core/RSocketConnector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ public RSocketConnector resume(Resume resume) {
378378
* <p>By default this is not enabled.
379379
*
380380
* @param supplier supplier for a {@link Leases}
381-
* @return the same instance for method chaining <a
382-
* href="https://github.com/rsocket/rsocket/blob/master/Protocol.md#lease-semantics">Lease
381+
* @return the same instance for method chaining
382+
* @see <a href="https://github.com/rsocket/rsocket/blob/master/Protocol.md#lease-semantics">Lease
383383
* Semantics</a>
384384
*/
385385
public RSocketConnector lease(Supplier<Leases<? extends LeaseStats>> supplier) {

rsocket-core/src/main/java/io/rsocket/core/RSocketServer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ public RSocketServer resume(Resume resume) {
189189
*
190190
* @param supplier supplier for a {@link Leases}
191191
* @return the same instance for method chaining
192-
* @return the same instance for method chaining <a
193-
* href="https://github.com/rsocket/rsocket/blob/master/Protocol.md#lease-semantics">Lease
192+
* @return the same instance for method chaining
193+
* @see <a href="https://github.com/rsocket/rsocket/blob/master/Protocol.md#lease-semantics">Lease
194194
* Semantics</a>
195195
*/
196196
public RSocketServer lease(Supplier<Leases<?>> supplier) {

rsocket-core/src/main/java/io/rsocket/core/package-info.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515
*/
1616

1717
/**
18-
* Contains core RSocket protocol, client and server implementation classes, including factories to
19-
* create and configure them.
18+
* Contains {@link io.rsocket.core.RSocketConnector RSocketConnector} and {@link
19+
* io.rsocket.core.RSocketServer RSocketServer}, the main classes for connecting to or starting an
20+
* RSocket server.
21+
*
22+
* <p>This package also contains a package private classes that implement support for the main
23+
* RSocket interactions.
2024
*/
2125
@NonNullApi
2226
package io.rsocket.core;

rsocket-core/src/main/java/io/rsocket/exceptions/package-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2018 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
1515
*/
1616

1717
/**
18-
* The hierarchy of exceptions that can be returned by the API
18+
* A hierarchy of exceptions that represent RSocket protocol error codes.
1919
*
2020
* @see <a href="https://github.com/rsocket/rsocket/blob/master/Protocol.md#error-codes">Error
2121
* Codes</a>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright 2015-2020 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/**
18+
* Support for encoding and decoding of RSocket frames to and from {@link io.rsocket.Payload
19+
* Payload}.
20+
*/
21+
package io.rsocket.frame;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright 2015-2020 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/** Support classes for sending and keeping track of KEEPALIVE frames from the remote. */
18+
@javax.annotation.ParametersAreNonnullByDefault
19+
package io.rsocket.keepalive;

rsocket-core/src/main/java/io/rsocket/lease/package-info.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2018 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,5 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17+
/**
18+
* Contains support classes for the Lease feature of the RSocket protocol.
19+
*
20+
* @see <a
21+
* href="https://github.com/rsocket/rsocket/blob/master/Protocol.md#resuming-operation">Resuming
22+
* Operation</a>
23+
*/
1724
@javax.annotation.ParametersAreNonnullByDefault
1825
package io.rsocket.lease;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2015-2020 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/**
18+
* Contains implementations of RSocket <a
19+
* href="https://github.com/rsocket/rsocket/tree/master/Extensions">protocol extensions</a> related
20+
* to the use of metadata.
21+
*/
22+
package io.rsocket.metadata;

rsocket-core/src/main/java/io/rsocket/package-info.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2018 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,4 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17+
/**
18+
* Contains key contracts of the RSocket programming model including {@link io.rsocket.RSocket
19+
* RSocket} for performing or handling RSocket interactions, {@link io.rsocket.SocketAcceptor
20+
* SocketAcceptor} for declaring responders, {@link io.rsocket.Payload Payload} for access to the
21+
* content of a payload, and others.
22+
*
23+
* <p>To connect to or start a server see {@link io.rsocket.core.RSocketConnector RSocketConnector}
24+
* and {@link io.rsocket.core.RSocketServer RSocketServer} in {@link io.rsocket.core}.
25+
*/
1726
package io.rsocket;

rsocket-core/src/main/java/io/rsocket/plugins/DuplexConnectionInterceptor.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2018 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,9 +19,13 @@
1919
import io.rsocket.DuplexConnection;
2020
import java.util.function.BiFunction;
2121

22-
/** */
22+
/**
23+
* Contract to decorate a {@link DuplexConnection} and intercept the sending and receiving of
24+
* RSocket frames at the transport level.
25+
*/
2326
public @FunctionalInterface interface DuplexConnectionInterceptor
2427
extends BiFunction<DuplexConnectionInterceptor.Type, DuplexConnection, DuplexConnection> {
28+
2529
enum Type {
2630
SETUP,
2731
CLIENT,

rsocket-core/src/main/java/io/rsocket/plugins/InitializingInterceptorRegistry.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
import io.rsocket.RSocket;
2020
import io.rsocket.SocketAcceptor;
2121

22+
/**
23+
* Extends {@link InterceptorRegistry} with methods for building a chain of registered interceptors.
24+
* This is not intended for direct use by applications.
25+
*/
2226
public class InitializingInterceptorRegistry extends InterceptorRegistry {
2327

2428
public DuplexConnection initConnection(

rsocket-core/src/main/java/io/rsocket/plugins/InterceptorRegistry.java

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,54 +19,87 @@
1919
import java.util.List;
2020
import java.util.function.Consumer;
2121

22+
/**
23+
* Provides support for registering interceptors at the following levels:
24+
*
25+
* <ul>
26+
* <li>{@link #forConnection(DuplexConnectionInterceptor)} -- transport level
27+
* <li>{@link #forSocketAcceptor(SocketAcceptorInterceptor)} -- for accepting new connections
28+
* <li>{@link #forRequester(RSocketInterceptor)} -- for performing of requests
29+
* <li>{@link #forResponder(RSocketInterceptor)} -- for responding to requests
30+
* </ul>
31+
*/
2232
public class InterceptorRegistry {
23-
private List<DuplexConnectionInterceptor> connectionInterceptors = new ArrayList<>();
2433
private List<RSocketInterceptor> requesterInteceptors = new ArrayList<>();
2534
private List<RSocketInterceptor> responderInterceptors = new ArrayList<>();
2635
private List<SocketAcceptorInterceptor> socketAcceptorInterceptors = new ArrayList<>();
36+
private List<DuplexConnectionInterceptor> connectionInterceptors = new ArrayList<>();
2737

28-
public InterceptorRegistry forConnection(DuplexConnectionInterceptor interceptor) {
29-
connectionInterceptors.add(interceptor);
30-
return this;
31-
}
32-
33-
public InterceptorRegistry forConnection(Consumer<List<DuplexConnectionInterceptor>> consumer) {
34-
consumer.accept(connectionInterceptors);
35-
return this;
36-
}
37-
38+
/**
39+
* Add an {@link RSocketInterceptor} that will decorate the RSocket used for performing requests.
40+
*/
3841
public InterceptorRegistry forRequester(RSocketInterceptor interceptor) {
3942
requesterInteceptors.add(interceptor);
4043
return this;
4144
}
4245

46+
/**
47+
* Variant of {@link #forRequester(RSocketInterceptor)} with access to the list of existing
48+
* registrations.
49+
*/
4350
public InterceptorRegistry forRequester(Consumer<List<RSocketInterceptor>> consumer) {
4451
consumer.accept(requesterInteceptors);
4552
return this;
4653
}
4754

55+
/**
56+
* Add an {@link RSocketInterceptor} that will decorate the RSocket used for resonding to
57+
* requests.
58+
*/
4859
public InterceptorRegistry forResponder(RSocketInterceptor interceptor) {
4960
responderInterceptors.add(interceptor);
5061
return this;
5162
}
5263

64+
/**
65+
* Variant of {@link #forResponder(RSocketInterceptor)} with access to the list of existing
66+
* registrations.
67+
*/
5368
public InterceptorRegistry forResponder(Consumer<List<RSocketInterceptor>> consumer) {
5469
consumer.accept(responderInterceptors);
5570
return this;
5671
}
5772

73+
/**
74+
* Add a {@link SocketAcceptorInterceptor} that will intercept the accepting of new connections.
75+
*/
5876
public InterceptorRegistry forSocketAcceptor(SocketAcceptorInterceptor interceptor) {
5977
socketAcceptorInterceptors.add(interceptor);
6078
return this;
6179
}
6280

81+
/**
82+
* Variant of {@link #forSocketAcceptor(SocketAcceptorInterceptor)} with access to the list of
83+
* existing registrations.
84+
*/
6385
public InterceptorRegistry forSocketAcceptor(Consumer<List<SocketAcceptorInterceptor>> consumer) {
6486
consumer.accept(socketAcceptorInterceptors);
6587
return this;
6688
}
6789

68-
List<DuplexConnectionInterceptor> getConnectionInterceptors() {
69-
return connectionInterceptors;
90+
/** Add a {@link DuplexConnectionInterceptor}. */
91+
public InterceptorRegistry forConnection(DuplexConnectionInterceptor interceptor) {
92+
connectionInterceptors.add(interceptor);
93+
return this;
94+
}
95+
96+
/**
97+
* Variant of {@link #forConnection(DuplexConnectionInterceptor)} with access to the list of
98+
* existing registrations.
99+
*/
100+
public InterceptorRegistry forConnection(Consumer<List<DuplexConnectionInterceptor>> consumer) {
101+
consumer.accept(connectionInterceptors);
102+
return this;
70103
}
71104

72105
List<RSocketInterceptor> getRequesterInteceptors() {
@@ -77,6 +110,10 @@ List<RSocketInterceptor> getResponderInterceptors() {
77110
return responderInterceptors;
78111
}
79112

113+
List<DuplexConnectionInterceptor> getConnectionInterceptors() {
114+
return connectionInterceptors;
115+
}
116+
80117
List<SocketAcceptorInterceptor> getSocketAcceptorInterceptors() {
81118
return socketAcceptorInterceptors;
82119
}

rsocket-core/src/main/java/io/rsocket/plugins/RSocketInterceptor.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2018 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,5 +19,10 @@
1919
import io.rsocket.RSocket;
2020
import java.util.function.Function;
2121

22-
/** */
22+
/**
23+
* Contract to decorate an {@link RSocket}, providing a way to intercept interactions. This can be
24+
* applied to a {@link InterceptorRegistry#forRequester(RSocketInterceptor) requester} or {@link
25+
* InterceptorRegistry#forResponder(RSocketInterceptor) responder} {@code RSocket} of a client or
26+
* server.
27+
*/
2328
public @FunctionalInterface interface RSocketInterceptor extends Function<RSocket, RSocket> {}

rsocket-core/src/main/java/io/rsocket/plugins/SocketAcceptorInterceptor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2019 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,8 +22,8 @@
2222
* Contract to decorate a {@link SocketAcceptor}, providing access to connection {@code setup}
2323
* information and the ability to also decorate the sockets for requesting and responding.
2424
*
25-
* <p>This can be used as an alternative to individual requester and responder {@link
26-
* RSocketInterceptor} plugins.
25+
* <p>This could be used as an alternative to registering an individual "requester" {@code
26+
* RSocketInterceptor} and "responder" {@code RSocketInterceptor}.
2727
*/
2828
public @FunctionalInterface interface SocketAcceptorInterceptor
2929
extends Function<SocketAcceptor, SocketAcceptor> {}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2015-2020 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/** Contracts for interception of transports, connections, and requests in in RSocket Java. */
18+
package io.rsocket.plugins;

rsocket-core/src/main/java/io/rsocket/resume/package-info.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17+
/**
18+
* Contains support classes for the RSocket resume capability.
19+
*
20+
* @see <a
21+
* href="https://github.com/rsocket/rsocket/blob/master/Protocol.md#resuming-operation">Resuming
22+
* Operation</a>
23+
*/
1724
@javax.annotation.ParametersAreNonnullByDefault
1825
package io.rsocket.resume;

rsocket-core/src/main/java/io/rsocket/transport/package-info.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2018 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,5 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17+
/** Client and server transport contracts for pluggable transports. */
1718
@javax.annotation.ParametersAreNonnullByDefault
1819
package io.rsocket.transport;

0 commit comments

Comments
 (0)