Package com.aoapps.servlet.firewall.api
Interface FirewallContext
public interface FirewallContext
Invocation of
rules
must be done through the firewall context.
This is done to support firewall hooks, such as TRACE.
As firewall rule traversal is performed on a single thread on a per-request basis, implementations are not necessarily thread-safe.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
TODO: Replace withServletCallable
from ao-servlet-util.static interface
TODO: Replace withServletRunnable
from ao-servlet-util. -
Method Summary
Modifier and TypeMethodDescriptionCalls the given action.Calls the given matcher.getAttribute
(String name) Gets the firewall context attribute of the given name.void
removeAttribute
(String name) Removes a firewall context attribute.void
setAttribute
(String name, Object object) Sets a firewall context attribute.<V> V
setAttribute
(String name, Object object, FirewallContext.Callable<V> callable) Sets a firewall context attribute, calling the providedFirewallContext.Callable
, then restoring any previous value for the attribute.void
setAttribute
(String name, Object object, FirewallContext.Runnable runnable) Sets a firewall context attribute, calling the providedFirewallContext.Runnable
, then restoring any previous value for the attribute.
-
Method Details
-
setAttribute
Sets a firewall context attribute.- Parameters:
name
- The name of the attribute.object
- Whennull
, this is the equivalent of callingremoveAttribute(java.lang.String)
-
getAttribute
Gets the firewall context attribute of the given name.- Parameters:
name
- The name of the attribute.- Returns:
- The object at the given name or
null
if non set.
-
removeAttribute
Removes a firewall context attribute. This is the same as callingsetAttribute(java.lang.String, java.lang.Object)
with anull
object.- Parameters:
name
- The name of the attribute.
-
setAttribute
<V> V setAttribute(String name, Object object, FirewallContext.Callable<V> callable) throws IOException, ServletException Sets a firewall context attribute, calling the providedFirewallContext.Callable
, then restoring any previous value for the attribute.- Parameters:
name
- The name of the attribute.object
- Whennull
, this is the equivalent of callingremoveAttribute(java.lang.String)
- Throws:
IOException
ServletException
-
setAttribute
void setAttribute(String name, Object object, FirewallContext.Runnable runnable) throws IOException, ServletException Sets a firewall context attribute, calling the providedFirewallContext.Runnable
, then restoring any previous value for the attribute.- Parameters:
name
- The name of the attribute.object
- Whennull
, this is the equivalent of callingremoveAttribute(java.lang.String)
- Throws:
IOException
ServletException
-
call
Calls the given matcher.- Throws:
IOException
ServletException
-
call
Calls the given action.- Throws:
IOException
ServletException
-