atg.security
Class GenericAccountInitializer

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.security.GenericAccountInitializer
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, AccountInitializer, AccountTypes, java.util.EventListener
Direct Known Subclasses:
LDAPAccountInitializer

public class GenericAccountInitializer
extends GenericService
implements AccountInitializer, AccountTypes

A service that copies accounts between two account managers. This is used as a way of initializing the live account database with a set of standard accounts that might be extended by layered products or new product versions.

This will obtain a list of accounts from the "from" account manager and check to see if they exist on the "to" account manager. Any accounts that are not found in the "to" account manager will be created.


Field Summary
static java.lang.String CLASS_VERSION
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.security.AccountTypes
ANY_ACCOUNT, GROUP_ACCOUNT, LOGIN_ACCOUNT, PRIVILEGE_ACCOUNT
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
GenericAccountInitializer()
           
 
Method Summary
 void createAccounts(AccountManager toManager, int accountType)
          This creates any accounts of the given account type present in the source but missing in the target.
 boolean getEncryptPasswords()
          Returns true if source account passwords should be encrypted using the destination account manager's password hasher.
 boolean getForceCreation()
          Returns true if all accounts should be created even if there are already accounts in the account manager.
 AccountManager getFromManager()
          Returns the account manager that will be used as the source of the account data.
 void initializeAccounts(AccountManager toManager)
          Sets up accounts in the indicated account manager.
 boolean isEnabled()
          Returns true if the initializer is enabled, false if not.
 void setEnabled(boolean b)
          If set to true, the initializer is enabled and will attempt to copy accounts on startup.
 void setEncryptPasswords(boolean b)
          If true, source account passwords should be encrypted using the destination account manager's password hasher.
 void setForceCreation(boolean b)
          If set to true, all accounts will be created if they do not exist even if there are accounts already in the account manager.
 void setFromManager(AccountManager newManager)
          Changes the account manager that will be used as the source of the account data.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Constructor Detail

GenericAccountInitializer

public GenericAccountInitializer()
Method Detail

isEnabled

public boolean isEnabled()
Returns true if the initializer is enabled, false if not.


setEnabled

public void setEnabled(boolean b)
If set to true, the initializer is enabled and will attempt to copy accounts on startup.


getEncryptPasswords

public boolean getEncryptPasswords()
Returns true if source account passwords should be encrypted using the destination account manager's password hasher. This is true by default under the assumption that passwords will be in plaintext.


setEncryptPasswords

public void setEncryptPasswords(boolean b)
If true, source account passwords should be encrypted using the destination account manager's password hasher. If false the assumption is that the source and destination account managers use the same password encryption scheme and the passwords are already encrypted.


getForceCreation

public boolean getForceCreation()
Returns true if all accounts should be created even if there are already accounts in the account manager. This is a handy way of ensuring that all of the standard accounts exist for any given configuration.


setForceCreation

public void setForceCreation(boolean b)
If set to true, all accounts will be created if they do not exist even if there are accounts already in the account manager. This is a handy way of ensuring that all of the standard accounts exist for any given configuration.


getFromManager

public AccountManager getFromManager()
Returns the account manager that will be used as the source of the account data.


setFromManager

public void setFromManager(AccountManager newManager)
Changes the account manager that will be used as the source of the account data.


createAccounts

public void createAccounts(AccountManager toManager,
                           int accountType)
This creates any accounts of the given account type present in the source but missing in the target.


initializeAccounts

public void initializeAccounts(AccountManager toManager)
Sets up accounts in the indicated account manager.

Specified by:
initializeAccounts in interface AccountInitializer