This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new 2f634314eb Add javadoc
2f634314eb is described below

commit 2f634314eb63b3cf9785d717b470285e9ddd6c77
Author: remm <[email protected]>
AuthorDate: Thu Apr 2 15:24:41 2026 +0200

    Add javadoc
---
 .../org/apache/coyote/ajp/AbstractAjpProtocol.java | 120 ++++++++++++++++++++-
 1 file changed, 116 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/coyote/ajp/AbstractAjpProtocol.java 
b/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
index 76112b980c..337b0ce872 100644
--- a/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
+++ b/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
@@ -43,6 +43,11 @@ public abstract class AbstractAjpProtocol<S> extends 
AbstractProtocol<S> {
     protected static final StringManager sm = 
StringManager.getManager(AbstractAjpProtocol.class);
 
 
+    /**
+     * Creates a new AJP protocol handler.
+     *
+     * @param endpoint The endpoint for low-level network I/O
+     */
     public AbstractAjpProtocol(AbstractEndpoint<S,?> endpoint) {
         super(endpoint);
         setConnectionTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
@@ -53,6 +58,11 @@ public abstract class AbstractAjpProtocol<S> extends 
AbstractProtocol<S> {
     }
 
 
+    /**
+     * Gets the name of the protocol.
+     *
+     * @return the protocol name
+     */
     @Override
     protected String getProtocolName() {
         return "Ajp";
@@ -90,6 +100,11 @@ public abstract class AbstractAjpProtocol<S> extends 
AbstractProtocol<S> {
 
     private boolean ajpFlush = true;
 
+    /**
+     * Gets whether AJP flush packets are used.
+     *
+     * @return <code>true</code> if flush packets are used
+     */
     public boolean getAjpFlush() {
         return ajpFlush;
     }
@@ -118,6 +133,11 @@ public abstract class AbstractAjpProtocol<S> extends 
AbstractProtocol<S> {
         return tomcatAuthentication;
     }
 
+    /**
+     * Sets whether authentication should be done in Tomcat.
+     *
+     * @param tomcatAuthentication {@code true} if authentication should be 
performed by Tomcat
+     */
     public void setTomcatAuthentication(boolean tomcatAuthentication) {
         this.tomcatAuthentication = tomcatAuthentication;
     }
@@ -134,6 +154,11 @@ public abstract class AbstractAjpProtocol<S> extends 
AbstractProtocol<S> {
         return tomcatAuthorization;
     }
 
+    /**
+     * Sets whether authorization should be done by Tomcat.
+     *
+     * @param tomcatAuthorization {@code true} if authorization should be 
performed by Tomcat
+     */
     public void setTomcatAuthorization(boolean tomcatAuthorization) {
         this.tomcatAuthorization = tomcatAuthorization;
     }
@@ -150,6 +175,11 @@ public abstract class AbstractAjpProtocol<S> extends 
AbstractProtocol<S> {
         this.secret = secret;
     }
 
+    /**
+     * Gets the secret that must be included with every request.
+     *
+     * @return the secret
+     */
     protected String getSecret() {
         return secret;
     }
@@ -179,10 +209,20 @@ public abstract class AbstractAjpProtocol<S> extends 
AbstractProtocol<S> {
 
     private boolean secretRequired = true;
 
+    /**
+     * Sets whether a secret is required with every request.
+     *
+     * @param secretRequired {@code true} if a secret is required
+     */
     public void setSecretRequired(boolean secretRequired) {
         this.secretRequired = secretRequired;
     }
 
+    /**
+     * Gets whether a secret is required with every request.
+     *
+     * @return {@code true} if a secret is required
+     */
     public boolean getSecretRequired() {
         return secretRequired;
     }
@@ -190,14 +230,29 @@ public abstract class AbstractAjpProtocol<S> extends 
AbstractProtocol<S> {
 
     private Pattern allowedRequestAttributesPattern;
 
+    /**
+     * Sets the pattern for allowed request attributes.
+     *
+     * @param allowedRequestAttributesPattern The regex pattern
+     */
     public void setAllowedRequestAttributesPattern(String 
allowedRequestAttributesPattern) {
         this.allowedRequestAttributesPattern = 
Pattern.compile(allowedRequestAttributesPattern);
     }
 
+    /**
+     * Gets the pattern for allowed request attributes.
+     *
+     * @return the pattern string
+     */
     public String getAllowedRequestAttributesPattern() {
         return allowedRequestAttributesPattern.pattern();
     }
 
+    /**
+     * Gets the compiled pattern for allowed request attributes.
+     *
+     * @return the pattern
+     */
     protected Pattern getAllowedRequestAttributesPatternInternal() {
         return allowedRequestAttributesPattern;
     }
@@ -208,15 +263,30 @@ public abstract class AbstractAjpProtocol<S> extends 
AbstractProtocol<S> {
      */
     private int packetSize = Constants.MAX_PACKET_SIZE;
 
+    /**
+     * Gets the AJP packet size.
+     *
+     * @return the packet size
+     */
     public int getPacketSize() {
         return packetSize;
     }
 
+    /**
+     * Sets the AJP packet size.
+     *
+     * @param packetSize The packet size (must be at least MAX_PACKET_SIZE)
+     */
     public void setPacketSize(int packetSize) {
         this.packetSize = Math.max(packetSize, Constants.MAX_PACKET_SIZE);
     }
 
 
+    /**
+     * Gets the desired buffer size for AJP packets.
+     *
+     * @return the desired buffer size
+     */
     @Override
     public int getDesiredBufferSize() {
         return getPacketSize() - Constants.SEND_HEAD_LEN;
@@ -225,42 +295,79 @@ public abstract class AbstractAjpProtocol<S> extends 
AbstractProtocol<S> {
 
     // --------------------------------------------- SSL is not supported in 
AJP
 
+    /**
+     * Adds an SSL host configuration. AJP does not support SSL so this logs a 
warning.
+     *
+     * @param sslHostConfig The SSL host configuration
+     */
     @Override
     public void addSslHostConfig(SSLHostConfig sslHostConfig) {
         getLog().warn(sm.getString("ajpprotocol.noSSL", 
sslHostConfig.getHostName()));
     }
 
-
+    /**
+     * Adds an SSL host configuration. AJP does not support SSL so this logs a 
warning.
+     *
+     * @param sslHostConfig The SSL host configuration
+     * @param replace       Whether to replace existing configurations
+     */
     @Override
     public void addSslHostConfig(SSLHostConfig sslHostConfig, boolean replace) 
{
         getLog().warn(sm.getString("ajpprotocol.noSSL", 
sslHostConfig.getHostName()));
     }
 
-
+    /**
+     * Finds SSL host configurations. AJP does not support SSL so this always 
returns an empty array.
+     *
+     * @return an empty array
+     */
     @Override
     public SSLHostConfig[] findSslHostConfigs() {
         return new SSLHostConfig[0];
     }
 
-
+    /**
+     * Adds an upgrade protocol. AJP does not support upgrade so this logs a 
warning.
+     *
+     * @param upgradeProtocol The upgrade protocol
+     */
     @Override
     public void addUpgradeProtocol(UpgradeProtocol upgradeProtocol) {
         getLog().warn(sm.getString("ajpprotocol.noUpgrade", 
upgradeProtocol.getClass().getName()));
     }
 
-
+    /**
+     * Finds upgrade protocols. AJP does not support upgrade so this always 
returns an empty array.
+     *
+     * @return an empty array
+     */
     @Override
     public UpgradeProtocol[] findUpgradeProtocols() {
         return new UpgradeProtocol[0];
     }
 
 
+    /**
+     * Creates a new AJP processor.
+     *
+     * @return the processor
+     */
     @Override
     protected Processor createProcessor() {
         return new AjpProcessor(this, getAdapter());
     }
 
 
+    /**
+     * Creates an upgrade processor. AJP does not support upgrade so this 
always throws.
+     *
+     * @param socket       The socket wrapper
+     * @param upgradeToken The upgrade token
+     *
+     * @return never returns
+     *
+     * @throws IllegalStateException always
+     */
     @Override
     protected Processor createUpgradeProcessor(SocketWrapperBase<?> socket, 
UpgradeToken upgradeToken) {
         throw new 
IllegalStateException(sm.getString("ajpprotocol.noUpgradeHandler",
@@ -268,6 +375,11 @@ public abstract class AbstractAjpProtocol<S> extends 
AbstractProtocol<S> {
     }
 
 
+    /**
+     * Starts the AJP protocol handler. Validates that a secret is configured 
if required.
+     *
+     * @throws Exception if start fails
+     */
     @Override
     public void start() throws Exception {
         if (getSecretRequired()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to