com.octo.captcha.service
Interface ManageableCaptchaService

All Superinterfaces:
CaptchaService
All Known Subinterfaces:
AbstractManageableCaptchaServiceMBean
All Known Implementing Classes:
AbstractManageableCaptchaService, AbstractManageableImageCaptchaService, AbstractManageableSoundCaptchaService, DefaultManageableImageCaptchaService, GenericManageableCaptchaService

public interface ManageableCaptchaService
extends CaptchaService

Management interface for the CaptchaService interface.


Method Summary
 void emptyCaptchaStore()
          Empty the Store
 void garbageCollectCaptchaStore()
          Garbage collect the captcha store, means all old capthca (captcha in the store wich has been stored more than the MinGuarantedStorageDelayInSecond
 java.lang.String getCaptchaEngineClass()
          Get the fully qualified class name of the concrete CaptchaEngine used by the service.
 int getCaptchaStoreMaxSize()
           
 int getCaptchaStoreSize()
          Get the curent size of the captcha store
 int getCaptchaStoreSizeBeforeGarbageCollection()
           
 CaptchaEngine getEngine()
           
 int getMinGuarantedStorageDelayInSeconds()
          Get the minimum delay (in seconds) a client can be assured that a captcha generated by the service can be retrieved and a response to its challenge tested
 long getNumberOfCorrectResponses()
          Get the number of correct responses to captcha challenges since the service is up.
 int getNumberOfGarbageCollectableCaptchas()
          Get the number of captchas that can be garbage collected in the captcha store
 long getNumberOfGarbageCollectedCaptcha()
          Get the number of captcha garbage collected since the service is up WARNING : this value won't be significant if the real number is > Long.MAX_VALUE
 long getNumberOfGeneratedCaptchas()
          Get the number of captcha generated since the service is up WARNING : this value won't be significant if the real number is > Long.MAX_VALUE
 long getNumberOfUncorrectResponses()
          Get the number of uncorrect responses to captcha challenges since the service is up.
 void setCaptchaEngine(CaptchaEngine engine)
          Updates the engine served by this service
 void setCaptchaEngineClass(java.lang.String theClassName)
          Set the fully qualified class name of the concrete CaptchaEngine used by the service
 void setCaptchaStoreMaxSize(int size)
          This max size is used by the service : it will throw a CaptchaServiceException if the store is full when a client ask for a captcha.
 void setCaptchaStoreSizeBeforeGarbageCollection(int captchaStoreSizeBeforeGarbageCollection)
          max captchaStore size before garbage collection of the store
 void setMinGuarantedStorageDelayInSeconds(int theMinGuarantedStorageDelayInSeconds)
          set the minimum delay (in seconds)a client can be assured that a captcha generated by the service can be retrieved and a response to its challenge tested
 
Methods inherited from interface com.octo.captcha.service.CaptchaService
getChallengeForID, getChallengeForID, getQuestionForID, getQuestionForID, validateResponseForID
 

Method Detail

getCaptchaEngineClass

java.lang.String getCaptchaEngineClass()
Get the fully qualified class name of the concrete CaptchaEngine used by the service.

Returns:
the fully qualified class name of the concrete CaptchaEngine used by the service.

setCaptchaEngineClass

void setCaptchaEngineClass(java.lang.String theClassName)
                           throws java.lang.IllegalArgumentException
Set the fully qualified class name of the concrete CaptchaEngine used by the service

Parameters:
theClassName - the fully qualified class name of the CaptchaEngine used by the service
Throws:
java.lang.IllegalArgumentException - if className can't be used as the service CaptchaEngine, either because it can't be instanciated by the service or it is not a ImageCaptchaEngine concrete class.

getEngine

CaptchaEngine getEngine()
Returns:
the engine served by this service

setCaptchaEngine

void setCaptchaEngine(CaptchaEngine engine)
Updates the engine served by this service

Parameters:
engine -

getMinGuarantedStorageDelayInSeconds

int getMinGuarantedStorageDelayInSeconds()
Get the minimum delay (in seconds) a client can be assured that a captcha generated by the service can be retrieved and a response to its challenge tested

Returns:
the maximum delay in seconds

setMinGuarantedStorageDelayInSeconds

void setMinGuarantedStorageDelayInSeconds(int theMinGuarantedStorageDelayInSeconds)
set the minimum delay (in seconds)a client can be assured that a captcha generated by the service can be retrieved and a response to its challenge tested

Parameters:
theMinGuarantedStorageDelayInSeconds - the minimum guaranted delay

getNumberOfGeneratedCaptchas

long getNumberOfGeneratedCaptchas()
Get the number of captcha generated since the service is up WARNING : this value won't be significant if the real number is > Long.MAX_VALUE

Returns:
the number of captcha generated since the service is up

getNumberOfCorrectResponses

long getNumberOfCorrectResponses()
Get the number of correct responses to captcha challenges since the service is up. WARNING : this value won't be significant if the real number is > Long.MAX_VALUE

Returns:
the number of correct responses since the service is up

getNumberOfUncorrectResponses

long getNumberOfUncorrectResponses()
Get the number of uncorrect responses to captcha challenges since the service is up. WARNING : this value won't be significant if the real number is > Long.MAX_VALUE

Returns:
the number of uncorrect responses since the service is up

getCaptchaStoreSize

int getCaptchaStoreSize()
Get the curent size of the captcha store

Returns:
the size of the captcha store

getNumberOfGarbageCollectableCaptchas

int getNumberOfGarbageCollectableCaptchas()
Get the number of captchas that can be garbage collected in the captcha store

Returns:
the number of captchas that can be garbage collected in the captcha store

getNumberOfGarbageCollectedCaptcha

long getNumberOfGarbageCollectedCaptcha()
Get the number of captcha garbage collected since the service is up WARNING : this value won't be significant if the real number is > Long.MAX_VALUE

Returns:
the number of captcha garbage collected since the service is up

setCaptchaStoreMaxSize

void setCaptchaStoreMaxSize(int size)
This max size is used by the service : it will throw a CaptchaServiceException if the store is full when a client ask for a captcha.


getCaptchaStoreMaxSize

int getCaptchaStoreMaxSize()
Returns:
the desired max size of the captcha store

garbageCollectCaptchaStore

void garbageCollectCaptchaStore()
Garbage collect the captcha store, means all old capthca (captcha in the store wich has been stored more than the MinGuarantedStorageDelayInSecond


emptyCaptchaStore

void emptyCaptchaStore()
Empty the Store


getCaptchaStoreSizeBeforeGarbageCollection

int getCaptchaStoreSizeBeforeGarbageCollection()
Returns:
the max captchaStore load before garbage collection of the store

setCaptchaStoreSizeBeforeGarbageCollection

void setCaptchaStoreSizeBeforeGarbageCollection(int captchaStoreSizeBeforeGarbageCollection)
max captchaStore size before garbage collection of the store



Copyright 2003-2009 JCaptcha. All Rights Reserved.