|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.octo.captcha.service.captchastore.MapCaptchaStore
public class MapCaptchaStore
Simple store based on a HashMap
| Constructor Summary | |
|---|---|
MapCaptchaStore()
|
|
| Method Summary | |
|---|---|
void |
cleanAndShutdown()
Called by the service in order to clean and shutdown the store. |
void |
empty()
Empty the store |
Captcha |
getCaptcha(java.lang.String id)
Retrieve the captcha for this key from the store. |
java.util.Collection |
getKeys()
Return all the contained keys |
java.util.Locale |
getLocale(java.lang.String id)
Retrieve the locale for this key from the store. |
int |
getSize()
get the size of this store |
boolean |
hasCaptcha(java.lang.String id)
Check if a captcha is stored for this id |
void |
initAndStart()
Called by the service in order to initialize and start the Store. |
boolean |
removeCaptcha(java.lang.String id)
Remove the captcha with the provided id as key. |
void |
storeCaptcha(java.lang.String id,
Captcha captcha)
Store the captcha with the provided id as key. |
void |
storeCaptcha(java.lang.String id,
Captcha captcha,
java.util.Locale locale)
Store the captcha with the provided id as key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MapCaptchaStore()
| Method Detail |
|---|
public boolean hasCaptcha(java.lang.String id)
hasCaptcha in interface CaptchaStore
public void storeCaptcha(java.lang.String id,
Captcha captcha)
throws CaptchaServiceException
storeCaptcha in interface CaptchaStoreid - the keycaptcha - the captcha
CaptchaServiceException - if the captcha already exists, or if an error occurs during storing routine.
public void storeCaptcha(java.lang.String id,
Captcha captcha,
java.util.Locale locale)
throws CaptchaServiceException
storeCaptcha in interface CaptchaStoreid - the keycaptcha - the captchalocale - the locale used that triggers the captcha generation
CaptchaServiceException - if the captcha already exists, or if an error occurs during storing routine.
public Captcha getCaptcha(java.lang.String id)
throws CaptchaServiceException
getCaptcha in interface CaptchaStoreCaptchaServiceException - if a captcha for this key is not found or if an error occurs during retrieving
routine.
public java.util.Locale getLocale(java.lang.String id)
throws CaptchaServiceException
getLocale in interface CaptchaStoreCaptchaServiceException - if an error occurs during retrieving routine.public boolean removeCaptcha(java.lang.String id)
removeCaptcha in interface CaptchaStoreid - the key
CaptchaServiceException - if an error occurs during remove routinepublic int getSize()
getSize in interface CaptchaStorepublic java.util.Collection getKeys()
getKeys in interface CaptchaStorepublic void empty()
empty in interface CaptchaStorepublic void initAndStart()
CaptchaStore
initAndStart in interface CaptchaStorepublic void cleanAndShutdown()
CaptchaStore
cleanAndShutdown in interface CaptchaStore
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||