|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.octo.captcha.engine.bufferedengine.buffer.DatabaseCaptchaBuffer
public class DatabaseCaptchaBuffer
A database Captcha Buffer.
The database should have the following structure : default Column Name , type
Constructor Summary | |
---|---|
DatabaseCaptchaBuffer(javax.sql.DataSource datasource)
|
|
DatabaseCaptchaBuffer(javax.sql.DataSource datasource,
java.lang.String table)
|
|
DatabaseCaptchaBuffer(javax.sql.DataSource datasource,
java.lang.String table,
java.lang.String timeMillisColumn,
java.lang.String hashCodeColumn,
java.lang.String captchaColumn,
java.lang.String localeColumn)
|
Method Summary | |
---|---|
void |
clear()
Clear the buffer from all locale |
void |
dispose()
Release all the ressources and close the buffer. |
java.util.Collection |
getLocales()
Get all the locales used |
void |
putAllCaptcha(java.util.Collection captchas)
Put a collection of captchas with the default locale |
void |
putAllCaptcha(java.util.Collection captchas,
java.util.Locale locale)
Put a collection of captchas with his locale |
void |
putCaptcha(Captcha captcha)
Put a captcha with default locale |
void |
putCaptcha(Captcha captcha,
java.util.Locale locale)
Put a captcha with a locale |
Captcha |
removeCaptcha()
remove a captcha from the buffer |
java.util.Collection |
removeCaptcha(int number)
Remove a precise number of captcha |
java.util.Collection |
removeCaptcha(int number,
java.util.Locale locale)
Remove a precise number of captcha with a locale |
Captcha |
removeCaptcha(java.util.Locale locale)
remove a captcha from the buffer corresponding to the locale |
int |
size()
Get the size of the buffer for all locales |
int |
size(java.util.Locale locale)
Get the size of the buffer for a locale |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DatabaseCaptchaBuffer(javax.sql.DataSource datasource)
public DatabaseCaptchaBuffer(javax.sql.DataSource datasource, java.lang.String table)
public DatabaseCaptchaBuffer(javax.sql.DataSource datasource, java.lang.String table, java.lang.String timeMillisColumn, java.lang.String hashCodeColumn, java.lang.String captchaColumn, java.lang.String localeColumn)
Method Detail |
---|
public Captcha removeCaptcha() throws java.util.NoSuchElementException
removeCaptcha
in interface CaptchaBuffer
java.util.NoSuchElementException
- if there is no captcha throw NoSuchElementExceptionpublic Captcha removeCaptcha(java.util.Locale locale) throws java.util.NoSuchElementException
removeCaptcha
in interface CaptchaBuffer
locale
- The locale the catcha to remove
java.util.NoSuchElementException
- if there is no captcha throw NoSuchElementExceptionpublic java.util.Collection removeCaptcha(int number)
removeCaptcha
in interface CaptchaBuffer
number
- The number of captchas to remove
public java.util.Collection removeCaptcha(int number, java.util.Locale locale)
removeCaptcha
in interface CaptchaBuffer
number
- The number of captchas to removelocale
- The locale of the removed captchas
public void putCaptcha(Captcha captcha)
putCaptcha
in interface CaptchaBuffer
public void putCaptcha(Captcha captcha, java.util.Locale locale)
putCaptcha
in interface CaptchaBuffer
captcha
- The captcha to addlocale
- the locale of the captchapublic void putAllCaptcha(java.util.Collection captchas)
putAllCaptcha
in interface CaptchaBuffer
captchas
- The captchas to addpublic void putAllCaptcha(java.util.Collection captchas, java.util.Locale locale)
putAllCaptcha
in interface CaptchaBuffer
captchas
- The captchas to addlocale
- The locale of the captchaspublic int size()
size
in interface CaptchaBuffer
public int size(java.util.Locale locale)
size
in interface CaptchaBuffer
locale
- the locale to get the size
public void dispose()
dispose
in interface CaptchaBuffer
public void clear()
clear
in interface CaptchaBuffer
public java.util.Collection getLocales()
getLocales
in interface CaptchaBuffer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |