Package com.xceptance.xlt.api.engine
Class RequestFilter
- java.lang.Object
-
- com.xceptance.xlt.api.engine.RequestFilter
-
public class RequestFilter extends java.lang.ObjectRequest 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 booleanaccepts(WebRequest request)Returns whether or not the this filter accepts the given request.java.lang.StringgetHostPattern()Regular expression to match the host of the wanted requestjava.lang.StringgetPathPattern()Path patternintgetPort()Port numberjava.lang.StringgetProtocol()Request protocol of the wanted requestjava.lang.StringgetQueryPattern()Query Patternjava.lang.StringgetUrlPattern()URL Pattern If the URL pattern is set this overrides all other filters.voidsetHostPattern(java.lang.String regex)Regular expression the matches the wanted request's hostvoidsetPathPattern(java.lang.String regex)Path patternvoidsetPort(int port)Port number of the wanted requestvoidsetProtocol(java.lang.String protocol)Request protocol (http,https, ...)voidsetQueryPattern(java.lang.String regex)Query patternvoidsetUrlPattern(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 ornullto 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
nullif 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 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
public java.lang.String getPathPattern()
Path pattern- Returns:
- regular expression that matches the wanted request's path or
nullif 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 ornullto disable path filtering
-
getQueryPattern
public java.lang.String getQueryPattern()
Query Pattern- Returns:
- regular expression that matches the wanted request's query string or
nullif 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 ornullif 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
nullif 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 ornullto 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:
trueif this filter accepts the given request,falseotherwise
-
-