|
Framework Serveur J2EE ACube V3.1.0 |
|
acube.framework.captcha
Classe CaptchaAbstractService
java.lang.Object
acube.framework.captcha.CaptchaAbstractService Sous classes directement connues:
-
abstract public class CaptchaAbstractService
hérite de Object
This is a model of a captcha service. All captcha services use into
the Acube Framework have to extends this class. In order to use
captcha services of JCaptcha projet, you have to create a
CaptchaService in Acube Framework. This Acube Captcha service will
contain the id [
octoCaptchaServiceId]
and the instance [
octoCaptchaServiceInstance]
corresponding to the service of JCaptcha projet.
The
Acube Framework is able to support several captcha service by a
simple configuration:
<root id="captcha-config">
<captcha name="captcha1" id="1" class="acube.framework.captcha.
captchaServices.Captcha1Service">
<bean id="captcha1" class="com.octo.captcha.service
...."/>
</captcha>
<captcha name="captcha2" id="2" class="acube.framework.captcha.
captchaServices.Captcha2Service">
<bean id="imageCaptchaService2" class="com.octo.
captcha.service..."/>
</captcha>
</root>
explanations :
- 2 captcha tags:
- Each id'value are differents; Each name's value are
differents:
It necessary that all "id" or "name" attribute are unique.
id : <captcha> tag's "id" attribute refers switch
number in
CaptchaSelection method.
Important : When you add a new captcha in file conf, you have to
update the CaptchaSelection(String) with the id number.
name : It 's the name of your captcha. It is used par the
service to generate the image or compute the reponse of user.
- <captcha> 's "class" attribute refers an Acube class:
This class refers the Acube 's captcha service class. This class
must extends CaptchaAbstractService
- <bean> 's "class" attribute refers a JCaptcha class:
It corresponds to the service of JCaptcha you want to use.
Author:
-
EDS - bzgn4l
Sommaire des Attributs |
|
contentTypeContentType the ContentType refers http servlet
response 's content type.
|
|
idid the id refers Id attribute in
<captcha> tag.
|
|
octoCaptchaServiceIdoctoCaptchaServiceId the octoCaptchaServiceId
refers id of JCaptcha Service instance defined in
<captcha> tag.
|
|
|
Sommaire des Constructeurs |
|
Sommaire des Méthodes |
|
computeValidation(String idCaptcha, String sResponse)It the resolve method of your captcha. |
|
|
|
|
|
|
|
|
|
getOutStream(String idCaptcha, Locale lLocale)This method create a captcha 's new file output stream. |
|
parseElement(org.jdom.Element eCaptcha)The CaptchaManagerLoader parse the
root config. |
|
setContentType(String contentType)Set a compatible http servlet response content type for your
catpcha type of file. |
|
setId(Integer id)Setter of CaptchaServiceID. |
|
|
|
|
Méthodes héritées de la classe java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Détail des Attributs
id
private Integer id
-
id
the id refers Id attribute in
<captcha>
tag.
contentType
private String contentType
-
ContentType
the ContentType refers http servlet
response 's content type.
octoCaptchaServiceInstance
private Object octoCaptchaServiceInstance
-
octoCaptchaServiceInstance
the
octoCaptchaServiceInstance refers JCaptcha Service instance.
octoCaptchaServiceId
private String octoCaptchaServiceId
-
octoCaptchaServiceId
the octoCaptchaServiceId
refers id of JCaptcha Service instance defined in
<captcha>
tag.
Détail des Constructeurs
CaptchaAbstractService
public CaptchaAbstractService()
-
CaptchaAbstractService's Constructor.
Détail des méthodes
getOutStream
-
This method create a captcha 's new file output stream.
Paramètres:
-
idCaptcha - id of captcha 's new file output stream
-
lLocale - refers Locales of http Servlet Response.
Retours:
-
the file in array of bytes.
Exceptions:
-
parseElement
-
The CaptchaManagerLoader parse the
root config.
For each reading of </captcha> tags,
the CaptchaManagerLoader can select your AcubeCaptchaService
class for your specific jcaptcha service.
So, The
CaptchaManagerLoader can call this
method (on starting) in order to parse every </bean> you
have defined in the captcha configuration file.
This
method that you have to implement must finish calls of
setOctoCaptchaServiceInstance(String)
and
setOctoCaptchaServiceId(String)Paramètres:
-
eCaptcha - refers captcha Element (jdom) of </captcha>
-
Exceptions:
-
computeValidation
public abstract boolean computeValidation(String idCaptcha, String sResponse) throws CaptchaAcubeException -
It the resolve method of your captcha.
Paramètres:
-
idCaptcha - id of captcha 's new file output stream
-
sResponse - user response
Retours:
-
boolean true where it solved else false
Exceptions:
-
getContentType
public final String getContentType()
-
Retours:
-
the compatible content type for your catpcha type of
file.
setContentType
public void setContentType(String contentType)
-
Set a compatible http servlet response content type for your
catpcha type of file.
Paramètres:
-
contentType - : the http servlet response content type.
getOctoCaptchaServiceInstance
public final Object getOctoCaptchaServiceInstance()
-
Retours:
-
the instance of JCaptcha Service (the class you have
defined in conf file for </bean> tag).
setOctoCaptchaServiceInstance
public final void setOctoCaptchaServiceInstance(Object octoCaptchaServiceInstance)
-
Paramètres:
-
octoCaptchaServiceInstance - :
the instance of the class you have defined in conf
file for </bean> tag.
getOctoCaptchaServiceId
public final String getOctoCaptchaServiceId()
-
Retours:
-
the "id" of JCaptcha Service that you have defined in
conf file for </bean> tag.
setOctoCaptchaServiceId
public final void setOctoCaptchaServiceId(String octoCaptchaServiceId)
-
Paramètres:
-
octoCaptchaServiceId - :
the "id" of JCaptcha Service that you have defined
in conf file for </bean> tag.
getId
public final Integer getId()
-
Retours:
-
the "id" of Acube Captcha Service that you have defined
in conf file for </captcha> tag.
setId
public final void setId(Integer id)
-
Setter of CaptchaServiceID.
Paramètres:
-
id - :
the "id" of Acube Captcha Service that you have
defined in conf file </captcha> tag.
|
Framework Serveur J2EE ACube V3.1.0 |
|
Version 3.1.0 du 06/11/2009 / Etat : Validé |
Cette création est mise à disposition selon le Contrat Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique disponible en ligne http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ ou par courrier postal à Creative Commons, 559 Nathan Abbott Way, Stanford,California 94305, USA.
|
|