Class CaptchaSecurityService

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getActiveBlockHtml()
      java.lang.String getHtmlCode()
      Return an EMPTY_STRING if service is not available nor active
      boolean isActive()
      boolean isAvailable()
      void setActive​(boolean isActive)
      Activate the service for the current client
      boolean validate​(javax.servlet.http.HttpServletRequest request)
      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 Detail

      • CaptchaSecurityService

        public CaptchaSecurityService()
        Default constructor. Gets the captchaValidator from the captcha plugin. If the validator is missing, sets available to false;
    • Method Detail

      • getHtmlCode

        public java.lang.String getHtmlCode()
        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)
        Activate the service for the current client
        Specified by:
        setActive in interface ICaptchaSecurityService
        Parameters:
        isActive - True to activate, otherwise false
      • validate

        public boolean validate​(javax.servlet.http.HttpServletRequest request)
        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()
        Specified by:
        isActive in interface ICaptchaSecurityService
        Returns:
        true if the service is active for the current client