Framework Serveur J2EE ACube V2.7.4
CLASSE PRECEDANTE CLASSE SUIVANTE
SOMMAIRE: ATTR CONSTR METH DETAIL: ATTR CONSTR METH

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 :
Author:
EDS - bzgn4l

Sommaire des Attributs
private String
contentType
ContentType the ContentType refers http servlet response 's content type.
private Integer
id
id the id refers Id attribute in <captcha> tag.
private String
octoCaptchaServiceId
octoCaptchaServiceId the octoCaptchaServiceId refers id of JCaptcha Service instance defined in <captcha> tag.
private Object
octoCaptchaServiceInstance
octoCaptchaServiceInstance the octoCaptchaServiceInstance refers JCaptcha Service instance.
Sommaire des Constructeurs
CaptchaAbstractService()
CaptchaAbstractService's Constructor.
Sommaire des Méthodes
abstract boolean
computeValidation(String idCaptcha, String sResponse)
It the resolve method of your captcha.
final String
final Integer
final String
final Object
abstract byte[]
getOutStream(String idCaptcha, Locale lLocale)
This method create a captcha 's new file output stream.
abstract void
parseElement(Element eCaptcha)
The CaptchaManagerLoader parse the root config.
void
setContentType(String contentType)
Set a compatible http servlet response content type for your catpcha type of file.
final void
setId(Integer id)
Setter of CaptchaServiceID.
final void
setOctoCaptchaServiceId(String octoCaptchaServiceId)
Must be call by your specific parseElement(Element).
final void
setOctoCaptchaServiceInstance(Object octoCaptchaServiceInstance)
Must be call by your specific parseElement(Element).
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
public abstract byte[] getOutStream(String idCaptcha,
                                    Locale lLocale)
                             throws CaptchaAcubeException
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:
CaptchaAcubeException - CaptchaAcubeException

parseElement
public abstract void parseElement(Element eCaptcha)
                           throws CaptchaAcubeException
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:
CaptchaAcubeException - CaptchaAcubeException

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:
CaptchaAcubeException - CaptchaAcubeException

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)
Must be call by your specific parseElement(Element).
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)
Must be call by your specific parseElement(Element).
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 V2.7.4
CLASSE PRECEDANTE CLASSE SUIVANTE
SOMMAIRE: ATTR CONSTR METH DETAIL: ATTR CONSTR METH

Version 2.7.4 du 10/07/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.
Documentation generated by DocFlex