Class IsolationSource

java.lang.Object
org.mockserver.llm.IsolationSource

public final class IsolationSource extends Object
Describes where to extract the isolation key from an inbound HTTP request for per-session conversation state isolation.

Usage:

 isolateBy(IsolationSource.header("x-session-id"))
 isolateBy(IsolationSource.queryParameter("agent"))
 isolateBy(IsolationSource.cookie("sid"))
 
  • Method Details

    • header

      public static IsolationSource header(String name)
    • queryParameter

      public static IsolationSource queryParameter(String name)
    • cookie

      public static IsolationSource cookie(String name)
    • getKind

      public IsolationSource.Kind getKind()
    • getName

      public String getName()
    • encode

      public String encode()
      Encode the isolation source as a string for embedding in scenario names. Format: "kind:name" (e.g. "header:x-session-id").
    • decode

      public static IsolationSource decode(String encoded)
      Decode an isolation source from its encoded string form.
      Parameters:
      encoded - the encoded string (e.g. "header:x-session-id")
      Returns:
      the decoded IsolationSource, or null if the format is invalid
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object