Interface ICaptchaSecurityService

  • All Known Implementing Classes:
    CaptchaSecurityService

    public interface ICaptchaSecurityService
    The interface for Captcha security service
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String EMPTY_STRING  
    • Method Summary

      All Methods Instance Methods Abstract 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 bActive)
      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
    • Method Detail

      • getHtmlCode

        java.lang.String getHtmlCode()
        Return an EMPTY_STRING if service is not available nor active
        Returns:
        the html code of a captcha
      • getActiveBlockHtml

        java.lang.String getActiveBlockHtml()
        Returns:
        the html code used by an admin to activate the captcha
      • validate

        boolean validate​(javax.servlet.http.HttpServletRequest request)
        Validates a captcha only if the service is available and active
        Parameters:
        request - the request, which must contain the parameter j_captcha_response
        Returns:
        true if captcha is valid or service is not available
      • setActive

        void setActive​(boolean bActive)
        Activate the service for the current client
        Parameters:
        bActive - True to activate, otherwise false
      • isAvailable

        boolean isAvailable()
        Returns:
        true if a captcha security service is loaded
      • isActive

        boolean isActive()
        Returns:
        true if the service is active for the current client