mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
57505: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3) 57346: Merged DEV to V4.2-BUG-FIX (4.2.1) 57172: MNT-9768 : ChainingUserRegistrySynchronizerTest never ending on SQL Server Changed the API to use the synchronization only with split transactions. Fixed the test to pass on SQL Server. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61835 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -450,12 +450,24 @@ public class ChainingUserRegistrySynchronizer extends AbstractLifecycleBean
|
||||
Object params[] = {authenticatorName};
|
||||
throw new AuthenticationException("authentication.err.validation.authenticator.notfound", params);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.repo.security.sync.UserRegistrySynchronizer#synchronize(boolean, boolean, boolean)
|
||||
*/
|
||||
@Override
|
||||
public void synchronize(boolean forceUpdate, boolean isFullSync, final boolean splitTxns)
|
||||
{
|
||||
synchronizeInternal(forceUpdate, isFullSync, splitTxns);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void synchronize(boolean forceUpdate, boolean isFullSync)
|
||||
{
|
||||
synchronizeInternal(forceUpdate, isFullSync, true);
|
||||
}
|
||||
|
||||
private void synchronizeInternal(boolean forceUpdate, boolean isFullSync, final boolean splitTxns)
|
||||
{
|
||||
if (ChainingUserRegistrySynchronizer.logger.isDebugEnabled())
|
||||
{
|
||||
@@ -1454,7 +1466,7 @@ public class ChainingUserRegistrySynchronizer extends AbstractLifecycleBean
|
||||
}
|
||||
}
|
||||
|
||||
public void processGroups(UserRegistry userRegistry, boolean isFullSync, boolean splitTxns)
|
||||
private void processGroups(UserRegistry userRegistry, boolean isFullSync, boolean splitTxns)
|
||||
{
|
||||
// If we got back some groups, we have to cross reference them with the set of known authorities
|
||||
if (isFullSync || !this.groupParentAssocsToDelete.isEmpty()
|
||||
@@ -1634,7 +1646,7 @@ public class ChainingUserRegistrySynchronizer extends AbstractLifecycleBean
|
||||
}
|
||||
}
|
||||
|
||||
public void finalizeAssociations(UserRegistry userRegistry, boolean splitTxns)
|
||||
private void finalizeAssociations(UserRegistry userRegistry, boolean splitTxns)
|
||||
{
|
||||
// First validate the group associations to be created for potential cycles. Remove any offending association
|
||||
validateGroupParentAssocsToCreate();
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2013 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -45,6 +45,9 @@ public interface UserRegistrySynchronizer
|
||||
* Retrieves timestamped user and group information from configured external sources and compares it with the local
|
||||
* users and groups last retrieved from the same sources. Any updates and additions made to those users and groups
|
||||
* are applied to the local Alfresco copies.
|
||||
* <p>
|
||||
* This method is <b>deprecated</b>, use {@link #synchronize(boolean forceUpdate, boolean isFullSync)} instead.
|
||||
* </p>
|
||||
*
|
||||
* @param forceUpdate
|
||||
* Should the complete set of users and groups be updated / created locally or just those known to have
|
||||
@@ -62,8 +65,28 @@ public interface UserRegistrySynchronizer
|
||||
* <code>false</code>, all users and groups are processed in the current transaction. This is required if
|
||||
* calling synchronously (e.g. in response to an authentication event in the same transaction).
|
||||
*/
|
||||
@Deprecated
|
||||
public void synchronize(boolean forceUpdate, boolean isFullSync, boolean splitTxns);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves timestamped user and group information from configured external sources and compares it with the local
|
||||
* users and groups last retrieved from the same sources. Any updates and additions made to those users and groups
|
||||
* are applied to the local Alfresco copies. Unlike deprecated {@link #synchronize(boolean, boolean, boolean)},
|
||||
* this process is always run in different transactions and threads.
|
||||
*
|
||||
* @param forceUpdate
|
||||
* Should the complete set of users and groups be updated / created locally or just those known to have
|
||||
* changed since the last sync? When <code>true</code> then <i>all</i> users and groups are queried from
|
||||
* the user registry and updated locally. When <code>false</code> then each source is only queried for
|
||||
* those users and groups modified since the most recent modification date of all the objects last
|
||||
* queried from that same source.
|
||||
* @param isFullSync
|
||||
* Should a complete set of user and group IDs be queried from the user registries in order to determine
|
||||
* deletions? This parameter is independent of <code>force</code> as a separate query is run to process
|
||||
* updates.
|
||||
*/
|
||||
public void synchronize(boolean forceUpdate, boolean isFullSync);
|
||||
|
||||
/**
|
||||
* Gets the set of property names that are auto-mapped for the user with the given user name. These should remain
|
||||
* read-only for the user in the UI.
|
||||
|
@@ -312,7 +312,8 @@ public class ChainingUserRegistrySynchronizerTest extends TestCase
|
||||
{
|
||||
public Void doWork() throws Exception
|
||||
{
|
||||
ChainingUserRegistrySynchronizerTest.this.synchronizer.synchronize(false, false, false);
|
||||
// Split transactions to avoid MNT-9768
|
||||
ChainingUserRegistrySynchronizerTest.this.synchronizer.synchronize(false, false);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user