Merged V3.1 to HEAD

12923: New Enterprise Examples project containing hyperic plugin and README.txt
   12908: A few fixes to improve consistency in JMX object naming
   12889: Fix failing unit tests. Include linkvalidation in unit test classpath.
   12885: Merged DEV/DAVEW_POST3D to V3.1
      12881: Changes to allow monitoring of authentication configuration
      12862: Merged DEV/3.1_ENTERPRISE_ONLY to DEV/DAVEW_POST3D
         12797: Changes to allow persistence of changes made by JMX.
      12852: Review comment from Derek: remove dependencies of descriptor service (serverDescriptorDAO, currentRepoDescriptorDAO and installedRepoDescriptorDAO) out of bootstrap-context.xml
      12849: Correction to JAWS-221: dbscripts directory must be directly under config/alfresco in enterprise project.
      12847: JAWS-221: Move proprietary DB create/upgrade scripts into Enterprise Only project
      12845: Avoid NullPointerExceptions in status templates when no codeName or description exists for the status code

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13513 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2009-03-10 12:16:12 +00:00
parent 8491c4942b
commit 6641fd64fc
32 changed files with 224 additions and 1187 deletions

View File

@@ -28,6 +28,7 @@ import java.util.List;
import java.util.Set;
import org.alfresco.repo.cache.SimpleCache;
import org.alfresco.service.Managed;
import org.alfresco.service.cmr.security.AuthenticationService;
import org.springframework.beans.factory.InitializingBean;
@@ -76,6 +77,7 @@ public abstract class AbstractAuthenticationService implements AuthenticationSer
}
}
@Managed(category="Security")
public void setAllowedUsers(List<String> allowedUsers)
{
if (initialised)
@@ -105,6 +107,7 @@ public abstract class AbstractAuthenticationService implements AuthenticationSer
}
}
@Managed(category="Security")
public void setMaxUsers(int maxUsers)
{
if (initialised)

View File

@@ -31,6 +31,8 @@ import net.sf.acegisecurity.AuthenticationManager;
import net.sf.acegisecurity.UserDetails;
import net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken;
import org.alfresco.service.Managed;
public class AuthenticationComponentImpl extends AbstractAuthenticationComponent
{
private MutableAuthenticationDao authenticationDao;
@@ -57,6 +59,7 @@ public class AuthenticationComponentImpl extends AbstractAuthenticationComponent
*
* @param authenticationDao
*/
@Managed(category="Security")
public void setAuthenticationDao(MutableAuthenticationDao authenticationDao)
{
this.authenticationDao = authenticationDao;

View File

@@ -28,6 +28,7 @@ import java.util.Collections;
import java.util.Set;
import org.alfresco.repo.security.authentication.AuthenticationComponent.UserNameValidationMode;
import org.alfresco.service.Managed;
import org.alfresco.service.cmr.security.PermissionService;
public class AuthenticationServiceImpl extends AbstractAuthenticationService
@@ -51,6 +52,7 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService
super();
}
@Managed(category="Security")
public void setAuthenticationDao(MutableAuthenticationDao authenticationDao)
{
this.authenticationDao = authenticationDao;
@@ -61,6 +63,7 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService
this.ticketComponent = ticketComponent;
}
@Managed(category="Security")
public void setAuthenticationComponent(AuthenticationComponent authenticationComponent)
{
this.authenticationComponent = authenticationComponent;

View File

@@ -29,6 +29,7 @@ import java.util.List;
import net.sf.acegisecurity.Authentication;
import org.alfresco.service.Managed;
import org.alfresco.service.cmr.security.PermissionService;
/**
@@ -72,6 +73,7 @@ public class ChainingAuthenticationComponentImpl implements AuthenticationCompon
*
* @param authenticationComponents
*/
@Managed(category="Security")
public void setAuthenticationComponents(List<AuthenticationComponent> authenticationComponents)
{
this.authenticationComponents = authenticationComponents;
@@ -92,6 +94,7 @@ public class ChainingAuthenticationComponentImpl implements AuthenticationCompon
*
* @param mutableAuthenticationComponent
*/
@Managed(category="Security")
public void setMutableAuthenticationComponent(AuthenticationComponent mutableAuthenticationComponent)
{
this.mutableAuthenticationComponent = mutableAuthenticationComponent;
@@ -99,6 +102,7 @@ public class ChainingAuthenticationComponentImpl implements AuthenticationCompon
@Managed(category="Security")
public void setNtlmMode(NTLMMode ntlmMode)
{
this.ntlmMode = ntlmMode;

View File

@@ -29,6 +29,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.alfresco.service.Managed;
import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.service.cmr.security.PermissionService;
@@ -69,6 +70,7 @@ public class ChainingAuthenticationServiceImpl extends AbstractAuthenticationSer
return authenticationServices;
}
@Managed(category="Security")
public void setAuthenticationServices(List<AuthenticationService> authenticationServices)
{
this.authenticationServices = authenticationServices;
@@ -79,6 +81,7 @@ public class ChainingAuthenticationServiceImpl extends AbstractAuthenticationSer
return mutableAuthenticationService;
}
@Managed(category="Security")
public void setMutableAuthenticationService(AuthenticationService mutableAuthenticationService)
{
this.mutableAuthenticationService = mutableAuthenticationService;

View File

@@ -30,6 +30,7 @@ import net.sf.acegisecurity.UserDetails;
import net.sf.acegisecurity.providers.dao.UsernameNotFoundException;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.service.Managed;
import org.springframework.dao.DataAccessException;
/**
@@ -429,81 +430,97 @@ public class DefaultMutableAuthenticationDao implements MutableAuthenticationDao
// Bean IOC //
// -------- //
@Managed(category="Security")
public void setAllowCreateUser(boolean allowCreateUser)
{
this.allowCreateUser = allowCreateUser;
}
@Managed(category="Security")
public void setAllowDeleteUser(boolean allowDeleteUser)
{
this.allowDeleteUser = allowDeleteUser;
}
@Managed(category="Security")
public void setAllowGetAccountExpiryDate(boolean allowGetAccountExpiryDate)
{
this.allowGetAccountExpiryDate = allowGetAccountExpiryDate;
}
@Managed(category="Security")
public void setAllowGetAccountHasExpired(boolean allowGetAccountHasExpired)
{
this.allowGetAccountHasExpired = allowGetAccountHasExpired;
}
@Managed(category="Security")
public void setAllowGetAccountLocked(boolean allowGetAccountLocked)
{
this.allowGetAccountLocked = allowGetAccountLocked;
}
@Managed(category="Security")
public void setAllowGetCredentialsExpire(boolean allowGetCredentialsExpire)
{
this.allowGetCredentialsExpire = allowGetCredentialsExpire;
}
@Managed(category="Security")
public void setAllowGetCredentialsExpiryDate(boolean allowGetCredentialsExpiryDate)
{
this.allowGetCredentialsExpiryDate = allowGetCredentialsExpiryDate;
}
@Managed(category="Security")
public void setAllowGetCredentialsHaveExpired(boolean allowGetCredentialsHaveExpired)
{
this.allowGetCredentialsHaveExpired = allowGetCredentialsHaveExpired;
}
@Managed(category="Security")
public void setAllowGetEnabled(boolean allowGetEnabled)
{
this.allowGetEnabled = allowGetEnabled;
}
@Managed(category="Security")
public void setAllowSetAccountExpires(boolean allowSetAccountExpires)
{
this.allowSetAccountExpires = allowSetAccountExpires;
}
@Managed(category="Security")
public void setAllowSetAccountExpiryDate(boolean allowSetAccountExpiryDate)
{
this.allowSetAccountExpiryDate = allowSetAccountExpiryDate;
}
@Managed(category="Security")
public void setAllowSetAccountLocked(boolean allowSetAccountLocked)
{
this.allowSetAccountLocked = allowSetAccountLocked;
}
@Managed(category="Security")
public void setAllowSetCredentialsExpire(boolean allowSetCredentialsExpire)
{
this.allowSetCredentialsExpire = allowSetCredentialsExpire;
}
@Managed(category="Security")
public void setAllowSetCredentialsExpiryDate(boolean allowSetCredentialsExpiryDate)
{
this.allowSetCredentialsExpiryDate = allowSetCredentialsExpiryDate;
}
@Managed(category="Security")
public void setAllowSetEnabled(boolean allowSetEnabled)
{
this.allowSetEnabled = allowSetEnabled;
}
@Managed(category="Security")
public void setAllowUpdateUser(boolean allowUpdateUser)
{
this.allowUpdateUser = allowUpdateUser;

View File

@@ -41,6 +41,7 @@ import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.tenant.TenantService;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.service.Managed;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
@@ -82,6 +83,7 @@ public class RepositoryAuthenticationDao implements MutableAuthenticationDao
return userNamesAreCaseSensitive;
}
@Managed(category="Security")
public void setUserNamesAreCaseSensitive(boolean userNamesAreCaseSensitive)
{
this.userNamesAreCaseSensitive = userNamesAreCaseSensitive;

View File

@@ -40,6 +40,7 @@ import javax.security.sasl.RealmCallback;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.repo.security.authentication.AbstractAuthenticationComponent;
import org.alfresco.repo.security.authentication.AuthenticationException;
import org.alfresco.service.Managed;
/**
* JAAS based authentication
@@ -103,12 +104,14 @@ public class JAASAuthenticationComponent extends AbstractAuthenticationComponent
// Springification
@Managed(category="Security")
public void setJaasConfigEntryName(String jaasConfigEntryName)
{
this.jaasConfigEntryName = jaasConfigEntryName;
}
@Managed(category="Security")
public void setRealm(String realm)
{
this.realm = realm;

View File

@@ -29,6 +29,7 @@ import javax.naming.directory.InitialDirContext;
import org.alfresco.repo.security.authentication.AbstractAuthenticationComponent;
import org.alfresco.repo.security.authentication.AuthenticationException;
import org.alfresco.service.Managed;
/**
* Currently expects the cn name of the user which is in a fixed location.
@@ -50,21 +51,25 @@ public class LDAPAuthenticationComponentImpl extends AbstractAuthenticationCompo
super();
}
@Managed(category="Security")
public void setLDAPInitialDirContextFactory(LDAPInitialDirContextFactory ldapInitialDirContextFactory)
{
this.ldapInitialContextFactory = ldapInitialDirContextFactory;
}
@Managed(category="Security")
public void setUserNameFormat(String userNameFormat)
{
this.userNameFormat = userNameFormat;
}
@Managed(category="Security")
public void setEscapeCommasInBind(boolean escapeCommasInBind)
{
this.escapeCommasInBind = escapeCommasInBind;
}
@Managed(category="Security")
public void setEscapeCommasInUid(boolean escapeCommasInUid)
{
this.escapeCommasInUid = escapeCommasInUid;

View File

@@ -38,6 +38,7 @@ import javax.naming.directory.BasicAttributes;
import javax.naming.directory.InitialDirContext;
import org.alfresco.repo.security.authentication.AuthenticationException;
import org.alfresco.service.Managed;
import org.alfresco.util.ApplicationContextHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -60,8 +61,8 @@ public class LDAPInitialDirContextFactoryImpl implements LDAPInitialDirContextFa
super();
}
@Managed(category="Security")
public void setInitialDirContextEnvironment(Map<String, String> initialDirContextEnvironment)
{
this.initialDirContextEnvironment = initialDirContextEnvironment;
}
@@ -236,7 +237,8 @@ public class LDAPInitialDirContextFactoryImpl implements LDAPInitialDirContextFa
}
catch (NamingException nx)
{
throw new AuthenticationException("Unable to connect to LDAP Server; check LDAP configuration", nx);
logger.error("Unable to connect to LDAP Server; check LDAP configuration", nx);
return;
}
// Simple DN and password

View File

@@ -44,6 +44,7 @@ import javax.transaction.UserTransaction;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.importer.ExportSource;
import org.alfresco.repo.importer.ExportSourceImporterException;
import org.alfresco.service.Managed;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
@@ -84,21 +85,25 @@ public class LDAPPersonExportSource implements ExportSource
super();
}
@Managed(category="Security")
public void setPersonQuery(String personQuery)
{
this.personQuery = personQuery;
}
@Managed(category="Security")
public void setSearchBase(String searchBase)
{
this.searchBase = searchBase;
}
@Managed(category="Security")
public void setUserIdAttributeName(String userIdAttributeName)
{
this.userIdAttributeName = userIdAttributeName;
}
@Managed(category="Security")
public void setLDAPInitialDirContextFactory(LDAPInitialDirContextFactory ldapInitialDirContextFactory)
{
this.ldapInitialContextFactory = ldapInitialDirContextFactory;
@@ -109,6 +114,7 @@ public class LDAPPersonExportSource implements ExportSource
this.personService = personService;
}
@Managed(category="Security")
public void setAttributeDefaults(Map<String, String> attributeDefaults)
{
this.attributeDefaults = attributeDefaults;
@@ -119,11 +125,13 @@ public class LDAPPersonExportSource implements ExportSource
this.namespaceService = namespaceService;
}
@Managed(category="Security")
public void setAttributeMapping(Map<String, String> attributeMapping)
{
this.attributeMapping = attributeMapping;
}
@Managed(category="Security")
public void setErrorOnMissingUID(boolean errorOnMissingUID)
{
this.errorOnMissingUID = errorOnMissingUID;

View File

@@ -56,6 +56,7 @@ import org.alfresco.model.ContentModel;
import org.alfresco.repo.security.authentication.AbstractAuthenticationComponent;
import org.alfresco.repo.security.authentication.AuthenticationException;
import org.alfresco.repo.security.authentication.NTLMMode;
import org.alfresco.service.Managed;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.security.NoSuchPersonException;
@@ -281,6 +282,7 @@ public class NTLMAuthenticationComponentImpl extends AbstractAuthenticationCompo
*
* @param domain String
*/
@Managed(category="Security")
public void setDomain(String domain) {
// Check if the passthru server list is already configured
@@ -305,6 +307,7 @@ public class NTLMAuthenticationComponentImpl extends AbstractAuthenticationCompo
*
* @param servers String
*/
@Managed(category="Security")
public void setServers(String servers) {
// Check if the passthru server list is already configured
@@ -322,6 +325,7 @@ public class NTLMAuthenticationComponentImpl extends AbstractAuthenticationCompo
*
* @param useLocal String
*/
@Managed(category="Security")
public void setUseLocalServer(String useLocal)
{
// Check if the local server should be used for authentication
@@ -376,6 +380,7 @@ public class NTLMAuthenticationComponentImpl extends AbstractAuthenticationCompo
*
* @param guest String
*/
@Managed(category="Security")
public void setGuestAccess(String guest)
{
m_allowGuest = Boolean.parseBoolean(guest);
@@ -386,6 +391,7 @@ public class NTLMAuthenticationComponentImpl extends AbstractAuthenticationCompo
*
* @param auth String
*/
@Managed(category="Security")
public void setAllowAuthUserAsGuest(String auth)
{
m_allowAuthUserAsGuest = Boolean.parseBoolean(auth);
@@ -396,6 +402,7 @@ public class NTLMAuthenticationComponentImpl extends AbstractAuthenticationCompo
*
* @param nullDomain String
*/
@Managed(category="Security")
public void setNullDomainUseAnyServer(String nullDomain)
{
m_nullDomainUseAnyServer = Boolean.parseBoolean(nullDomain);
@@ -410,6 +417,7 @@ public class NTLMAuthenticationComponentImpl extends AbstractAuthenticationCompo
*
* @param providerClass String
*/
@Managed(category="Security")
public void setJCEProvider(String providerClass)
{
// Set the JCE provider, required to provide various encryption/hashing algorithms not available
@@ -457,6 +465,7 @@ public class NTLMAuthenticationComponentImpl extends AbstractAuthenticationCompo
*
* @param sessTmo String
*/
@Managed(category="Security")
public void setSessionTimeout(String sessTmo)
{
// Convert to an integer value and range check the timeout value
@@ -489,6 +498,7 @@ public class NTLMAuthenticationComponentImpl extends AbstractAuthenticationCompo
*
* @param protoOrder String
*/
@Managed(category="Security")
public void setProtocolOrder(String protoOrder)
{
// Parse the protocol order list