All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.octo.captcha.service.image.DefaultManageableImageCaptchaService Maven / Gradle / Ivy

/*
 * JCaptcha, the open source java framework for captcha definition and integration
 * Copyright (c)  2007 jcaptcha.net. All Rights Reserved.
 * See the LICENSE.txt file distributed with this package.
 */

package com.octo.captcha.service.image;


import com.octo.captcha.engine.image.gimpy.DefaultGimpyEngine;
import com.octo.captcha.engine.CaptchaEngine;
import com.octo.captcha.service.captchastore.FastHashMapCaptchaStore;
import com.octo.captcha.service.captchastore.CaptchaStore;

/**
 * 

Default service implementation : use a {@link FastHashMapCaptchaStore} as captcha store, and a DefaultGimpyEngine

It is initialized * with thoses default values :
  • min guaranted delay : 180s
  • max store size : 100000 captchas
  • *
  • max store size before garbage collection : 75000
* * @author Marc-Antoine Garrigue * @version 1.0 */ public class DefaultManageableImageCaptchaService extends AbstractManageableImageCaptchaService implements ImageCaptchaService { /** * Construct a new ImageCaptchaService with a {@link FastHashMapCaptchaStore} and a {@link DefaultGimpyEngine} * minGuarantedStorageDelayInSeconds = 180s * maxCaptchaStoreSize = 100000 * captchaStoreLoadBeforeGarbageCollection=75000 */ public DefaultManageableImageCaptchaService() { super(new FastHashMapCaptchaStore(), new DefaultGimpyEngine(), 180, 100000, 75000); } /** * Construct a new ImageCaptchaService with a {@link FastHashMapCaptchaStore} and a {@link DefaultGimpyEngine} * @param minGuarantedStorageDelayInSeconds * @param maxCaptchaStoreSize * @param captchaStoreLoadBeforeGarbageCollection */ public DefaultManageableImageCaptchaService( int minGuarantedStorageDelayInSeconds, int maxCaptchaStoreSize, int captchaStoreLoadBeforeGarbageCollection) { super(new FastHashMapCaptchaStore(), new DefaultGimpyEngine(),minGuarantedStorageDelayInSeconds, maxCaptchaStoreSize, captchaStoreLoadBeforeGarbageCollection); } /** * @param captchaStore * @param captchaEngine * @param minGuarantedStorageDelayInSeconds * @param maxCaptchaStoreSize * @param captchaStoreLoadBeforeGarbageCollection */ public DefaultManageableImageCaptchaService(CaptchaStore captchaStore, CaptchaEngine captchaEngine, int minGuarantedStorageDelayInSeconds, int maxCaptchaStoreSize, int captchaStoreLoadBeforeGarbageCollection) { super(captchaStore, captchaEngine, minGuarantedStorageDelayInSeconds, maxCaptchaStoreSize, captchaStoreLoadBeforeGarbageCollection); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy