diff --git a/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractAuthentication.java b/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractAuthentication.java index fcc02e9c74b9..6ecf702a8f87 100644 --- a/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractAuthentication.java +++ b/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/AbstractAuthentication.java @@ -15,11 +15,21 @@ import java.net.URI; +/** + *

Abstract base class for authentication implementations. + * Provides common functionality for URI and realm matching.

+ */ public abstract class AbstractAuthentication implements Authentication { private final URI uri; private final String realm; + /** + * Creates an authentication for the given URI and realm. + * + * @param uri the URI this authentication applies to + * @param realm the authentication realm + */ public AbstractAuthentication(URI uri, String realm) { this.uri = uri; @@ -28,11 +38,17 @@ public AbstractAuthentication(URI uri, String realm) public abstract String getType(); + /** + * @return the URI this authentication applies to + */ public URI getURI() { return uri; } + /** + * @return the authentication realm + */ public String getRealm() { return realm; diff --git a/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/DuplexConnectionPool.java b/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/DuplexConnectionPool.java index efc44ec0eba5..2d8699a760df 100644 --- a/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/DuplexConnectionPool.java +++ b/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/DuplexConnectionPool.java @@ -16,9 +16,19 @@ import org.eclipse.jetty.util.ConcurrentPool; import org.eclipse.jetty.util.annotation.ManagedObject; +/** + *

A connection pool that provides connections for both directions of communication. + * This pool uses a concurrent pool with FIRST strategy to manage connections efficiently.

+ */ @ManagedObject public class DuplexConnectionPool extends AbstractConnectionPool { + /** + * Creates a duplex connection pool for the given destination. + * + * @param destination the destination for which this pool provides connections + * @param maxConnections the maximum number of connections in the pool + */ public DuplexConnectionPool(Destination destination, int maxConnections) { super(destination, () -> new ConcurrentPool<>(ConcurrentPool.StrategyType.FIRST, maxConnections), 1); diff --git a/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/Origin.java b/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/Origin.java index 9b0781ffd970..3d5c0a86fe13 100644 --- a/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/Origin.java +++ b/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/Origin.java @@ -94,26 +94,41 @@ public Origin(String scheme, Address address, Object tag, Protocol protocol, Tra this.transport = transport; } + /** + * @return the URI scheme (http, https, etc.) + */ public String getScheme() { return scheme; } + /** + * @return the network address (host and port) + */ public Address getAddress() { return address; } + /** + * @return the tag object that distinguishes destinations with the same scheme, host, port and protocol + */ public Object getTag() { return tag; } + /** + * @return the network protocol, or null if not specified + */ public Protocol getProtocol() { return protocol; } + /** + * @return the transport mechanism (TCP/IP, Unix domain socket, etc.) + */ public Transport getTransport() { return transport; @@ -140,6 +155,9 @@ public boolean equals(Object obj) Objects.equals(transport, that.transport); } + /** + * @return a string representation of this origin as a URI + */ public String asString() { return HttpURI.from(scheme, address.host, address.port, null).asString(); @@ -171,11 +189,17 @@ public Address(String host, int port) this.address = InetSocketAddress.createUnresolved(getHost(), getPort()); } + /** + * @return the host name or IP address + */ public String getHost() { return host; } + /** + * @return the port number + */ public int getPort() { return port; @@ -198,11 +222,17 @@ public int hashCode() return Objects.hash(host, port); } + /** + * @return a string representation of this address as host:port + */ public String asString() { return String.format("%s:%d", host, port); } + /** + * @return the socket address for this host and port + */ public SocketAddress getSocketAddress() { return address; @@ -241,11 +271,17 @@ public Protocol(List protocols, boolean negotiate) this.negotiate = negotiate; } + /** + * @return the list of protocol names associated with this protocol + */ public List getProtocols() { return protocols; } + /** + * @return true if this protocol should be negotiated, false otherwise + */ public boolean isNegotiate() { return negotiate; @@ -268,6 +304,9 @@ public int hashCode() return Objects.hash(protocols, negotiate); } + /** + * @return a string representation of this protocol + */ public String asString() { return String.format("proto=%s,nego=%b", protocols, negotiate); diff --git a/jetty-core/jetty-security/src/main/java/org/eclipse/jetty/security/HashLoginService.java b/jetty-core/jetty-security/src/main/java/org/eclipse/jetty/security/HashLoginService.java index cd0a9a9cc5d4..71ffc18a1ef8 100644 --- a/jetty-core/jetty-security/src/main/java/org/eclipse/jetty/security/HashLoginService.java +++ b/jetty-core/jetty-security/src/main/java/org/eclipse/jetty/security/HashLoginService.java @@ -40,21 +40,38 @@ public class HashLoginService extends AbstractLoginService private UserStore _userStore; private boolean _userStoreAutoCreate = false; + /** + * Creates a hash login service with no name or configuration. + */ public HashLoginService() { } + /** + * Creates a hash login service with the specified name. + * + * @param name the name of this login service + */ public HashLoginService(String name) { setName(name); } + /** + * Creates a hash login service with the specified name and configuration. + * + * @param name the name of this login service + * @param config the resource containing user configuration + */ public HashLoginService(String name, Resource config) { setName(name); setConfig(config); } + /** + * @return the configuration resource containing user data + */ public Resource getConfig() { return _config; diff --git a/jetty-core/jetty-security/src/main/java/org/eclipse/jetty/security/ServerAuthException.java b/jetty-core/jetty-security/src/main/java/org/eclipse/jetty/security/ServerAuthException.java index 9551d9cddb29..d7fceea3253d 100644 --- a/jetty-core/jetty-security/src/main/java/org/eclipse/jetty/security/ServerAuthException.java +++ b/jetty-core/jetty-security/src/main/java/org/eclipse/jetty/security/ServerAuthException.java @@ -21,20 +21,39 @@ public class ServerAuthException extends GeneralSecurityException { + /** + * Creates a server authentication exception with no message. + */ public ServerAuthException() { } + /** + * Creates a server authentication exception with the given message. + * + * @param s the exception message + */ public ServerAuthException(String s) { super(s); } + /** + * Creates a server authentication exception with the given message and cause. + * + * @param s the exception message + * @param throwable the underlying cause + */ public ServerAuthException(String s, Throwable throwable) { super(s, throwable); } + /** + * Creates a server authentication exception with the given cause. + * + * @param throwable the underlying cause + */ public ServerAuthException(Throwable throwable) { super(throwable); diff --git a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/Attachable.java b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/Attachable.java index 981fc71dce96..f9cb18a747be 100644 --- a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/Attachable.java +++ b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/Attachable.java @@ -25,9 +25,9 @@ public interface Attachable Object getAttachment(); /** - * Attaches the given object to this stream for later retrieval. + * Attaches the given object for later retrieval. * - * @param attachment the object to attach to this instance + * @param attachment the object to attach */ void setAttachment(Object attachment); } diff --git a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/Fields.java b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/Fields.java index b0a2842ea217..2367dae392c7 100644 --- a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/Fields.java +++ b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/Fields.java @@ -47,7 +47,7 @@ public Fields() } /** - *

Creates an empty, modifiable, case insensitive {@code Fields} instance.

** + *

Creates an empty, modifiable {@code Fields} instance.

* * @param caseSensitive whether this {@code Fields} instance must be case sensitive */ @@ -56,16 +56,31 @@ public Fields(boolean caseSensitive) this(caseSensitive ? new LinkedHashMap<>() : new TreeMap<>(String::compareToIgnoreCase)); } + /** + * Creates a {@code Fields} instance from a MultiMap. + * + * @param params the multimap to convert to fields + */ public Fields(MultiMap params) { this(multiMapToMapOfFields(params)); } + /** + * Creates a {@code Fields} instance from a map of fields. + * + * @param fields the map of fields to use + */ public Fields(Map fields) { this.fields = fields; } + /** + * Creates a copy of the given {@code Fields} instance. + * + * @param fields the fields to copy + */ public Fields(Fields fields) { if (fields.fields instanceof TreeMap) @@ -87,6 +102,9 @@ else if (Collections.unmodifiableMap(fields.fields) == fields.fields) } } + /** + * @return an immutable view of this fields instance + */ public Fields asImmutable() { Map unmodifiable = Collections.unmodifiableMap(fields); diff --git a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/SocketAddressResolver.java b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/SocketAddressResolver.java index 85ed5840fe2d..6f86b84ec933 100644 --- a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/SocketAddressResolver.java +++ b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/SocketAddressResolver.java @@ -109,8 +109,8 @@ public static class Async implements SocketAddressResolver private final long timeout; /** - * Creates a new instance with the given executor (to perform DNS resolution in a separate thread), - * the given scheduler (to cancel the operation if it takes too long) and the given timeout, in milliseconds. + * Creates a new instance with the specified executor (to perform DNS resolution in a separate thread), + * scheduler (to cancel the operation if it takes too long) and timeout, in milliseconds. * * @param executor the thread pool to use to perform DNS resolution in pooled threads * @param scheduler the scheduler to schedule tasks to cancel DNS resolution if it takes too long @@ -123,11 +123,17 @@ public Async(Executor executor, Scheduler scheduler, long timeout) this.timeout = timeout; } + /** + * @return the executor used for DNS resolution + */ public Executor getExecutor() { return executor; } + /** + * @return the scheduler used for timeout operations + */ public Scheduler getScheduler() { return scheduler; diff --git a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/security/SecurityUtils.java b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/security/SecurityUtils.java index 301965e997af..2f0563d82b86 100644 --- a/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/security/SecurityUtils.java +++ b/jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/security/SecurityUtils.java @@ -154,7 +154,7 @@ private static T doPrivileged(MethodHandle doPrivileged, PrivilegedAction } /** - *

Runs the given action as the given subject.

+ *

Runs the action as the specified subject.

* * @param subject the subject this action runs as * @param action the action to run diff --git a/jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/DefaultServletTest.java b/jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/DefaultServletTest.java index 0caf033b04a2..4301bfc35abd 100644 --- a/jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/DefaultServletTest.java +++ b/jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/DefaultServletTest.java @@ -1242,7 +1242,7 @@ public void testWelcomeMultipleDefaultServletsDifferentBases() throws Exception assertThat(response.toString(), response.getStatus(), is(HttpStatus.OK_200)); assertThat(response.getContent(), containsString("

Alt Index

")); - // Let's try deleting the `index.html` and accesing the welcome file at `index.htm` + // Let's try deleting the `index.html` and accessing the welcome file at `index.htm` // We skip this section of the test if the OS or filesystem doesn't support instantaneous delete // such as what happens on Microsoft Windows. if (deleteFile(altIndex)) diff --git a/jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/DispatcherTest.java b/jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/DispatcherTest.java index b53da7848cb3..c46282e3706a 100644 --- a/jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/DispatcherTest.java +++ b/jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/DispatcherTest.java @@ -173,7 +173,7 @@ public void testMultiPartForwardAttribute() throws Exception } @Test - public void testFowardThenForward() throws Exception + public void testForwardThenForward() throws Exception { _contextHandler.addServlet(ForwardServlet.class, "/ForwardServlet/*"); _contextHandler.addServlet(AlwaysForwardServlet.class, "/AlwaysForwardServlet/*"); diff --git a/jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/ResourceServletTest.java b/jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/ResourceServletTest.java index 7ebb934b31ae..4bd5cd2514b1 100644 --- a/jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/ResourceServletTest.java +++ b/jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/ResourceServletTest.java @@ -1306,7 +1306,7 @@ public void testWelcomeMultipleResourceServletsDifferentBases() throws Exception assertThat(response.toString(), response.getStatus(), is(HttpStatus.OK_200)); assertThat(response.getContent(), containsString("

Alt Index

")); - // Let's try deleting the `index.html` and accesing the welcome file at `index.htm` + // Let's try deleting the `index.html` and accessing the welcome file at `index.htm` // We skip this section of the test if the OS or filesystem doesn't support instantaneous delete // such as what happens on Microsoft Windows. if (deleteFile(altIndex)) diff --git a/jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/ServletUpgradeTest.java b/jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/ServletUpgradeTest.java index 8fd6a338b95f..e2fff4bd1400 100644 --- a/jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/ServletUpgradeTest.java +++ b/jetty-ee10/jetty-ee10-servlet/src/test/java/org/eclipse/jetty/ee10/servlet/ServletUpgradeTest.java @@ -334,7 +334,7 @@ private static boolean compareString(String expected, String actual) } LOG.debug("[ServletTestUtil] Found search string: '" + search + "' at index '" + searchIdx + "' in the server's " + "response"); - // the new searchIdx is the old index plus the lenght of the + // the new searchIdx is the old index plus the length of the // search string. startIdx = searchIdx + search.length(); } diff --git a/jetty-ee9/jetty-ee9-jaspi/src/main/java/org/eclipse/jetty/ee9/security/jaspi/callback/CredentialValidationCallback.java b/jetty-ee9/jetty-ee9-jaspi/src/main/java/org/eclipse/jetty/ee9/security/jaspi/callback/CredentialValidationCallback.java index 9563f06b5ba0..b4fa6c554dd9 100644 --- a/jetty-ee9/jetty-ee9-jaspi/src/main/java/org/eclipse/jetty/ee9/security/jaspi/callback/CredentialValidationCallback.java +++ b/jetty-ee9/jetty-ee9-jaspi/src/main/java/org/eclipse/jetty/ee9/security/jaspi/callback/CredentialValidationCallback.java @@ -38,6 +38,9 @@ public CredentialValidationCallback(Subject subject, String userName, Credential _credential = credential; } + /** + * @return the credential for validation + */ public Credential getCredential() { return _credential; @@ -48,16 +51,25 @@ public void clearCredential() _credential = null; } + /** + * @return true if validation was successful, false otherwise + */ public boolean getResult() { return _result; } + /** + * @return the subject associated with this credential validation + */ public javax.security.auth.Subject getSubject() { return _subject; } + /** + * @return the username associated with the credential + */ public java.lang.String getUsername() { return _userName; diff --git a/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/ServletUpgradeTest.java b/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/ServletUpgradeTest.java index 3e271d603c86..4d1a5b4a4490 100644 --- a/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/ServletUpgradeTest.java +++ b/jetty-ee9/jetty-ee9-servlet/src/test/java/org/eclipse/jetty/ee9/servlet/ServletUpgradeTest.java @@ -334,7 +334,7 @@ private static boolean compareString(String expected, String actual) } LOG.debug("[ServletTestUtil] Found search string: '" + search + "' at index '" + searchIdx + "' in the server's " + "response"); - // the new searchIdx is the old index plus the lenght of the + // the new searchIdx is the old index plus the length of the // search string. startIdx = searchIdx + search.length(); } diff --git a/jetty-ee9/jetty-ee9-websocket/jetty-ee9-websocket-jetty-api/src/main/java/org/eclipse/jetty/ee9/websocket/api/WebSocketConnectionListener.java b/jetty-ee9/jetty-ee9-websocket/jetty-ee9-websocket-jetty-api/src/main/java/org/eclipse/jetty/ee9/websocket/api/WebSocketConnectionListener.java index fdc38a5d4c5d..42586c6ed162 100644 --- a/jetty-ee9/jetty-ee9-websocket/jetty-ee9-websocket-jetty-api/src/main/java/org/eclipse/jetty/ee9/websocket/api/WebSocketConnectionListener.java +++ b/jetty-ee9/jetty-ee9-websocket/jetty-ee9-websocket-jetty-api/src/main/java/org/eclipse/jetty/ee9/websocket/api/WebSocketConnectionListener.java @@ -44,7 +44,7 @@ default void onWebSocketConnect(Session session) /** * A WebSocket exception has occurred. *

- * This is a way for the internal implementation to notify of exceptions occured during the processing of websocket. + * This is a way for the internal implementation to notify of exceptions occurred during the processing of websocket. *

* Usually this occurs from bad / malformed incoming packets. (example: bad UTF8 data, frames that are too big, violations of the spec) *

diff --git a/jetty-integrations/jetty-gcloud/jetty-gcloud-session-manager/src/main/java/org/eclipse/jetty/gcloud/session/GCloudSessionDataStoreFactory.java b/jetty-integrations/jetty-gcloud/jetty-gcloud-session-manager/src/main/java/org/eclipse/jetty/gcloud/session/GCloudSessionDataStoreFactory.java index 58466efefe78..e82691c57f9e 100644 --- a/jetty-integrations/jetty-gcloud/jetty-gcloud-session-manager/src/main/java/org/eclipse/jetty/gcloud/session/GCloudSessionDataStoreFactory.java +++ b/jetty-integrations/jetty-gcloud/jetty-gcloud-session-manager/src/main/java/org/eclipse/jetty/gcloud/session/GCloudSessionDataStoreFactory.java @@ -29,6 +29,9 @@ public class GCloudSessionDataStoreFactory extends AbstractSessionDataStoreFacto private String _host; private String _projectId; + /** + * @return the entity data model for Google Cloud Datastore + */ public GCloudSessionDataStore.EntityDataModel getEntityDataModel() { return _model; @@ -39,6 +42,9 @@ public void setEntityDataModel(GCloudSessionDataStore.EntityDataModel model) _model = model; } + /** + * @return the maximum number of retries for Google Cloud operations + */ public int getMaxRetries() { return _maxRetries; @@ -49,6 +55,9 @@ public void setMaxRetries(int maxRetries) _maxRetries = maxRetries; } + /** + * @return the backoff time in milliseconds between retries + */ public int getBackoffMs() { return _backoffMs; @@ -82,6 +91,9 @@ public void setHost(String host) _host = host; } + /** + * @return the host for the Google Cloud Datastore connection + */ public String getHost() { return _host; @@ -92,6 +104,9 @@ public void setProjectId(String projectId) _projectId = projectId; } + /** + * @return the Google Cloud project ID + */ public String getProjectId() { return _projectId; diff --git a/jetty-integrations/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoUtils.java b/jetty-integrations/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoUtils.java index 285d0444ddd6..cb0566c051d5 100644 --- a/jetty-integrations/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoUtils.java +++ b/jetty-integrations/jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoUtils.java @@ -35,6 +35,9 @@ public class MongoUtils { + /** + * @return the decoded object value from MongoDB binary data + */ public static Object decodeValue(final Object valueToDecode) throws IOException, ClassNotFoundException { if (valueToDecode == null || valueToDecode instanceof Number || valueToDecode instanceof String || valueToDecode instanceof Boolean || valueToDecode instanceof Date) @@ -71,16 +74,25 @@ else if (valueToDecode instanceof Document) } } + /** + * @return the decoded name with special characters unescaped + */ public static String decodeName(String name) { return URIUtil.decodeSpecific(name, ".%"); } + /** + * @return the encoded name with special characters escaped for MongoDB + */ public static String encodeName(String name) { return URIUtil.encodeSpecific(name, ".%"); } + /** + * @return the encoded object value suitable for MongoDB storage + */ public static Object encodeName(Object value) throws IOException { if (value instanceof Number || value instanceof String || value instanceof Boolean || value instanceof Date)