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(ListCreates 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(MultiMapRuns 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("- * 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)