Author: markt
Date: Mon Jan 18 11:56:54 2016
New Revision: 1725246
URL: http://svn.apache.org/viewvc?rev=1725246&view=rev
Log:
Improve Javadoc
Modified:
tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java
Modified: tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java?rev=1725246&r1=1725245&r2=1725246&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java Mon Jan 18
11:56:54 2016
@@ -33,6 +33,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;
import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
import org.apache.catalina.Container;
import org.apache.catalina.Context;
@@ -205,6 +206,16 @@ public abstract class ManagerBase extend
// ------------------------------------------------------------- Properties
+ /**
+ * Obtain the regular expression used to filter session attribute based on
+ * attribute name. The regular expression is anchored so it must match the
+ * entire name
+ *
+ * @return The regular expression currently used to filter attribute names.
+ * {@code null} means no filter is applied. If an empty string is
+ * specified then no names will match the filter and all attributes
+ * will be blocked.
+ */
public String getSessionAttributeNameFilter() {
if (sessionAttributeNamePattern == null) {
return null;
@@ -213,7 +224,20 @@ public abstract class ManagerBase extend
}
- public void setSessionAttributeNameFilter(String
sessionAttributeNameFilter) {
+ /**
+ * Set the regular expression to use to filter session attributes based on
+ * attribute name. The regular expression is anchored so it must match the
+ * entire name.
+ *
+ * @param sessionAttributeNameFilter The regular expression to use to
filter
+ * session attributes based on attribute name. Use {@code null} if
no
+ * filtering is required. If an empty string is specified then no
+ * names will match the filter and all attributes will be blocked.
+ *
+ * @throws PatternSyntaxException If the expression is not valid
+ */
+ public void setSessionAttributeNameFilter(String
sessionAttributeNameFilter)
+ throws PatternSyntaxException {
if (sessionAttributeNameFilter == null ||
sessionAttributeNameFilter.length() == 0) {
sessionAttributeNamePattern = null;
}
@@ -221,6 +245,13 @@ public abstract class ManagerBase extend
}
+ /**
+ * Provides {@link #getSessionAttributeNameFilter()} as a pre-compiled
+ * regular expression pattern.
+ *
+ * @return The pre-compiled pattern used to filter session attributes based
+ * on attribute name. {@code null} means no filter is applied.
+ */
protected Pattern getSessionAttributeNamePattern() {
return sessionAttributeNamePattern;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]