Class CaptchEtatHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.captchetat.captcha.CaptchEtatHelper
- All Implemented Interfaces:
LogEnabled,Initializable,Component,Serviceable
- Direct Known Subclasses:
CaptchEtatHelper
public class CaptchEtatHelper
extends AbstractLogEnabled
implements Component, Initializable, Serviceable
Captcha implementation with images
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enumThe type of endpoint available for Captchetat -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CaptchEtatHelper.Endpointthe endpoint present in configurationstatic final Stringid of the token cachestatic final StringRole -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringGet the name of the parameter for identifier when contacting the APIbooleancheckAndInvalidateCaptcha(String key, String value) Check if the captcha is correctget TokengetToken()get TokenvoidInitializevoidservice(ServiceManager smanager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Role -
CAPCHETAT_TOKEN_CACHE
id of the token cache -
_endpoint
the endpoint present in configuration
-
-
Constructor Details
-
CaptchEtatHelper
public CaptchEtatHelper()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
Initialize- Specified by:
initializein interfaceInitializable
-
getToken
get Token- Returns:
- token
-
getEndpoint
get Token- Returns:
- token
-
checkAndInvalidateCaptcha
Check if the captcha is correct- Parameters:
key- the keyvalue- the value- Returns:
- true if correct
-
_getIdentifierParameterName
Get the name of the parameter for identifier when contacting the API- Returns:
- the parameter name
-