public abstract class RequestFilterValve extends ValveBase
This valve is configured by setting the allow and/or
deny properties to a comma-delimited list of regular
expressions (in the syntax supported by the jakarta-regexp library) to
which the appropriate request property will be compared. Evaluation
proceeds as follows:
process() method.
This Valve may be attached to any Container, depending on the granularity of the filtering you wish to perform.
| Modifier and Type | Field and Description |
|---|---|
protected String |
allow
The comma-delimited set of
allow expressions. |
protected Pattern[] |
allows
The set of
allow regular expressions we will evaluate. |
protected Pattern[] |
denies
The set of
deny regular expressions we will evaluate. |
protected String |
deny
The comma-delimited set of
deny expressions. |
container, controller, debug, domain, lifecycle, log, next, oname, rb, startedAFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENTEND_PIPELINE, INVOKE_NEXT| Constructor and Description |
|---|
RequestFilterValve() |
| Modifier and Type | Method and Description |
|---|---|
String |
getAllow()
Return a comma-delimited set of the
allow expressions
configured for this Valve, if any; otherwise, return null. |
String |
getDeny()
Return a comma-delimited set of the
deny expressions
configured for this Valve, if any; otherwise, return null. |
String |
getInfo()
Return descriptive information about this Valve implementation.
|
abstract int |
invoke(Request request,
Response response)
Extract the desired request property, and pass it (along with the
specified request and response objects) to the protected
process() method to perform the actual filtering. |
protected Pattern[] |
precalculate(String list)
Return an array of regular expression objects initialized from the
specified argument, which must be
null or a comma-delimited
list of regular expression patterns. |
protected int |
process(String property,
Request request,
Response response)
Perform the filtering that has been configured for this Valve, matching
against the specified request property.
|
void |
setAllow(String allow)
Set the comma-delimited set of the
allow expressions
configured for this Valve, if any. |
void |
setDeny(String deny)
Set the comma-delimited set of the
deny expressions
configured for this Valve, if any. |
addLifecycleListener, backgroundProcess, createObjectName, event, findLifecycleListeners, getContainer, getController, getDebug, getDomain, getNext, getObjectName, getParentName, invoke, isStarted, postInvoke, removeLifecycleListener, setContainer, setController, setDebug, setNext, setObjectName, start, stopprotected String allow
allow expressions.protected Pattern[] allows
allow regular expressions we will evaluate.protected Pattern[] denies
deny regular expressions we will evaluate.protected String deny
deny expressions.public String getAllow()
allow expressions
configured for this Valve, if any; otherwise, return null.public void setAllow(String allow)
allow expressions
configured for this Valve, if any.allow - The new set of allow expressionspublic String getDeny()
deny expressions
configured for this Valve, if any; otherwise, return null.public void setDeny(String deny)
deny expressions
configured for this Valve, if any.deny - The new set of deny expressionspublic String getInfo()
public abstract int invoke(Request request, Response response) throws IOException, javax.servlet.ServletException
process() method to perform the actual filtering.
This method must be implemented by a concrete subclass.invoke in interface GlassFishValveinvoke in class ValveBaserequest - The servlet request to be processedresponse - The servlet response to be createdINVOKE_NEXT or END_PIPELINEIOException - if an input/output error occursjavax.servlet.ServletException - if a servlet error occursprotected Pattern[] precalculate(String list)
null or a comma-delimited
list of regular expression patterns.list - The comma-separated list of patternsIllegalArgumentException - if one of the patterns has
invalid syntaxprotected int process(String property, Request request, Response response) throws IOException, javax.servlet.ServletException
property - The request property on which to filterrequest - The servlet request to be processedresponse - The servlet response to be processedIOException - if an input/output error occursjavax.servlet.ServletException - if a servlet error occursCopyright © 2017. All rights reserved.