Class CaptchaSecurityService

java.lang.Object
fr.paris.lutece.portal.service.captcha.CaptchaSecurityService
All Implemented Interfaces:
ICaptchaSecurityService

@Deprecated(since="8.0", forRemoval=true) public class CaptchaSecurityService extends Object implements ICaptchaSecurityService
Deprecated, for removal: This API element is subject to removal in a future version.
since 8.0 — use CDI injection of the ICaptchaService bean instead.
Legacy implementation providing access to the ICaptchaService.

This class is deprecated and will be removed in a future release. It was originally responsible for managing access to the ICaptchaService.

The recommended approach is now to use CDI dependency injection to obtain the ICaptchaService directly, instead of instantiating or referencing this class.

Example of recommended usage:


 @Inject
 @Named(BeanUtils.BEAN_CAPTCHA_SERVICE)
 private Instance<ICaptchaService> _captchaService;
 
  • Field Summary

    Fields inherited from interface fr.paris.lutece.portal.service.captcha.ICaptchaSecurityService

    EMPTY_STRING
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return an EMPTY_STRING if service is not available nor active
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
    setActive(boolean isActive)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Activate the service for the current client
    boolean
    validate(jakarta.servlet.http.HttpServletRequest request)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Validates a captcha only if the service is available and active

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CaptchaSecurityService

      public CaptchaSecurityService()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Default constructor. Gets the captchaValidator from the captcha plugin. If the validator is missing, sets available to false;
  • Method Details

    • getActiveBlockHtml

      public String getActiveBlockHtml()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getActiveBlockHtml in interface ICaptchaSecurityService
      Returns:
      the html code used by an admin to activate the captcha
    • getHtmlCode

      public String getHtmlCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return an EMPTY_STRING if service is not available nor active
      Specified by:
      getHtmlCode in interface ICaptchaSecurityService
      Returns:
      the html code of a captcha
    • setActive

      public void setActive(boolean isActive)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Activate the service for the current client
      Specified by:
      setActive in interface ICaptchaSecurityService
      Parameters:
      isActive - True to activate, otherwise false
    • validate

      public boolean validate(jakarta.servlet.http.HttpServletRequest request)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Validates a captcha only if the service is available and active
      Specified by:
      validate in interface ICaptchaSecurityService
      Parameters:
      request - the request, which must contain the parameter j_captcha_response
      Returns:
      true if captcha is valid or service is not available
    • isActive

      public boolean isActive()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      isActive in interface ICaptchaSecurityService
      Returns:
      true if the service is active for the current client
    • isAvailable

      public boolean isAvailable()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      isAvailable in interface ICaptchaSecurityService
      Returns:
      true if a captcha security service is loaded