com.octo.captcha.service.sound
Class AbstractManageableSoundCaptchaService

java.lang.Object
  extended by com.octo.captcha.service.AbstractCaptchaService
      extended by com.octo.captcha.service.AbstractManageableCaptchaService
          extended by com.octo.captcha.service.sound.AbstractManageableSoundCaptchaService
All Implemented Interfaces:
AbstractManageableCaptchaServiceMBean, CaptchaService, ManageableCaptchaService, SoundCaptchaService
Direct Known Subclasses:
DefaultManageableSoundCaptchaService

public abstract class AbstractManageableSoundCaptchaService
extends AbstractManageableCaptchaService
implements SoundCaptchaService

Base implementation of the SoundCaptchaService.


Field Summary
 
Fields inherited from class com.octo.captcha.service.AbstractCaptchaService
engine, logger, store
 
Constructor Summary
protected AbstractManageableSoundCaptchaService(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.
 javax.sound.sampled.AudioInputStream getSoundChallengeForID(java.lang.String ID)
          Method to retrive the image challenge corresponding to the given ticket.
 javax.sound.sampled.AudioInputStream getSoundChallengeForID(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

AbstractManageableSoundCaptchaService

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

getSoundChallengeForID

public javax.sound.sampled.AudioInputStream getSoundChallengeForID(java.lang.String ID)
                                                            throws CaptchaServiceException
Method to retrive the image challenge corresponding to the given ticket.

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

getSoundChallengeForID

public javax.sound.sampled.AudioInputStream getSoundChallengeForID(java.lang.String ID,
                                                                   java.util.Locale locale)
                                                            throws CaptchaServiceException
Method to retrive the image challenge corresponding to the given ticket.

Specified by:
getSoundChallengeForID in interface SoundCaptchaService
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.