Package sk.iway.iwcm
Class SpamProtection
java.lang.Object
sk.iway.iwcm.SpamProtection
SpamProtection.java
        This class keeps a track of user's posts on our server and forbids any more posts, if
        he already reached a limit.
 Behaviour of this class can be modified by configuration parameters:
 1. spamProtectionTimeout - what is the maximum time span between two distinct posts
 2. spamProtectionHourlyLimit - limit of posts that a user can send in an hour
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleanDetermines, whether a post to a given module and from a given IP address is allowed to be posted.static voidclearAll()Clear all mapsstatic longcrossMinitLimit(String module, javax.servlet.http.HttpServletRequest request) Momentalne kvoli ing insurance Systém CMS dovolí prepísať profil maximálne 3x za sebou v priebehu jednej minúty, v takom prípade povolí zápis až 5 minút od posledného zápisustatic longcrossMinuteLimit(String module, javax.servlet.http.HttpServletRequest request) Momentalne kvoli ing insurance Systém CMS dovolí prepísať profil maximálne 3x za sebou v priebehu jednej minúty, v takom prípade povolí zápis až 5 minút od posledného zápisustatic voiddestroy()static intgetHourlyPostLimit(String module) static intgetMinitPostLimit(String module) static intgetMinutePostLimit(String module) static longgetTimeout(String module) static longgetWaitTimeout(String module, javax.servlet.http.HttpServletRequest request) Vracia cas do vyprsania obmedzenia !Pozor, neriesi rychle klikanie pouzivatela, len hodinovy Limit! Standardne, ak netreba ziskavat cas, staci volat metodu canPost(module, post, request)
- 
Field Details- 
HOURLY_LIMIT_KEY- See Also:
 
- 
MINIT_LIMIT_KEY- See Also:
 
- 
MINUTE_LIMIT_KEY- See Also:
 
- 
TIMEOUT_KEY- See Also:
 
 
- 
- 
Constructor Details- 
SpamProtectionprotected SpamProtection()
 
- 
- 
Method Details- 
canPostpublic static boolean canPost(String module, String post, javax.servlet.http.HttpServletRequest request) Determines, whether a post to a given module and from a given IP address is allowed to be posted.- Parameters:
- module- Module, which is used to make a post
- post- Text version of a post - unused
- request-
- Returns:
- Boolean- whether the post can be performed or not
 
- 
crossMinuteLimitMomentalne kvoli ing insurance Systém CMS dovolí prepísať profil maximálne 3x za sebou v priebehu jednej minúty, v takom prípade povolí zápis až 5 minút od posledného zápisu- Parameters:
- module-
- request-
- Returns:
 
- 
crossMinitLimitMomentalne kvoli ing insurance Systém CMS dovolí prepísať profil maximálne 3x za sebou v priebehu jednej minúty, v takom prípade povolí zápis až 5 minút od posledného zápisu- Parameters:
- module-
- request-
- Returns:
 
- 
getMinitPostLimit
- 
getHourlyPostLimit
- 
getTimeout
- 
getWaitTimeoutVracia cas do vyprsania obmedzenia !Pozor, neriesi rychle klikanie pouzivatela, len hodinovy Limit! Standardne, ak netreba ziskavat cas, staci volat metodu canPost(module, post, request)
- 
getMinutePostLimit
- 
destroypublic static void destroy()
- 
clearAllpublic static void clearAll()Clear all maps
 
-