DDOS Servlet Filter
The time of static applications that just wait to be hit by a massive number of requests has gone.
This piece of code is an example of a Self-Protective servlet filter able to defend itself against DDOS by utilizing the Remotely Triggered Black Holling technique.
DDOS servlet filter is able to apply a remotely triggered black holing as per RFC 5635.
If certain threashold is triggered will pull the RTBH trigger and will put it in quarantine.
There is also a quarantineController initialized in the init method of the servlet filter that check for prefixes with expired quarantine period. For those the trigger route will be deleted.
Note that in order that servlet filter to be useful for you you will have to have access to the infrastructure of your provider. It is a simple example on how enterprise java applications could benefit from RTBH and how powerful the integration between application and environment could be.