I'm creating an antddos in my servlet, to better understand how I want to restrict the number of requests from the same ip to my servlet. Currently I'm doing it this way:
I have a list where every request that is made to it is stored ip in this list, the list is cleaned every 1 minute (example) so if the ip is in it 10 times (in less than 1 minute) it can not get more into the list and the requisition is discarded.
I would like a better native java / tomcat alternative, no firewall setup or anything, just need something in java. Does anyone know a quiet way to perform tasks in java from x in x time?