com.atlassian.confluence.util
Class DefaultUserChecker

java.lang.Object
  extended by com.atlassian.confluence.util.DefaultUserChecker
All Implemented Interfaces:
UserChecker

public class DefaultUserChecker
extends Object
implements UserChecker


Field Summary
static String CACHE_KEY
           
protected static int UNLIMITED_USER_THRESHOLD
           
 
Fields inherited from interface com.atlassian.confluence.util.UserChecker
log, NUMBER_OF_REGISTERED_USERS, UNLIMITED_USERS
 
Constructor Summary
DefaultUserChecker()
           
 
Method Summary
 void decrementRegisteredUserCount()
          Decrements the cached number of registered users.
 int getNumberOfRegisteredUsers()
          Returns cached value of the number of registered users.
 UserAccessor getUserAccessor()
          cannot use spring injection here because userChecker is a dependency of userAccessor.
 boolean hasTooManyUsers()
           
 void incrementRegisteredUserCount()
          Increments the cached number of registered users.
 boolean isLicensedToAddMoreUsers()
           
 boolean isRunning()
           
 boolean isUnlimitedUserLicense()
           
 boolean isUnlimitedUserLicense(com.atlassian.license.License license)
           
 void resetResult()
           
 void setCacheFactory(com.atlassian.cache.CacheFactory cacheFactory)
           
 void setLicenseCalculator(LicenseCalculator licenseCalculator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_KEY

public static final String CACHE_KEY

UNLIMITED_USER_THRESHOLD

protected static final int UNLIMITED_USER_THRESHOLD
See Also:
Constant Field Values
Constructor Detail

DefaultUserChecker

public DefaultUserChecker()
Method Detail

setLicenseCalculator

public void setLicenseCalculator(LicenseCalculator licenseCalculator)

getNumberOfRegisteredUsers

public int getNumberOfRegisteredUsers()
Returns cached value of the number of registered users. Computes it if it doesn't exist in cache (this may take a while for large user sets). The value is calculated in a seperate (read-only) thread. Returns -1 if the value cannot be computed successfully (for compatibility with existing code).

Specified by:
getNumberOfRegisteredUsers in interface UserChecker

hasTooManyUsers

public boolean hasTooManyUsers()
Specified by:
hasTooManyUsers in interface UserChecker

isUnlimitedUserLicense

public boolean isUnlimitedUserLicense()

isUnlimitedUserLicense

public boolean isUnlimitedUserLicense(com.atlassian.license.License license)

isLicensedToAddMoreUsers

public boolean isLicensedToAddMoreUsers()
Specified by:
isLicensedToAddMoreUsers in interface UserChecker

resetResult

public void resetResult()
Specified by:
resetResult in interface UserChecker

isRunning

public boolean isRunning()

incrementRegisteredUserCount

public void incrementRegisteredUserCount()
Increments the cached number of registered users. only does so if cached value has been computed.

Specified by:
incrementRegisteredUserCount in interface UserChecker

decrementRegisteredUserCount

public void decrementRegisteredUserCount()
Decrements the cached number of registered users.

Specified by:
decrementRegisteredUserCount in interface UserChecker

setCacheFactory

public void setCacheFactory(com.atlassian.cache.CacheFactory cacheFactory)

getUserAccessor

public UserAccessor getUserAccessor()
cannot use spring injection here because userChecker is a dependency of userAccessor. retrieve from ContainerManager to avoid circular bean reference.



Copyright © 2003-2011 Atlassian. All Rights Reserved.