mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merged V2.1 to HEAD
6327: Drops alfresco-deployment.zip in build/dist instead of build. 6328:Set AVM file name requirements as lenient as possible. 6329: Fixed DNS name restriction to allow 1-char host labels. 6330: Setting read-only flag for start up components (AR-1621 and AR-193) 6331: Minor formatting 6332: Implementation of a read-only, HTTP-based ContentStore. 6333: AR-1619: A debug message needed changing as the FileFolderService now supports adding children onto system nodes. 6334: Build fix 6335: Fix for AWC-1447 (Office Add-In - Create Collaboration Space) 6337: Fixed AR-1622: WebService requests must be wrapped in retries git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6721 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -348,6 +348,11 @@ public class ReplicatingContentStore extends AbstractContentStore
|
||||
{
|
||||
for (ContentStore store : secondaryStores)
|
||||
{
|
||||
// Ignore read-only stores
|
||||
if (!store.isWriteSupported())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
store.delete(contentUrl);
|
||||
}
|
||||
// log
|
||||
@@ -445,6 +450,19 @@ public class ReplicatingContentStore extends AbstractContentStore
|
||||
for (int i = 0; i < stores.size(); i++)
|
||||
{
|
||||
ContentStore store = stores.get(i);
|
||||
// Bypass read-only stores
|
||||
if (!store.isWriteSupported())
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Ignoring read-only store for content replication: \n" +
|
||||
" Content: " + writer + "\n" +
|
||||
" Store: " + store + "\n" +
|
||||
" Number: " + i);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// replicate the content to the store - we know the URL that we want to write to
|
||||
|
@@ -71,12 +71,18 @@ public class ReplicatingContentStoreTest extends AbstractWritableContentStoreTes
|
||||
primaryStore = new FileContentStore(storeDir);
|
||||
// create some secondary file stores
|
||||
secondaryStores = new ArrayList<ContentStore>(3);
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
storeDir = tempDir.getAbsolutePath() + File.separatorChar + GUID.generate();
|
||||
ContentStore store = new FileContentStore(storeDir);
|
||||
FileContentStore store = new FileContentStore(storeDir);
|
||||
secondaryStores.add(store);
|
||||
// Only the first 3 are writable
|
||||
if (i >= 3)
|
||||
{
|
||||
store.setReadOnly(true);
|
||||
}
|
||||
}
|
||||
// Create the replicating store
|
||||
replicatingStore = new ReplicatingContentStore();
|
||||
replicatingStore.setPrimaryStore(primaryStore);
|
||||
replicatingStore.setSecondaryStores(secondaryStores);
|
||||
@@ -106,6 +112,11 @@ public class ReplicatingContentStoreTest extends AbstractWritableContentStoreTes
|
||||
{
|
||||
for (ContentStore store : secondaryStores)
|
||||
{
|
||||
// This is only required for writable stores
|
||||
if (!store.isWriteSupported())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
ContentReader reader = store.getReader(contentUrl);
|
||||
assertTrue("Content was not replicated out to the secondary stores within a second", reader.exists());
|
||||
assertEquals("The replicated content was incorrect", content, reader.getContentString());
|
||||
|
Reference in New Issue
Block a user