com.octo.captcha.service.image
Class AbstractManageableImageCaptchaService

java.lang.Object
  extended by com.octo.captcha.service.AbstractCaptchaService
      extended by com.octo.captcha.service.AbstractManageableCaptchaService
          extended by com.octo.captcha.service.image.AbstractManageableImageCaptchaService
All Implemented Interfaces:
AbstractManageableCaptchaServiceMBean, CaptchaService, ImageCaptchaService, ManageableCaptchaService
Direct Known Subclasses:
DefaultManageableImageCaptchaService

public abstract class AbstractManageableImageCaptchaService
extends AbstractManageableCaptchaService
implements ImageCaptchaService

Base implementation of the ImageCaptchaService.


Field Summary
 
Fields inherited from class com.octo.captcha.service.AbstractCaptchaService
engine, logger, store
 
Constructor Summary
protected AbstractManageableImageCaptchaService(CaptchaStore captchaStore, CaptchaEngine captchaEngine, int minGuarantedStorageDelayInSeconds, int maxCaptchaStoreSize, int captchaStoreLoadBeforeGarbageCollection)
           
 
Method Summary
protected  java.lang.Object getChallengeClone(Captcha captcha)
          This method must be implemented by sublcasses and : Retrieve the challenge from the captcha Make and return a clone of the challenge Return the clone It has be design in order to let the service dipose the challenge of the captcha after rendering.
 java.awt.image.BufferedImage getImageChallengeForID(java.lang.String ID)
          Method to retrive the image challenge corresponding to the given ticket.
 java.awt.image.BufferedImage getImageChallengeForID(java.lang.String ID, java.util.Locale locale)
          Method to retrive the image challenge corresponding to the given ticket.
 
Methods inherited from class com.octo.captcha.service.AbstractManageableCaptchaService
emptyCaptchaStore, garbageCollectCaptchaStore, garbageCollectCaptchaStore, generateAndStoreCaptcha, getCaptchaEngineClass, getCaptchaStoreMaxSize, getCaptchaStoreSize, getCaptchaStoreSizeBeforeGarbageCollection, getEngine, getMinGuarantedStorageDelayInSeconds, getNumberOfCorrectResponses, getNumberOfGarbageCollectableCaptchas, getNumberOfGarbageCollectedCaptcha, getNumberOfGeneratedCaptchas, getNumberOfUncorrectResponses, isCaptchaStoreFull, isCaptchaStoreQuotaReached, setCaptchaEngine, setCaptchaEngineClass, setCaptchaStoreMaxSize, setCaptchaStoreSizeBeforeGarbageCollection, setMinGuarantedStorageDelayInSeconds, validateResponseForID
 
Methods inherited from class com.octo.captcha.service.AbstractCaptchaService
getChallengeForID, getChallengeForID, getQuestionForID, getQuestionForID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.octo.captcha.service.CaptchaService
getChallengeForID, getChallengeForID, getQuestionForID, getQuestionForID, validateResponseForID
 

Constructor Detail

AbstractManageableImageCaptchaService

protected AbstractManageableImageCaptchaService(CaptchaStore captchaStore,
                                                CaptchaEngine captchaEngine,
                                                int minGuarantedStorageDelayInSeconds,
                                                int maxCaptchaStoreSize,
                                                int captchaStoreLoadBeforeGarbageCollection)
Method Detail

getImageChallengeForID

public java.awt.image.BufferedImage getImageChallengeForID(java.lang.String ID)
                                                    throws CaptchaServiceException
Method to retrive the image challenge corresponding to the given ticket.

Specified by:
getImageChallengeForID in interface ImageCaptchaService
Parameters:
ID - the ticket
Returns:
the challenge
Throws:
CaptchaServiceException - if the ticket is invalid

getImageChallengeForID

public java.awt.image.BufferedImage getImageChallengeForID(java.lang.String ID,
                                                           java.util.Locale locale)
                                                    throws CaptchaServiceException
Method to retrive the image challenge corresponding to the given ticket.

Specified by:
getImageChallengeForID in interface ImageCaptchaService
Parameters:
ID - the ticket
Returns:
the challenge
Throws:
CaptchaServiceException - if the ticket is invalid

getChallengeClone

protected java.lang.Object getChallengeClone(Captcha captcha)
This method must be implemented by sublcasses and : Retrieve the challenge from the captcha Make and return a clone of the challenge Return the clone It has be design in order to let the service dipose the challenge of the captcha after rendering. It should be implemented for all captcha type (@see ImageCaptchaService implementations for exemple)

Specified by:
getChallengeClone in class AbstractCaptchaService
Returns:
a Challenge Clone


Copyright 2003-2009 JCaptcha. All Rights Reserved.