@@ -0,0 +1,1849 @@
+package com.github.aureliano.verbum_domini.web.filter;%0A%0Aimport java.io.IOException;%0A%0Aimport javax.servlet.Filter;%0Aimport javax.servlet.FilterChain;%0Aimport javax.servlet.FilterConfig;%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.ServletRequest;%0Aimport javax.servlet.ServletResponse;%0Aimport javax.servlet.annotation.WebFilter;%0A%0Aimport org.apache.log4j.Logger;%0A%0Aimport com.github.aureliano.verbum_domini.core.web.ServiceRequestController;%0A%0A@WebFilter(%0A%09filterName = %22ApiRestServiceRequestControlFilter%22,%0A%09displayName = %22API Rest Service Request Control Filter%22,%0A%09description = %22Prevent user abuses%22,%0A%09urlPatterns = %22/verbumdomini/apirest/*%22%0A)%0Apublic class ApiRestServiceRequestControlFilter implements Filter %7B%0A%0A%09private static final Logger logger = Logger.getLogger(ApiRestServiceRequestControlFilter.class);%0A%09%0A%09private ServiceRequestController serviceRequestController;%0A%09%0A%09public ApiRestServiceRequestControlFilter() %7B%0A%09%09this.serviceRequestController = ServiceRequestController.instance();%0A%09%7D%0A%0A%09@Override%0A%09public void destroy() %7B %7D%0A%0A%09@Override%0A%09public void doFilter(ServletRequest request, ServletResponse response,%0A%09%09%09FilterChain chain) throws IOException, ServletException %7B%0A%09%09%0A%09%09logger.warn(%22API Rest Service request control filter is disabled!%22);%0A%09%09chain.doFilter(request, response);%0A%09%7D%0A%0A%09@Override%0A%09public void init(FilterConfig filterConfig) throws ServletException %7B%0A%09%09logger.info(%22Initializing servlet filter %22 + filterConfig.getFilterName());%0A%09%09%0A%09%09logger.info(%22Application configuration for preventing users abuses.%22);%0A%09%09logger.info(%22Maximum requests per hour: %22 + this.serviceRequestController.getMaxRequestsPerHour());%0A%09%09logger.info(%22Delay between requests: %22 + this.serviceRequestController.getDelayBetweenRequests());%0A%09%09logger.info(%22Maximum threads per user: %22 + this.serviceRequestController.getMaxThreadsPerUser());%0A%09%7D%0A%7D

Create service request controll filter.