You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2026/09/14 21:24:01 UTC
(tomcat) branch 10.1.x updated: Add removeRealm, matching addRealm
This is an automated email from the ASF dual-hosted git repository.
rmaucher 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 8263bf0468 Add removeRealm, matching addRealm
8263bf0468 is described below
commit 8263bf046865f9f388215324c80d5aa90228d11b
Author: remm <re...@apache.org>
AuthorDate: Mon Sep 14 23:20:56 2026 +0200
Add removeRealm, matching addRealm
---
java/org/apache/catalina/realm/CombinedRealm.java | 22 ++++++++++++++++++++++
.../apache/catalina/realm/LocalStrings.properties | 1 +
2 files changed, 23 insertions(+)
diff --git a/java/org/apache/catalina/realm/CombinedRealm.java b/java/org/apache/catalina/realm/CombinedRealm.java
index 30b9fc5204..78b7793018 100644
--- a/java/org/apache/catalina/realm/CombinedRealm.java
+++ b/java/org/apache/catalina/realm/CombinedRealm.java
@@ -73,6 +73,28 @@ public class CombinedRealm extends RealmBase {
}
+ /**
+ * Remove a realm from the list of realms that are used to authenticate
+ * users.
+ *
+ * @param theRealm realm which should no longer be wrapped by the combined
+ * realm
+ *
+ * @return {@code true} if the realm was present and removed,
+ * {@code false} otherwise
+ */
+ public boolean removeRealm(Realm theRealm) {
+ boolean removed = realms.remove(theRealm);
+
+ if (removed && log.isDebugEnabled()) {
+ log.debug(sm.getString("combinedRealm.removeRealm", theRealm.getClass().getName(),
+ Integer.toString(realms.size())));
+ }
+
+ return removed;
+ }
+
+
/**
* Returns the JMX ObjectNames of the realms that this realm is wrapping.
* Entries for realms that do not implement LifecycleMBeanBase will be null.
diff --git a/java/org/apache/catalina/realm/LocalStrings.properties b/java/org/apache/catalina/realm/LocalStrings.properties
index 4e0cf9e312..026e756f94 100644
--- a/java/org/apache/catalina/realm/LocalStrings.properties
+++ b/java/org/apache/catalina/realm/LocalStrings.properties
@@ -23,6 +23,7 @@ combinedRealm.authSuccess=Authenticated user [{0}] with realm [{1}]
combinedRealm.getPassword=The getPassword() method should never be called
combinedRealm.getPrincipal=The getPrincipal() method should never be called
combinedRealm.realmStartFail=Failed to start [{0}] realm
+combinedRealm.removeRealm=Remove [{0}] realm, leaving a total of [{1}] realms
combinedRealm.setCredentialHandler=A CredentialHandler was set on an instance of the CombinedRealm (or a sub-class of CombinedRealm). CombinedRealm doesn't use a configured CredentialHandler. Is this a configuration error?
combinedRealm.unexpectedMethod=An unexpected call was made to a method on the combined realm
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org