com.octo.captcha.engine.bufferedengine.buffer
Interface CaptchaBuffer

All Known Implementing Classes:
DatabaseCaptchaBuffer, DiskCaptchaBuffer, MemoryCaptchaBuffer

public interface CaptchaBuffer

CaptchaBuffer is the interface to describe buffers of captchas.


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 laocale
 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
 

Method Detail

removeCaptcha

Captcha removeCaptcha()
                      throws java.util.NoSuchElementException
remove a captcha from the buffer

Returns:
a captcha
Throws:
java.util.NoSuchElementException - if there is no captcha throw NoSuchElementException

removeCaptcha

Captcha removeCaptcha(java.util.Locale locale)
                      throws java.util.NoSuchElementException
remove a captcha from the buffer corresponding to the locale

Parameters:
locale - The locale the catcha to remove
Returns:
a captcha correponding to the locale
Throws:
java.util.NoSuchElementException - if there is no captcha throw NoSuchElementException

removeCaptcha

java.util.Collection removeCaptcha(int number)
Remove a precise number of captcha

Parameters:
number - The number of captchas to remove
Returns:
a collection of captchas

removeCaptcha

java.util.Collection removeCaptcha(int number,
                                   java.util.Locale locale)
Remove a precise number of captcha with a locale

Parameters:
number - The number of captchas to remove
locale - The locale of the removed captchas
Returns:
a collection of captchas

putCaptcha

void putCaptcha(Captcha captcha)
Put a captcha with default laocale


putCaptcha

void putCaptcha(Captcha captcha,
                java.util.Locale locale)
Put a captcha with a locale

Parameters:
captcha - The captcha to add
locale - the locale of the captcha

putAllCaptcha

void putAllCaptcha(java.util.Collection captchas)
Put a collection of captchas with the default locale

Parameters:
captchas - The captchas to add

putAllCaptcha

void putAllCaptcha(java.util.Collection captchas,
                   java.util.Locale locale)
Put a collection of captchas with his locale

Parameters:
captchas - The captchas to add
locale - The locale of the captchas

size

int size()
Get the size of the buffer for all locales

Returns:
The size of the buffer

size

int size(java.util.Locale locale)
Get the size of the buffer for a locale

Parameters:
locale - the locale to get the size
Returns:
The size of the buffer

dispose

void dispose()
Release all the ressources and close the buffer.


clear

void clear()
Clear the buffer from all locale


getLocales

java.util.Collection getLocales()
Get all the locales used



Copyright 2003-2009 JCaptcha. All Rights Reserved.