Package eu.europeana.apikey.captcha
Class CaptchaManager
java.lang.Object
eu.europeana.apikey.captcha.CaptchaManager
The type Captcha manager.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close.voidinit()Init.booleanverifyCaptchaToken(String captchaToken) Verify Captcha token by sending request to the verification URL.
-
Constructor Details
-
CaptchaManager
public CaptchaManager()
-
-
Method Details
-
init
@PostConstruct public void init()Init. -
verifyCaptchaToken
public boolean verifyCaptchaToken(String captchaToken) throws eu.europeana.api.commons.error.EuropeanaApiException 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:
eu.europeana.api.commons.error.EuropeanaApiException- when there was false response, exception contains error code
-
close
@PreDestroy public void close()Close.
-