From 50f1b1da794cd93b70ab5456d3c2c984408e1506 Mon Sep 17 00:00:00 2001 From: Mark Thomas Date: Mon, 18 Jan 2016 13:13:35 +0000 Subject: [PATCH] Expand the session attribute filtering options - new option to filter based on implementation class of value - new option to log a warning message if an attribute is filtered out - always log a message at at least debug level if an attribute is filtered out git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1725263 13f79535-47bb-0310-9956-ffa450edef68 --- .../ha/session/mbeans-descriptors.xml | 16 +++ .../catalina/session/LocalStrings.properties | 2 + .../apache/catalina/session/ManagerBase.java | 119 +++++++++++++++++- .../catalina/session/mbeans-descriptors.xml | 16 +++ webapps/docs/changelog.xml | 7 ++ webapps/docs/config/cluster-manager.xml | 67 ++++++++-- webapps/docs/config/manager.xml | 47 ++++++- 7 files changed, 256 insertions(+), 18 deletions(-) diff --git a/java/org/apache/catalina/ha/session/mbeans-descriptors.xml b/java/org/apache/catalina/ha/session/mbeans-descriptors.xml index 9cdfe54e4677..511c7679eb78 100644 --- a/java/org/apache/catalina/ha/session/mbeans-descriptors.xml +++ b/java/org/apache/catalina/ha/session/mbeans-descriptors.xml @@ -314,6 +314,14 @@ name="sessionAttributeNameFilter" descritpion="The string pattern used for including session attributes in replication. Null means all attributes are included." type="java.lang.String"/> + + + + + + + + + + + + + + Extend the session attribute filtering options to include filtering + based on the implementation class of the value and optional + WARN level logging if an attribute is filtered. These + options are avaialble for all of the Manager implementations that ship + with Tomcat. (markt) + diff --git a/webapps/docs/config/cluster-manager.xml b/webapps/docs/config/cluster-manager.xml index ad7bbbfc5d54..8d6c3c1756f5 100644 --- a/webapps/docs/config/cluster-manager.xml +++ b/webapps/docs/config/cluster-manager.xml @@ -77,17 +77,6 @@ when session attributes are being replicated or removed across Tomcat nodes in the cluster. - - A regular expression used to filter which session attributes will be - replicated. An attribute will only be replicated if its name matches - this pattern. If the pattern is zero length or null, all - attributes are eligible for replication. The pattern is anchored so the - session attribute name must fully match the pattern. As an example, the - value (userName|sessionHistory) will only replicate the - two session attributes named userName and - sessionHistory. If not specified, the default value of - null will be used. -

The initial maximum time interval, in seconds, between client requests before a session is invalidated. A negative value @@ -184,6 +173,26 @@ effective only when sendAllSessions is false. Default is 2000 milliseconds. + +

A regular expression used to filter which session attributes will be + replicated. An attribute will only be replicated if its name matches + this pattern. If the pattern is zero length or null, all + attributes are eligible for replication. The pattern is anchored so the + session attribute name must fully match the pattern. As an example, the + value (userName|sessionHistory) will only replicate the + two session attributes named userName and + sessionHistory. If not specified, the default value of + null will be used.

+
+ +

A regular expression used to filter which session attributes will be + replicated. An attribute will only be replicated if the implementation + class name of the value matches this pattern. If the pattern is zero + length or null, all attributes are eligible for + replication. The pattern is anchored so the fully qualified class name + must fully match the pattern. If not specified, the default value of + null will be used.

+
When this node sends a GET_ALL_SESSIONS message to other node, all session messages that are received as a response are queued. @@ -195,6 +204,14 @@ If set to false, all queued session messages are handled. Default is true. + +

If sessionAttributeNameFilter or + sessionAttributeValueClassNameFilter blocks an + attribute, should this be logged at WARN level? If + WARN level logging is disabled then it will be logged at + DEBUG. The default value of this attribute is + false.

+
@@ -218,6 +235,26 @@ another map. Default value is 15000 milliseconds.
+ +

A regular expression used to filter which session attributes will be + replicated. An attribute will only be replicated if its name matches + this pattern. If the pattern is zero length or null, all + attributes are eligible for replication. The pattern is anchored so the + session attribute name must fully match the pattern. As an example, the + value (userName|sessionHistory) will only replicate the + two session attributes named userName and + sessionHistory. If not specified, the default value of + null will be used.

+
+ +

A regular expression used to filter which session attributes will be + replicated. An attribute will only be replicated if the implementation + class name of the value matches this pattern. If the pattern is zero + length or null, all attributes are eligible for + replication. The pattern is anchored so the fully qualified class name + must fully match the pattern. If not specified, the default value of + null will be used.

+
Set to true if you wish to terminate replication map when replication map fails to start. If replication map is terminated, associated context @@ -225,6 +262,14 @@ does not end. It will try to join the map membership in the heartbeat. Default value is false . + +

If sessionAttributeNameFilter or + sessionAttributeValueClassNameFilter blocks an + attribute, should this be logged at WARN level? If + WARN level logging is disabled then it will be logged at + DEBUG. The default value of this attribute is + false.

+
diff --git a/webapps/docs/config/manager.xml b/webapps/docs/config/manager.xml index ac1e9bbc36ea..97f1ce31c88b 100644 --- a/webapps/docs/config/manager.xml +++ b/webapps/docs/config/manager.xml @@ -167,7 +167,7 @@
- A regular expression used to filter which session attributes will be +

A regular expression used to filter which session attributes will be distributed. An attribute will only be distributed if its name matches this pattern. If the pattern is zero length or null, all attributes are eligible for distribution. The pattern is anchored so the @@ -175,7 +175,26 @@ value (userName|sessionHistory) will only distribute the two session attributes named userName and sessionHistory. If not specified, the default value of - null will be used. + null will be used.

+
+ + +

A regular expression used to filter which session attributes will be + distributed. An attribute will only be distributed if the implementation + class name of the value matches this pattern. If the pattern is zero + length or null, all attributes are eligible for + distribution. The pattern is anchored so the fully qualified class name + must fully match the pattern. If not specified, the default value of + null will be used.

+
+ + +

If sessionAttributeNameFilter or + sessionAttributeValueClassNameFilter blocks an + attribute, should this be logged at WARN level? If + WARN level logging is disabled then it will be logged at + DEBUG. The default value of this attribute is + false.

@@ -266,8 +285,9 @@ org.apache.catalina.session.StandardManager class.

+ - A regular expression used to filter which session attributes will be +

A regular expression used to filter which session attributes will be distributed. An attribute will only be distributed if its name matches this pattern. If the pattern is zero length or null, all attributes are eligible for distribution. The pattern is anchored so the @@ -275,7 +295,26 @@ value (userName|sessionHistory) will only distribute the two session attributes named userName and sessionHistory. If not specified, the default value of - null will be used. + null will be used.

+
+ + +

A regular expression used to filter which session attributes will be + distributed. An attribute will only be distributed if the implementation + class name of the value matches this pattern. If the pattern is zero + length or null, all attributes are eligible for + distribution. The pattern is anchored so the fully qualified class name + must fully match the pattern. If not specified, the default value of + null will be used.

+
+ + +

If sessionAttributeNameFilter or + sessionAttributeValueClassNameFilter blocks an + attribute, should this be logged at WARN level? If + WARN level logging is disabled then it will be logged at + DEBUG. The default value of this attribute is + false.