Package com.xceptance.xlt.api.engine
Class RequestFilter
- java.lang.Object
-
- com.xceptance.xlt.api.engine.RequestFilter
-
public class RequestFilter extends java.lang.Object
Request filter.
Used to get filtered data fromNetworkDataManager
. Currently, filtering is restricted to the request's URL.
-
-
Constructor Summary
Constructors Constructor Description RequestFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accepts(WebRequest request)
Returns whether or not the this filter accepts the given request.java.lang.String
getHostPattern()
Regular expression to match the host of the wanted requestjava.lang.String
getPathPattern()
Path patternint
getPort()
Port numberjava.lang.String
getProtocol()
Request protocol of the wanted requestjava.lang.String
getQueryPattern()
Query Patternjava.lang.String
getUrlPattern()
URL Pattern If the URL pattern is set this overrides all other filters.void
setHostPattern(java.lang.String regex)
Regular expression the matches the wanted request's hostvoid
setPathPattern(java.lang.String regex)
Path patternvoid
setPort(int port)
Port number of the wanted requestvoid
setProtocol(java.lang.String protocol)
Request protocol (http
,https
, ...)void
setQueryPattern(java.lang.String regex)
Query patternvoid
setUrlPattern(java.lang.String regex)
URL Pattern If the URL pattern is set this overrides all other filters.
-
-
-
Method Detail
-
getProtocol
public java.lang.String getProtocol()
Request protocol of the wanted request- Returns:
- request protocol of the wanted request
-
setProtocol
public void setProtocol(java.lang.String protocol)
Request protocol (http
,https
, ...)- Parameters:
protocol
- the wanted request's protocol ornull
to disable protocol filtering
-
getHostPattern
public java.lang.String getHostPattern()
Regular expression to match the host of the wanted request- Returns:
- regular expression to match the host or
null
if no host filter is set
-
setHostPattern
public void setHostPattern(java.lang.String regex)
Regular expression the matches the wanted request's host- Parameters:
regex
- regular expression the matches the wanted request's host ornull
to disable host filtering
-
getPort
public int getPort()
Port number- Returns:
- port number of the wanted request or
-1
if no port filter is set
-
setPort
public void setPort(int port)
Port number of the wanted request- Parameters:
port
- port number of the wanted request or-1
to disable port filtering
-
getPathPattern
public java.lang.String getPathPattern()
Path pattern- Returns:
- regular expression that matches the wanted request's path or
null
if path filtering is disabled
-
setPathPattern
public void setPathPattern(java.lang.String regex)
Path pattern- Parameters:
regex
- regular expression that matches the wanted request's path ornull
to disable path filtering
-
getQueryPattern
public java.lang.String getQueryPattern()
Query Pattern- Returns:
- regular expression that matches the wanted request's query string or
null
if query filtering is disabled
-
setQueryPattern
public void setQueryPattern(java.lang.String regex)
Query pattern- Parameters:
regex
- regular expression that matches the wanted request's query string ornull
if query filtering is disabled
-
getUrlPattern
public java.lang.String getUrlPattern()
URL Pattern If the URL pattern is set this overrides all other filters.- Returns:
- regular expression that matches the wanted request's URL string or
null
if URL filtering is disabled
-
setUrlPattern
public void setUrlPattern(java.lang.String regex)
URL Pattern If the URL pattern is set this overrides all other filters.- Parameters:
regex
- regular expression that matches the wanted request's URL string ornull
to disable URL filtering
-
accepts
public boolean accepts(WebRequest request)
Returns whether or not the this filter accepts the given request.- Parameters:
request
- the request to be checked- Returns:
true
if this filter accepts the given request,false
otherwise
-
-