changeset 430:dea663a83aaf

HttpSessionCookieFilter "removeInvalidSessionId" parameter
author Devel 2
date Wed, 26 Jul 2017 13:38:35 +0200
parents 5c03e080c1c4
children bbc6b52ab089
files stress-tester/src/main/java/com/passus/st/client/http/filter/HttpSessionCookieFilter.java
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpSessionCookieFilter.java	Wed Jul 26 13:38:04 2017 +0200
+++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpSessionCookieFilter.java	Wed Jul 26 13:38:35 2017 +0200
@@ -7,6 +7,7 @@
 import static com.passus.config.schema.ConfigurationSchemaBuilder.mapDef;
 import static com.passus.config.schema.ConfigurationSchemaBuilder.tupleDef;
 import static com.passus.config.schema.ConfigurationSchemaBuilder.valueDef;
+import static com.passus.config.schema.ConfigurationSchemaBuilder.valueDefBool;
 import com.passus.config.schema.NodeDefinition;
 import com.passus.config.schema.NodeDefinitionCreator;
 import com.passus.data.ByteString;
@@ -37,17 +38,18 @@
  */
 @NodeDefinitionCreate(HttpSessionCookieFilter.HttpSessionCookieFilterNodeDefCreator.class)
 @Plugin(name = HttpSessionCookieFilter.TYPE, category = PluginConstants.CATEGORY_HTTP_FILTER)
-public class HttpSessionCookieFilter extends HttpFilter {
+public final class HttpSessionCookieFilter extends HttpFilter {
 
     public static final String TYPE = "session";
 
     private static final Logger LOGGER = LogManager.getLogger(HttpSessionCookieFilter.class);
 
-    private static final List<String> DEFAULT_COOKIE_NAMES = Arrays.asList(
+    private static final List<CharSequence> DEFAULT_COOKIE_NAMES = Arrays.asList(
             "JSESSIONID", "PHPSESSID"
     );
 
     private final Set<CharSequence> cookieNames;
+
     /**
      * Maps SID from input file to SID from live communication.
      */
@@ -96,6 +98,7 @@
     public void configure(Configuration config) {
         cookieNames.clear();
         cookieNames.addAll((Collection) config.get("sessionCookieNames", DEFAULT_COOKIE_NAMES));
+        removeInvalidSessionId = (Boolean) config.get("removeInvalidSessionId", true);
     }
 
     @Override
@@ -159,7 +162,8 @@
         @Override
         public NodeDefinition create() {
             return mapDef(
-                    tupleDef("sessionCookieNames", listDef(valueDef())).setRequired(false)
+                    tupleDef("sessionCookieNames", listDef(valueDef())).setRequired(false),
+                    tupleDef("removeInvalidSessionId", valueDefBool()).setRequired(false)
             );
         }