com.atlassian.confluence.security
Class DefaultCaptchaManager

java.lang.Object
  extended by com.atlassian.confluence.security.DefaultCaptchaManager
All Implemented Interfaces:
CaptchaManager, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

public class DefaultCaptchaManager
extends java.lang.Object
implements CaptchaManager, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean


Field Summary
static org.apache.log4j.Category log
           
 
Constructor Summary
DefaultCaptchaManager()
           
 
Method Summary
 java.util.Collection addCaptchaGroups(java.util.Collection groupList)
          Method adds a Collection of group names to the existing groups for the captcha group setting.
 void afterPropertiesSet()
           
 void destroy()
           
 void excludeGroups()
           
 void excludeNone()
           
 void excludeRegisteredUsers()
           
 java.lang.String generateCaptchaId()
           
 java.lang.String getExclude()
           
 com.octo.captcha.service.image.ImageCaptchaService getImageCaptchaService()
           
 UserAccessor getUserAccessor()
           
 boolean isCaptchaAvailable()
           
 boolean isCaptchaEnabled()
           
 boolean isDebugEnabled()
           
 void removeCaptchaGroup(java.lang.String group)
          Removes a group from the list of captcha groups
 void setCaptchaEnabled(boolean value)
           
 void setCaptchaEngineClassName(java.lang.String captchaEngineClassName)
           
 void setCaptchaGroups(java.util.Collection groupList)
           
 void setCaptchaStore(com.octo.captcha.service.captchastore.CaptchaStore captchaStore)
           
 void setDebugMode(boolean value)
          If true the captcha manager will accept "DEBUG" for every generated capthca and reject all other tokens.
 void setExclude(java.lang.String value)
           
 void setImageCaptchaService(com.octo.captcha.service.image.ImageCaptchaService imageCaptchaService)
           
 void setSettingsManager(SettingsManager settingsManager)
           
 void setUserAccessor(UserAccessor userAccessor)
           
 boolean showCaptchaForCurrentUser()
          Determines whether a capture has to be shown for the currently logged in users
 boolean validateCaptcha(java.lang.String captchaId, java.lang.String captchaResponse)
          validate captcha response
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Category log
Constructor Detail

DefaultCaptchaManager

public DefaultCaptchaManager()
Method Detail

setCaptchaStore

public void setCaptchaStore(com.octo.captcha.service.captchastore.CaptchaStore captchaStore)

setCaptchaEngineClassName

public void setCaptchaEngineClassName(java.lang.String captchaEngineClassName)

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

destroy

public void destroy()
             throws java.lang.Exception
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
java.lang.Exception

isCaptchaAvailable

public boolean isCaptchaAvailable()
Specified by:
isCaptchaAvailable in interface CaptchaManager

validateCaptcha

public boolean validateCaptcha(java.lang.String captchaId,
                               java.lang.String captchaResponse)
Description copied from interface: CaptchaManager
validate captcha response

Specified by:
validateCaptcha in interface CaptchaManager
Returns:
boolean

isCaptchaEnabled

public boolean isCaptchaEnabled()
Specified by:
isCaptchaEnabled in interface CaptchaManager

setCaptchaEnabled

public void setCaptchaEnabled(boolean value)
Specified by:
setCaptchaEnabled in interface CaptchaManager

isDebugEnabled

public boolean isDebugEnabled()
Specified by:
isDebugEnabled in interface CaptchaManager

setDebugMode

public void setDebugMode(boolean value)
Description copied from interface: CaptchaManager
If true the captcha manager will accept "DEBUG" for every generated capthca and reject all other tokens. This is meant primarly for acceptance testing user interface elements with Captcha forms. If true the exclude list is ignored and a Captcha prompt is supplied for all requests

Specified by:
setDebugMode in interface CaptchaManager

excludeNone

public void excludeNone()
Specified by:
excludeNone in interface CaptchaManager

excludeRegisteredUsers

public void excludeRegisteredUsers()
Specified by:
excludeRegisteredUsers in interface CaptchaManager

excludeGroups

public void excludeGroups()
Specified by:
excludeGroups in interface CaptchaManager

getExclude

public java.lang.String getExclude()
Specified by:
getExclude in interface CaptchaManager

setExclude

public void setExclude(java.lang.String value)
Specified by:
setExclude in interface CaptchaManager

setCaptchaGroups

public void setCaptchaGroups(java.util.Collection groupList)
Specified by:
setCaptchaGroups in interface CaptchaManager

addCaptchaGroups

public java.util.Collection addCaptchaGroups(java.util.Collection groupList)
Description copied from interface: CaptchaManager
Method adds a Collection of group names to the existing groups for the captcha group setting.

Specified by:
addCaptchaGroups in interface CaptchaManager
Parameters:
groupList - Collection of group names
Returns:
Collection of added group names

removeCaptchaGroup

public void removeCaptchaGroup(java.lang.String group)
Description copied from interface: CaptchaManager
Removes a group from the list of captcha groups

Specified by:
removeCaptchaGroup in interface CaptchaManager
Parameters:
group - String

showCaptchaForCurrentUser

public boolean showCaptchaForCurrentUser()
Description copied from interface: CaptchaManager
Determines whether a capture has to be shown for the currently logged in users

Specified by:
showCaptchaForCurrentUser in interface CaptchaManager

setSettingsManager

public void setSettingsManager(SettingsManager settingsManager)

getUserAccessor

public UserAccessor getUserAccessor()

setUserAccessor

public void setUserAccessor(UserAccessor userAccessor)

setImageCaptchaService

public void setImageCaptchaService(com.octo.captcha.service.image.ImageCaptchaService imageCaptchaService)
Specified by:
setImageCaptchaService in interface CaptchaManager

getImageCaptchaService

public com.octo.captcha.service.image.ImageCaptchaService getImageCaptchaService()
Specified by:
getImageCaptchaService in interface CaptchaManager

generateCaptchaId

public java.lang.String generateCaptchaId()
Specified by:
generateCaptchaId in interface CaptchaManager
Returns:
a new captchaId


Copyright © 2003-2010 Atlassian. All Rights Reserved.