Skip to content

Commit 44005ba

Browse files
committed
oncrpc4j-core: fix various javadoc issues
fix errors reported by maven javadoc plugin (mvn javadoc:javadoc) Acked-by: Paul Millar Target: master
1 parent 9a0e9ed commit 44005ba

File tree

14 files changed

+104
-89
lines changed

14 files changed

+104
-89
lines changed

oncrpc4j-core/src/main/java/org/dcache/oncrpc4j/portmap/OncRpcEmbeddedPortmap.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009 - 2018 Deutsches Elektronen-Synchroton,
2+
* Copyright (c) 2009 - 2019 Deutsches Elektronen-Synchroton,
33
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
44
*
55
* This library is free software; you can redistribute it and/or modify
@@ -40,7 +40,7 @@
4040
import org.dcache.oncrpc4j.rpc.RpcTransport;
4141

4242
/**
43-
* An instance of this class will create an embedded rpc portmap
43+
* An instance of this class will create an embedded RPC portmap
4444
* service if OS does not provides one.
4545
*/
4646
public class OncRpcEmbeddedPortmap {
@@ -50,10 +50,27 @@ public class OncRpcEmbeddedPortmap {
5050
private static final RpcAuth _auth = new RpcAuthTypeNone();
5151
private OncRpcSvc optionalEmbeddedServer = null;
5252

53+
/**
54+
* Start a new embedded portmap service when another one is not running.
55+
* The embedded portmap is stared only when there was no reply from an existing
56+
* portmap service within 2 (two) seconds timeout. To test existing service an
57+
* RPC ping request is sent over UDP to well know port {@code 111}.
58+
*
59+
* @see #OncRpcEmbeddedPortmap(long, TimeUnit)
60+
*/
5361
public OncRpcEmbeddedPortmap() {
5462
this(2, TimeUnit.SECONDS);
5563
}
5664

65+
/**
66+
* Start a new embedded portmap service when another one is not running.
67+
* The embedded portmap is stared only when there was no reply from an existing
68+
* portmap service within given timeout. To test existing service an RPC ping
69+
* request is sent over UDP to well know port {@code 111}.
70+
*
71+
* @param timeoutValue the timeout value given in the {@code timeoutUnit}
72+
* @param timeoutUnit the unit of the {@code timeoutValue} argument
73+
*/
5774
public OncRpcEmbeddedPortmap(long timeoutValue, TimeUnit timeoutUnit) {
5875

5976
// we start embedded portmap only if there no other one is running
@@ -103,7 +120,7 @@ public boolean isEmbeddedPortmapper() {
103120
}
104121
/**
105122
* Shutdown embedded <tt>portmap</tt> service if running.
106-
* @throws IOException
123+
* @throws IOException if embedded service failed to shutdown.
107124
*/
108125
public void shutdown() throws IOException {
109126
if (optionalEmbeddedServer != null) {

oncrpc4j-core/src/main/java/org/dcache/oncrpc4j/rpc/OncRpcProgram.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009 - 2018 Deutsches Elektronen-Synchroton,
2+
* Copyright (c) 2009 - 2019 Deutsches Elektronen-Synchroton,
33
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
44
*
55
* This library is free software; you can redistribute it and/or modify
@@ -56,8 +56,8 @@ public int getVersion() {
5656

5757
/**
5858
* Construct a new OncRpcProgram for with a given program number and version.
59-
* @param number
60-
* @param version
59+
* @param number RPC program number.
60+
* @param version RPC program version.
6161
*/
6262
public OncRpcProgram(int number, int version) {
6363
_number = number;

oncrpc4j-core/src/main/java/org/dcache/oncrpc4j/rpc/OncRpcSvc.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ public void register(OncRpcProgram prog, RpcDispatchable handler) {
201201
}
202202

203203
/**
204-
* Unregister program.
204+
* Unregister given RPC program.
205205
*
206-
* @param prog
206+
* @param prog RPC program to unregister.
207207
*/
208208
public void unregister(OncRpcProgram prog) {
209209
_log.info("Unregistering program {}", prog);
@@ -212,7 +212,7 @@ public void unregister(OncRpcProgram prog) {
212212

213213
/**
214214
* Add programs to existing services.
215-
* @param services
215+
* @param services RPC programs to be served by this service.
216216
* @deprecated use {@link OncRpcSvcBuilder#withRpcService} instead.
217217
*/
218218
@Deprecated
@@ -449,9 +449,9 @@ public RpcTransport connect(InetSocketAddress socketAddress, long timeout, TimeU
449449
}
450450

451451
/**
452-
* Returns the address of the endpoint this service is bound to,
452+
* Returns the socket address of the endpoint to which this service is bound,
453453
* or <code>null</code> if it is not bound yet.
454-
* @param protocol
454+
* @param protocol protocol identifier as specified in {@link IpProtocolType}.
455455
* @return a {@link InetSocketAddress} representing the local endpoint of
456456
* this service, or <code>null</code> if it is not bound yet.
457457
*/

oncrpc4j-core/src/main/java/org/dcache/oncrpc4j/rpc/ReplyQueue.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009 - 2018 Deutsches Elektronen-Synchroton,
2+
* Copyright (c) 2009 - 2019 Deutsches Elektronen-Synchroton,
33
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
44
*
55
* This library is free software; you can redistribute it and/or modify
@@ -102,7 +102,7 @@ public void handleDisconnect(SocketAddress addr) {
102102
* Get {@link CompletionHandler} for the provided xid.
103103
* On completion key will be unregistered.
104104
*
105-
* @param xid of rpc request.
105+
* @param xid of RPC request.
106106
* @return completion handler for given xid or {@code null} if xid is unknown.
107107
*/
108108
public CompletionHandler<RpcReply, RpcTransport> get(int xid) {

oncrpc4j-core/src/main/java/org/dcache/oncrpc4j/rpc/RpcAuthStat.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009 - 2018 Deutsches Elektronen-Synchroton,
2+
* Copyright (c) 2009 - 2019 Deutsches Elektronen-Synchroton,
33
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
44
*
55
* This library is free software; you can redistribute it and/or modify
@@ -76,9 +76,11 @@ private RpcAuthStat() {
7676

7777
/**
7878
* Get human readable {@link String} representation of error code.
79+
* @param status RPC authentication status code.
80+
* @return string representing the provided {@code status}
7981
*/
80-
public static String toString(int i) {
81-
switch (i) {
82+
public static String toString(int status) {
83+
switch (status) {
8284
case AUTH_OK:
8385
return "OK";
8486
case AUTH_BADCRED:
@@ -110,6 +112,6 @@ public static String toString(int i) {
110112
case RPCSEC_GSS_CTXPROBLEM:
111113
return "RPCSEC_GSS_CTXPROBLEM";
112114
}
113-
return "Unknow state " + i;
115+
return "Unknow state " + status;
114116
}
115117
}

oncrpc4j-core/src/main/java/org/dcache/oncrpc4j/rpc/RpcCall.java

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,9 @@ public RpcCall(int xid, int prog, int ver, int proc, RpcAuth cred, Xdr xdr, RpcT
193193

194194
/**
195195
* Accept message. Have to be called prior processing RPC call.
196-
* @throws IOException
197-
* @throws OncRpcException
196+
* @throws IOException if messages can't be accepted.
198197
*/
199-
public void accept() throws IOException, OncRpcException {
198+
public void accept() throws IOException {
200199
_rpcvers = _xdr.xdrDecodeInt();
201200
if (_rpcvers != RPCVERS) {
202201
throw new RpcMismatchReply(_rpcvers, 2);
@@ -236,15 +235,16 @@ public RpcAuth getCredential() {
236235
}
237236

238237
/**
239-
* Get RPC {@XdrTransport} used by this call.
240-
* @return transport
238+
* Get RPC {@link RpcTransport} used by this call.
239+
* @return transport used by this RPC call.
241240
*/
242241
public RpcTransport getTransport() {
243242
return _transport;
244243
}
245244

246245
/**
247-
* Get xid associated with this rpc message.
246+
* Get xid associated with this RPC message.
247+
* @return xid RPC message unique identifier.
248248
*/
249249
public int getXid() {
250250
return _xid;
@@ -271,8 +271,8 @@ public String toString() {
271271
* caller (AUTH_ERROR).
272272
*
273273
* @see RpcRejectStatus
274-
* @param status
275-
* @param reason
274+
* @param status status why request was rejected.
275+
* @param reason {@code status} specific reply object.
276276
*/
277277
public void reject(int status, XdrAble reason) {
278278
XdrEncodingStream xdr = _xdr;
@@ -389,8 +389,8 @@ public void failRpcSystem() {
389389
* @param timeoutValue timeout value. 0 means no timeout
390390
* @param timeoutUnits units for timeout value
391391
* @param auth auth to use for the call
392-
* @throws OncRpcException
393-
* @throws IOException
392+
* @throws OncRpcException if RPC error occurs
393+
* @throws IOException if I/O error occurs
394394
* @since 2.4.0
395395
*/
396396
public void call(int procedure, XdrAble args, CompletionHandler<RpcReply, RpcTransport> callback, long timeoutValue, TimeUnit timeoutUnits, RpcAuth auth)
@@ -431,8 +431,7 @@ public void call(int procedure, XdrAble args, CompletionHandler<RpcReply, RpcTra
431431
* @param timeoutUnits units for timeout value
432432
* @param auth auth to use for this call. null for constructor-provided default
433433
* @return the xid for the call
434-
* @throws OncRpcException
435-
* @throws IOException
434+
* @throws IOException if I/O or RPC error occurs
436435
*/
437436
private int callInternal(int procedure, XdrAble args, CompletionHandler<RpcReply, RpcTransport> callback,
438437
long timeoutValue, TimeUnit timeoutUnits, RpcAuth auth)
@@ -495,8 +494,8 @@ public void failed(Throwable t, InetSocketAddress attachment) {
495494
* @param type The expected type of the reply
496495
* @param auth auth to use for the call
497496
* @return A CompletableFuture representing the result of the operation.
498-
* @throws OncRpcException
499-
* @throws IOException
497+
* @throws OncRpcException if RPC error occurs
498+
* @throws IOException if I/O error occurs
500499
* @since 2.4.0
501500
*/
502501
public <T extends XdrAble> CompletableFuture<T> call(int procedure, XdrAble args, final Class<T> type, final RpcAuth auth)
@@ -510,9 +509,6 @@ public <T extends XdrAble> CompletableFuture<T> call(int procedure, XdrAble args
510509
}
511510
}
512511

513-
/**
514-
*/
515-
516512
/**
517513
* Send asynchronous RPC request to a remove server.
518514
*
@@ -529,8 +525,8 @@ public <T extends XdrAble> CompletableFuture<T> call(int procedure, XdrAble args
529525
* @param args The argument of the procedure.
530526
* @param type The expected type of the reply
531527
* @return A CompletableFuture representing the result of the operation.
532-
* @throws OncRpcException
533-
* @throws IOException
528+
* @throws OncRpcException if RPC error occurs
529+
* @throws IOException if I/O error occurs
534530
* @since 2.4.0
535531
*/
536532
public <T extends XdrAble> CompletableFuture<T> call(int procedure, XdrAble args, final Class<T> type)
@@ -547,8 +543,9 @@ public <T extends XdrAble> CompletableFuture<T> call(int procedure, XdrAble args
547543
* @param timeoutValue timeout value. 0 means no timeout
548544
* @param timeoutUnits units for timeout value
549545
* @param auth auth to use for the call
550-
* @throws OncRpcException
551-
* @throws IOException
546+
* @throws OncRpcException if RPC error occurs
547+
* @throws IOException if I/O error occurs
548+
* @throws TimeoutException if timeout elapses before reply is received.
552549
*/
553550
public void call(int procedure, XdrAble args, XdrAble result, long timeoutValue, TimeUnit timeoutUnits, RpcAuth auth)
554551
throws IOException, TimeoutException {
@@ -571,6 +568,8 @@ public void call(int procedure, XdrAble args, XdrAble result, long timeoutValue,
571568

572569
/**
573570
* convenience version of {@link #call(int, XdrAble, XdrAble, long, TimeUnit, RpcAuth)} with default auth
571+
* @throws IOException if I/O or RPC error occurs.
572+
* @throws TimeoutException if timeout elapses before reply is received.
574573
*/
575574
public void call(int procedure, XdrAble args, XdrAble result, long timeoutValue, TimeUnit timeoutUnits)
576575
throws IOException, TimeoutException {
@@ -579,6 +578,7 @@ public void call(int procedure, XdrAble args, XdrAble result, long timeoutValue,
579578

580579
/**
581580
* convenience version of {@link #call(int, XdrAble, XdrAble, long, TimeUnit, RpcAuth)} with no timeout
581+
* @throws IOException if I/O or RPC error occurs.
582582
*/
583583
public void call(int procedure, XdrAble args, XdrAble result, RpcAuth auth)
584584
throws IOException {
@@ -591,6 +591,7 @@ public void call(int procedure, XdrAble args, XdrAble result, RpcAuth auth)
591591

592592
/**
593593
* convenience version of {@link #call(int, XdrAble, XdrAble, long, TimeUnit, RpcAuth)} with no timeout or auth
594+
* @throws IOException if I/O or RPC error occurs.
594595
*/
595596
public void call(int procedure, XdrAble args, XdrAble result)
596597
throws IOException {
@@ -689,7 +690,7 @@ private int nextXid() {
689690

690691
/**
691692
* Register {@link CompletionHandler} to receive notification when message
692-
* send is complete. NOTICE: when processing rpc call on the server side
693+
* send is complete. NOTICE: when processing RPC call on the server side
693694
* the @{code registerSendListener} has the same effect as {@link #registerSendOnceListener}
694695
* as a new instance of {@link RpcCall} is used to process the request.
695696
* @param listener the message sent listener

oncrpc4j-core/src/main/java/org/dcache/oncrpc4j/rpc/RpcTransport.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ public interface RpcTransport {
6969

7070
/**
7171
* Get {@link RpcTransport} for to sent/receive requests in opposite direction.
72-
* The returned transport can be used by servers to send rpc calls to clients and
73-
* can be used by clients to receive rpc calls from servers.
72+
* The returned transport can be used by servers to send RPC calls to clients and
73+
* can be used by clients to receive RPC calls from servers.
7474
*
75-
* @return
75+
* @return {@code RpcTransport} connected to the remote peer.
7676
*/
7777
public RpcTransport getPeerTransport();
7878

oncrpc4j-core/src/main/java/org/dcache/oncrpc4j/rpc/gss/GssProtocolFilter.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009 - 2018 Deutsches Elektronen-Synchroton,
2+
* Copyright (c) 2009 - 2019 Deutsches Elektronen-Synchroton,
33
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
44
*
55
* This library is free software; you can redistribute it and/or modify
@@ -47,27 +47,24 @@
4747
* A {@link Filter} that handles RPCSEC_GSS requests.
4848
* Filter is responsible to establish and destroy GSS context.
4949
* For requests with established contexts RPC requests repacked into
50-
* GSS aware {@link RpsGssCall}.
50+
* GSS aware {@link RpcGssCall}.
5151
*
5252
* @since 0.0.4
5353
*/
5454
public class GssProtocolFilter extends BaseFilter {
5555

5656
private final static Logger _log = LoggerFactory.getLogger(GssProtocolFilter.class);
57+
5758
/**
58-
* Return value from either accept or init stating that
59-
* the context creation phase is complete for this peer.
60-
* @see #init
61-
* @see #accept
59+
* GSS handshake status returned to the client to indicate that the context
60+
* creation phase is complete.
6261
*/
6362
public static final int COMPLETE = 0;
63+
6464
/**
65-
* Return value from either accept or init stating that
66-
* another token is required from the peer to continue context
67-
* creation. This may be returned several times indicating
68-
* multiple token exchanges.
69-
* @see #init
70-
* @see #accept
65+
* GSS handshake status returned to the client to indicate that another
66+
* token is required to compete context creation. This status code can be
67+
* returned several times when multiple token exchanges required.
7168
*/
7269
public static final int CONTINUE_NEEDED = 1;
7370

@@ -162,7 +159,7 @@ public NextAction handleRead(FilterChainContext ctx) throws IOException {
162159
* According to rfc2203 verifier should contain the checksum of the RPC header
163160
* up to and including the credential.
164161
*
165-
* @param auth
162+
* @param auth RPC request authentication credentials.
166163
* @param context gss context
167164
* @throws GSSException if cant validate the checksum
168165
*/

oncrpc4j-core/src/main/java/org/dcache/oncrpc4j/rpc/gss/RpcAuthGss.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009 - 2018 Deutsches Elektronen-Synchroton,
2+
* Copyright (c) 2009 - 2019 Deutsches Elektronen-Synchroton,
33
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
44
*
55
* This library is free software; you can redistribute it and/or modify
@@ -117,10 +117,10 @@ public void xdrDecode(XdrDecodingStream xdr) throws OncRpcException, IOException
117117
/*
118118
* header size is RPC header + credential.
119119
*
120-
* rpc header is 7 int32: xid type rpcversion prog vers proc auth_flavour
120+
* RPC header is 7 int32: xid type rpcversion prog vers proc auth_flavour
121121
* credential is 1 int32 + it's value : len + opaque
122122
*
123-
* set position to the beginning of rpc message and limit to the end of credential.
123+
* set position to the beginning of RPC message and limit to the end of credential.
124124
*/
125125
_header.limit( _header.position() + len);
126126
_header.position( _header.position() - 8*4);

0 commit comments

Comments
 (0)