com.octo.captcha
Interface Captcha

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
FishEye, Gimpy, GimpySound, ImageCaptcha, MathCaptcha, SoundCaptcha, SpellerSound, SpellFindCaptcha, TextCaptcha

public interface Captcha
extends java.io.Serializable

This interface represent a CAPTCHA.

A CAPTCHA is a program that can generate and grade tests that:

see http://www.captcha.net/ for sample, articles, and definitions.

A captcha is basically a test composed of :

This is a container for the CAPTCHA challenge which is also able to validate the answer. Class implementing this interface must follow the rules :

;


Method Summary
 void disposeChallenge()
          Dispose the challenge, once this method is call the getChallenge method will return null.
 java.lang.Object getChallenge()
          Accerssor for the questionned challenge.
 java.lang.String getQuestion()
          Accessor captcha question.
 java.lang.Boolean hasGetChalengeBeenCalled()
          This method should return true if the getChalenge method has been called (has been added in order to properly manage the captcha state.
 java.lang.Boolean validateResponse(java.lang.Object response)
          Validation routine for the response.
 

Method Detail

getQuestion

java.lang.String getQuestion()
Accessor captcha question.

Returns:
the question

getChallenge

java.lang.Object getChallenge()
Accerssor for the questionned challenge.

Returns:
the challenge (may be an image for image captcha...

validateResponse

java.lang.Boolean validateResponse(java.lang.Object response)
Validation routine for the response.

Parameters:
response - to the question concerning the chalenge
Returns:
true if the answer is correct, false otherwise.

disposeChallenge

void disposeChallenge()
Dispose the challenge, once this method is call the getChallenge method will return null.
It has been added for technical reasons : a captcha is always used in a two step fashion
First submit the challenge, and then wait until the response arrives.
It had been asked to have a method to dispose the challenge that is no longer used after being dipslayed. So here it is!


hasGetChalengeBeenCalled

java.lang.Boolean hasGetChalengeBeenCalled()
This method should return true if the getChalenge method has been called (has been added in order to properly manage the captcha state.

Returns:
true if getChallenge has been called false otherwise.


Copyright 2003-2009 JCaptcha. All Rights Reserved.