Package eu.europeana.apikey.captcha
Class CaptchaManager
- java.lang.Object
-
- eu.europeana.apikey.captcha.CaptchaManager
-
@Service public class CaptchaManager extends Object
-
-
Constructor Summary
Constructors Constructor Description CaptchaManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidinit()booleanverifyCaptchaToken(String captchaToken)Verify Captcha token by sending request to the verification URL.
-
-
-
Method Detail
-
init
@PostConstruct public void init()
-
verifyCaptchaToken
public boolean verifyCaptchaToken(String captchaToken) throws ApiKeyException
Verify Captcha token by sending request to the verification URL. Response is a JSON with a field "success" indicating true or false. When it's false "error-codes" field contains reason of failure.- Parameters:
captchaToken- Token to be verified.- Returns:
- true when verification successful, false when there was problem with verification response
- Throws:
ApiKeyException- when there was false response, exception contains error code
-
close
@PreDestroy public void close()
-
-