Package com.xceptance.xlt.api.engine
Class RequestFilter
java.lang.Object
com.xceptance.xlt.api.engine.RequestFilter
Request filter.
Used to get filtered data from
Used to get filtered data from
NetworkDataManager. Currently, filtering is restricted to the request's URL.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(WebRequest request) Returns whether or not the this filter accepts the given request.Regular expression to match the host of the wanted requestPath patternintgetPort()Port numberRequest protocol of the wanted requestQuery PatternURL Pattern If the URL pattern is set this overrides all other filters.voidsetHostPattern(String regex) Regular expression the matches the wanted request's hostvoidsetPathPattern(String regex) Path patternvoidsetPort(int port) Port number of the wanted requestvoidsetProtocol(String protocol) Request protocol (http,https, ...)voidsetQueryPattern(String regex) Query patternvoidsetUrlPattern(String regex) URL Pattern If the URL pattern is set this overrides all other filters.
-
Constructor Details
-
RequestFilter
public RequestFilter()
-
-
Method Details
-
getProtocol
Request protocol of the wanted request- Returns:
- request protocol of the wanted request
-
setProtocol
Request protocol (http,https, ...)- Parameters:
protocol- the wanted request's protocol ornullto disable protocol filtering
-
getHostPattern
Regular expression to match the host of the wanted request- Returns:
- regular expression to match the host or
nullif no host filter is set
-
setHostPattern
Regular expression the matches the wanted request's host- Parameters:
regex- regular expression the matches the wanted request's host ornullto disable host filtering
-
getPort
public int getPort()Port number- Returns:
- port number of the wanted request or
-1if 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-1to disable port filtering
-
getPathPattern
Path pattern- Returns:
- regular expression that matches the wanted request's path or
nullif path filtering is disabled
-
setPathPattern
Path pattern- Parameters:
regex- regular expression that matches the wanted request's path ornullto disable path filtering
-
getQueryPattern
Query Pattern- Returns:
- regular expression that matches the wanted request's query string or
nullif query filtering is disabled
-
setQueryPattern
Query pattern- Parameters:
regex- regular expression that matches the wanted request's query string ornullif query filtering is disabled
-
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
nullif URL filtering is disabled
-
setUrlPattern
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 ornullto disable URL filtering
-
accepts
Returns whether or not the this filter accepts the given request.- Parameters:
request- the request to be checked- Returns:
trueif this filter accepts the given request,falseotherwise
-