pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.util.captcha
Class ReCaptchaAdapter

java.lang.Object
  extended by org.torweg.pulse.util.captcha.ReCaptchaAdapter
All Implemented Interfaces:
Configurable<ReCaptchaAdapterConfig>, ICaptchaAdapter<ReCaptchaAdapterConfig>

public class ReCaptchaAdapter
extends java.lang.Object
implements ICaptchaAdapter<ReCaptchaAdapterConfig>

Adapter for recaptcha-library.

The configured ReCaptchaAdapter will be available through Lifecycle.

Version:
$Revision: 1914 $
Author:
Daniel Dietz
See Also:
Lifecycle.getCaptchaAdapter()

Constructor Summary
ReCaptchaAdapter()
           
 
Method Summary
 java.lang.String getDivId()
          Returns the id of the div which is to be replaced by the recaptcha.
 java.lang.String getPrivateKey()
          Returns the private key.
 java.lang.String getPublicKey()
          Returns the public key.
 void initialize(ReCaptchaAdapterConfig conf)
          Initialises the ReCaptchaAdapter with the given Configuration.
 AbstractCaptchaResponse validate(ServiceRequest request)
          Performs the validation-request of the recaptcha for the given request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReCaptchaAdapter

public ReCaptchaAdapter()
Method Detail

validate

public final AbstractCaptchaResponse validate(ServiceRequest request)
Performs the validation-request of the recaptcha for the given request.

Specified by:
validate in interface ICaptchaAdapter<ReCaptchaAdapterConfig>
Parameters:
request - the ServiceRequest
Returns:
an AbstractCaptchaResponse

getPublicKey

public final java.lang.String getPublicKey()
Returns the public key.

Specified by:
getPublicKey in interface ICaptchaAdapter<ReCaptchaAdapterConfig>
Returns:
the public key

getPrivateKey

public final java.lang.String getPrivateKey()
Returns the private key.

Specified by:
getPrivateKey in interface ICaptchaAdapter<ReCaptchaAdapterConfig>
Returns:
the private key

getDivId

public final java.lang.String getDivId()
Returns the id of the div which is to be replaced by the recaptcha.

Specified by:
getDivId in interface ICaptchaAdapter<ReCaptchaAdapterConfig>
Returns:
the div-id

initialize

public final void initialize(ReCaptchaAdapterConfig conf)
Initialises the ReCaptchaAdapter with the given Configuration.

Specified by:
initialize in interface Configurable<ReCaptchaAdapterConfig>
Parameters:
conf - the Configuration