com.atlassian.crowd.manager.property
Interface PropertyManager

All Known Implementing Classes:
PropertyManagerGeneric

public interface PropertyManager

API for storing and retrieving Crowd server properties.


Method Summary
 void generateDesEncryptionKey()
          Generates and stores a DES key for DES encoded passwords.
 Integer getBuildNumber()
          This method returns the current build number for Crowd from the datastore.
 long getCacheTime()
          Deprecated. since 1.0.2 All caching configuration has moved to the crowd-ehcache.xml
 int getCurrentLicenseResourceTotal()
           
 String getDeploymentTitle()
           
 Key getDesEncryptionKey()
           
 String getDomain()
          Will return the Domain property from the datastore or null if the domain has not been set.
 String getNotificationEmail()
           
 String getProperty(String name)
          Retrieves an arbitrary property by name.
 long getSessionTime()
           
 SMTPServer getSMTPServer()
           
 String getSMTPTemplate()
          Deprecated. As of release 2.1, use getProperty(String)
 String getTokenSeed()
           
 String getTrustedProxyServers()
          Retrieves a String that contains a list of proxy servers we trust to correctly set the X-Forwarded-For flag.
 boolean isCacheEnabled()
           
 boolean isGzipEnabled()
           
 boolean isSecureCookie()
           
 boolean isUsingDatabaseTokenStorage()
          Will return true if the Crowd instance is using database token storage for authentication Token's otherwise assume we are using in-memory
 void removeProperty(String name)
          Will attempt to remove a property from the datastore
 void setBuildNumber(Integer buildNumber)
          Will set the buildNumber for the current release of Crowd.
 void setCacheEnabled(boolean enabled)
           
 void setCacheTime(long cacheTime)
          Deprecated. since 1.0.2 All caching configuration has moved to the crowd-ehcache.xml
 void setCurrentLicenseResourceTotal(int total)
           
 void setDeploymentTitle(String title)
           
 void setDomain(String domain)
           
 void setGzipEnabled(boolean gzip)
           
 void setNotificationEmail(String notificationEmail)
           
 void setProperty(String name, String value)
          Sets an arbitrary property.
 void setSecureCookie(boolean secure)
           
 void setSessionTime(long time)
           
 void setSMTPServer(SMTPServer server)
           
 void setSMTPTemplate(String template)
          Deprecated. As of release 2.1, use setProperty(String, String)
 void setTokenSeed(String seed)
           
 void setTrustedProxyServers(String proxyServers)
          Persists a String containing a list of proxy servers we trust to correctly set the X-Forwarded-For flag.
 void setUsingDatabaseTokenStorage(boolean usingDatabaseTokenStorage)
          Will set a property to state that this crowd instance is using database token storage, otherwise assume we are using in-memory
 

Method Detail

getCacheTime

long getCacheTime()
                  throws PropertyManagerException
Deprecated. since 1.0.2 All caching configuration has moved to the crowd-ehcache.xml

Returns the cache time in minutes

Returns:
caching time in minutes
Throws:
PropertyManagerException - if the property cannot be found

setCacheTime

void setCacheTime(long cacheTime)
Deprecated. since 1.0.2 All caching configuration has moved to the crowd-ehcache.xml

Sets the cache time in minutes

Parameters:
cacheTime - the caching time in minutes

getTokenSeed

String getTokenSeed()
                    throws PropertyManagerException
Returns:
token seed.
Throws:
PropertyManagerException - property does not exist.

setTokenSeed

void setTokenSeed(String seed)
Parameters:
seed - token seed.

getDeploymentTitle

String getDeploymentTitle()
                          throws PropertyManagerException
Returns:
deployment title.
Throws:
PropertyManagerException - property does not exist.

setDeploymentTitle

void setDeploymentTitle(String title)
Parameters:
title - deployment title.

getDomain

String getDomain()
                 throws PropertyManagerException
Will return the Domain property from the datastore or null if the domain has not been set.

Returns:
domain or null
Throws:
PropertyManagerException - property does not exist.

setDomain

void setDomain(String domain)
Parameters:
domain - SSO cookie domain.

isSecureCookie

boolean isSecureCookie()
                       throws PropertyManagerException
Returns:
true if the "secure" flag should be set on the SSO cookie.
Throws:
PropertyManagerException - property does not exist.

setSecureCookie

void setSecureCookie(boolean secure)
Parameters:
secure - true if the "secure" flag should be set on the SSO cookie.

setCacheEnabled

void setCacheEnabled(boolean enabled)
Parameters:
enabled - true if application authorisation caching should be used on the server-side.

isCacheEnabled

boolean isCacheEnabled()
Returns:
true if application authorisation caching is used on the server-side.

getSessionTime

long getSessionTime()
Returns:
number of minutes the session is valid.

setSessionTime

void setSessionTime(long time)
Parameters:
time - number of minutes the session is valid.

getSMTPServer

SMTPServer getSMTPServer()
                         throws PropertyManagerException
Returns:
SMTP server config.
Throws:
PropertyManagerException - property does not exist.

setSMTPServer

void setSMTPServer(SMTPServer server)
Parameters:
server - SMTP server config.

getDesEncryptionKey

Key getDesEncryptionKey()
                        throws PropertyManagerException
Returns:
DES key for DES encoded passwords.
Throws:
PropertyManagerException - property does not exist.

generateDesEncryptionKey

void generateDesEncryptionKey()
                              throws PropertyManagerException
Generates and stores a DES key for DES encoded passwords.

Throws:
PropertyManagerException - DES algorithm does not exist.

setSMTPTemplate

@Deprecated
void setSMTPTemplate(String template)
Deprecated. As of release 2.1, use setProperty(String, String)

Parameters:
template - mail template.

getSMTPTemplate

@Deprecated
String getSMTPTemplate()
                       throws PropertyManagerException
Deprecated. As of release 2.1, use getProperty(String)

Returns:
mail template.
Throws:
PropertyManagerException - property does not exist.

setCurrentLicenseResourceTotal

void setCurrentLicenseResourceTotal(int total)
Parameters:
total - license resource total.

getCurrentLicenseResourceTotal

int getCurrentLicenseResourceTotal()
Returns:
license resource total.

setNotificationEmail

void setNotificationEmail(String notificationEmail)
Parameters:
notificationEmail - notification email.

getNotificationEmail

String getNotificationEmail()
                            throws PropertyManagerException
Returns:
notification email.
Throws:
PropertyManagerException - property does not exist.

isGzipEnabled

boolean isGzipEnabled()
                      throws PropertyManagerException
Returns:
true if GZip compression should be used.
Throws:
PropertyManagerException - property does not exist.

setGzipEnabled

void setGzipEnabled(boolean gzip)
Parameters:
gzip - true if GZip compression should be used.

getBuildNumber

Integer getBuildNumber()
                       throws PropertyManagerException
This method returns the current build number for Crowd from the datastore. This BuildNumber may not be the same as the build number in BuildUtils.BUILD_NUMBER since this number is for the current release of Crowd, while the number in the database may still be set to a previous version if the UpgradeManager has not been run.

Returns:
an Integer representing the current build number in the database.
Throws:
PropertyManagerException - if we fail to find the buildNumber

setBuildNumber

void setBuildNumber(Integer buildNumber)
Will set the buildNumber for the current release of Crowd.

Parameters:
buildNumber - the buildNumber to set in the database

getTrustedProxyServers

String getTrustedProxyServers()
                              throws PropertyManagerException
Retrieves a String that contains a list of proxy servers we trust to correctly set the X-Forwarded-For flag. Internal format of this string is the responsibility of TrustedProxyManagerImpl.

Returns:
list of proxy servers as a string.
Throws:
PropertyManagerException - If the list of proxy servers could not be found.

setTrustedProxyServers

void setTrustedProxyServers(String proxyServers)
Persists a String containing a list of proxy servers we trust to correctly set the X-Forwarded-For flag. Internal format of this string is the responsibility of TrustedProxyManagerImpl.

Parameters:
proxyServers - proxy servers.

isUsingDatabaseTokenStorage

boolean isUsingDatabaseTokenStorage()
                                    throws PropertyManagerException
Will return true if the Crowd instance is using database token storage for authentication Token's otherwise assume we are using in-memory

Returns:
true if database token storage is being used.
Throws:
PropertyManagerException - property does not exist.

setUsingDatabaseTokenStorage

void setUsingDatabaseTokenStorage(boolean usingDatabaseTokenStorage)
Will set a property to state that this crowd instance is using database token storage, otherwise assume we are using in-memory

Parameters:
usingDatabaseTokenStorage - true if you are switching to in-memory token storage

removeProperty

void removeProperty(String name)
Will attempt to remove a property from the datastore

Parameters:
name - the name of the property.

getProperty

String getProperty(String name)
                   throws ObjectNotFoundException
Retrieves an arbitrary property by name.

Parameters:
name - name of property.
Returns:
value.
Throws:
ObjectNotFoundException - property does not exist.

setProperty

void setProperty(String name,
                 String value)
Sets an arbitrary property.

Parameters:
name - name of property.
value - value.


Copyright © 2012 Atlassian. All Rights Reserved.