com.octo.captcha.engine.bufferedengine
Class ContainerConfiguration

java.lang.Object
  extended by com.octo.captcha.engine.bufferedengine.ContainerConfiguration

public class ContainerConfiguration
extends java.lang.Object

Class that contains informations to configure the BufferedEngineContainer.


Constructor Summary
ContainerConfiguration(java.util.Map localeRatio, int maxVolatileMemorySize, int maxPersistentMemorySize, int swapSize, int feedSize)
          Contructs a ContainerConfiguration with custom feed size and sawp size
ContainerConfiguration(java.util.Map localeRatio, int maxVolatileMemorySize, int maxPersistentMemorySize, int swapSize, int feedSize, boolean serveOnlyConfiguredLocales, java.util.Locale defaultLocale)
          Contructs a ContainerConfiguration with custom feed size and sawp size
ContainerConfiguration(java.util.Map localeRatio, int maxVolatileMemorySize, int maxPersistentMemorySize, int swapSize, int feedSize, int feedBatchSize, boolean serveOnlyConfiguredLocales, java.util.Locale defaultLocale)
          Contructs a ContainerConfiguration with custom feed size and sawp size
 
Method Summary
 java.util.Locale getDefaultLocale()
           
 java.lang.Integer getFeedBatchSize()
           
 java.lang.Integer getFeedSize()
           
 HashedMap getLocaleRatio()
           
 java.lang.Integer getMaxPersistentMemorySize()
           
 java.lang.Integer getMaxVolatileMemorySize()
           
 java.lang.Integer getSwapSize()
           
 boolean isServeOnlyConfiguredLocales()
           
 void setDefaultLocale(java.util.Locale defaultLocale)
           
 void setFeedBatchSize(java.lang.Integer feedBatchSize)
           
 void setFeedSize(java.lang.Integer feedSize)
           
 void setLocaleRatio(java.util.Map localeRatio)
           
 void setMaxPersistentMemorySize(java.lang.Integer maxPersistentMemorySize)
           
 void setMaxVolatileMemorySize(java.lang.Integer maxVolatileMemorySize)
           
 void setServeOnlyConfiguredLocales(boolean serveOnlyConfiguredLocales)
           
 void setSwapSize(java.lang.Integer swapSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerConfiguration

public ContainerConfiguration(java.util.Map localeRatio,
                              int maxVolatileMemorySize,
                              int maxPersistentMemorySize,
                              int swapSize,
                              int feedSize)
Contructs a ContainerConfiguration with custom feed size and sawp size

Parameters:
localeRatio - locales and their ratio that should be feeded
maxVolatileMemorySize - in memory captcha buffer max size
maxPersistentMemorySize - persistent captcha buffer max size
swapSize - number of captchas that will be swapped from persistent to memory buffer each time
feedSize - number of captchas that will be generated and stored to persistent buffer each time

ContainerConfiguration

public ContainerConfiguration(java.util.Map localeRatio,
                              int maxVolatileMemorySize,
                              int maxPersistentMemorySize,
                              int swapSize,
                              int feedSize,
                              boolean serveOnlyConfiguredLocales,
                              java.util.Locale defaultLocale)
Contructs a ContainerConfiguration with custom feed size and sawp size

Parameters:
localeRatio - locales and their ratio that should be feeded
maxVolatileMemorySize - in memory captcha buffer max size
maxPersistentMemorySize - persistent captcha buffer max size
swapSize - number of captchas that will be swapped from persistent to memory buffer each time
feedSize - number of captchas that will be generated and stored to persistent buffer each time
serveOnlyConfiguredLocales - if set to true, serve only locales that are in configuration (only by language)
defaultLocale - the default locale used by this engineContainer.

ContainerConfiguration

public ContainerConfiguration(java.util.Map localeRatio,
                              int maxVolatileMemorySize,
                              int maxPersistentMemorySize,
                              int swapSize,
                              int feedSize,
                              int feedBatchSize,
                              boolean serveOnlyConfiguredLocales,
                              java.util.Locale defaultLocale)
Contructs a ContainerConfiguration with custom feed size and sawp size

Parameters:
localeRatio - locales and their ratio that should be feeded
maxVolatileMemorySize - in memory captcha buffer max size
maxPersistentMemorySize - persistent captcha buffer max size
swapSize - number of captchas that will be swapped from persistent to memory buffer each time
feedSize - number of captchas that will be generated and stored to persistent buffer each time
feedBatchSize - max number of batch captchas to build when feeding, in order to preserve memory
serveOnlyConfiguredLocales - if set to true, serve only locales that are in configuration (only by language)
defaultLocale - the default locale used by this engineContainer.
Method Detail

getFeedBatchSize

public java.lang.Integer getFeedBatchSize()

setFeedBatchSize

public void setFeedBatchSize(java.lang.Integer feedBatchSize)

isServeOnlyConfiguredLocales

public boolean isServeOnlyConfiguredLocales()

setServeOnlyConfiguredLocales

public void setServeOnlyConfiguredLocales(boolean serveOnlyConfiguredLocales)

getDefaultLocale

public java.util.Locale getDefaultLocale()

setDefaultLocale

public void setDefaultLocale(java.util.Locale defaultLocale)

getFeedSize

public java.lang.Integer getFeedSize()
Returns:

setFeedSize

public void setFeedSize(java.lang.Integer feedSize)
Parameters:
feedSize -

getLocaleRatio

public HashedMap getLocaleRatio()
Returns:
Map of the ratio of locales

setLocaleRatio

public void setLocaleRatio(java.util.Map localeRatio)
Parameters:
localeRatio - Map of the ratio of locales, to produce captcha and to swap captchas

getMaxPersistentMemorySize

public java.lang.Integer getMaxPersistentMemorySize()
Returns:
Get maximum size for the disk buffer

setMaxPersistentMemorySize

public void setMaxPersistentMemorySize(java.lang.Integer maxPersistentMemorySize)
Parameters:
maxPersistentMemorySize - Set maximum size for the disk buffer

getMaxVolatileMemorySize

public java.lang.Integer getMaxVolatileMemorySize()
Returns:
Get maximun size for the volatile buffer

setMaxVolatileMemorySize

public void setMaxVolatileMemorySize(java.lang.Integer maxVolatileMemorySize)
Parameters:
maxVolatileMemorySize - Set maximun size for the volatile buffer

getSwapSize

public java.lang.Integer getSwapSize()
Returns:
Get number of captchas to swap between the volatil buffer and the disk buffer

setSwapSize

public void setSwapSize(java.lang.Integer swapSize)
Parameters:
swapSize - Set number of captchas to swap between the volatil buffer and the disk buffer


Copyright 2003-2009 JCaptcha. All Rights Reserved.