From 9dc6731ac47ca9adefbb0a7573854345114b1b58 Mon Sep 17 00:00:00 2001 From: tiagosalvado10 <9038083+tiagosalvado10@users.noreply.github.com> Date: Wed, 16 Sep 2020 11:38:10 +0100 Subject: [PATCH 1/9] Merge pull request #1220 from Alfresco/hotfix-3.2/MNT-21818_fix_tests [MNT-21818] Created records management root cache to avoid performing the same query multiple times (cherry picked from commit e75022a6f1cc3b2c2427ed43c73cb2eb735ca079) --- .../rm-model-context.xml | 2 + .../rm-service-context.xml | 9 + .../fileplan/FilePlanService.java | 2 +- .../fileplan/FilePlanServiceImpl.java | 49 ++++-- .../type/RecordsManagementContainerType.java | 52 +++++- .../model/rma/type/RmSiteType.java | 61 ++++++- .../util/RMContainerCacheManager.java | 162 ++++++++++++++++++ .../test/util/BaseRMTestCase.java | 14 +- 8 files changed, 333 insertions(+), 18 deletions(-) create mode 100644 rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/util/RMContainerCacheManager.java diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml index 9119c2f01c..e3010b1eb5 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml @@ -71,6 +71,7 @@ + @@ -123,6 +124,7 @@ + diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml index 3b5c7eee06..0b1b335fef 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml @@ -389,6 +389,14 @@ + + + + + + + + @@ -397,6 +405,7 @@ parent="baseService" class="org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanServiceImpl"> + diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/fileplan/FilePlanService.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/fileplan/FilePlanService.java index f8b784d342..41bb9576b8 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/fileplan/FilePlanService.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/fileplan/FilePlanService.java @@ -346,4 +346,4 @@ public interface FilePlanService */ NodeRef createRecordCategory(NodeRef parent, String name, Map properties); -} +} \ No newline at end of file diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/fileplan/FilePlanServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/fileplan/FilePlanServiceImpl.java index 1194805168..a700b9dce9 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/fileplan/FilePlanServiceImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/fileplan/FilePlanServiceImpl.java @@ -42,6 +42,7 @@ import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel; import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService; +import org.alfresco.module.org_alfresco_module_rm.util.RMContainerCacheManager; import org.alfresco.module.org_alfresco_module_rm.util.ServiceBaseImpl; import org.alfresco.repo.cache.SimpleCache; import org.alfresco.repo.domain.node.NodeDAO; @@ -101,6 +102,9 @@ public class FilePlanServiceImpl extends ServiceBaseImpl /** Site service */ private SiteService siteService; + /** RM container cache manager **/ + private RMContainerCacheManager rmContainerCacheManager; + /** * Gets the file plan role service * @@ -174,6 +178,15 @@ public class FilePlanServiceImpl extends ServiceBaseImpl this.rootContainerCache = rootContainerCache; } + /** + * @param rmContainerCacheManager RM container cache manager + * + */ + public void setRmContainerCacheManager(RMContainerCacheManager rmContainerCacheManager) + { + this.rmContainerCacheManager = rmContainerCacheManager; + } + /** * @see org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService#getFilePlans(org.alfresco.service.cmr.repository.StoreRef) */ @@ -185,20 +198,30 @@ public class FilePlanServiceImpl extends ServiceBaseImpl final Set results = new HashSet<>(); Set aspects = new HashSet<>(1); aspects.add(ASPECT_RECORDS_MANAGEMENT_ROOT); - getNodeDAO().getNodesWithAspects(aspects, Long.MIN_VALUE, Long.MAX_VALUE, new NodeDAO.NodeRefQueryCallback() - { - @Override - public boolean handle(Pair nodePair) - { - NodeRef nodeRef = nodePair.getSecond(); - if (storeRef.equals(nodeRef.getStoreRef())) - { - results.add(nodeRef); - } - return true; - } - }); + if (!rmContainerCacheManager.isCached(storeRef)) + { + getNodeDAO().getNodesWithAspects(aspects, Long.MIN_VALUE, Long.MAX_VALUE, new NodeDAO.NodeRefQueryCallback() + { + @Override + public boolean handle(Pair nodePair) + { + NodeRef nodeRef = nodePair.getSecond(); + if (storeRef.equals(nodeRef.getStoreRef())) + { + results.add(nodeRef); + rmContainerCacheManager.add(nodeRef); + } + + return true; + } + }); + } + else + { + return rmContainerCacheManager.get(storeRef); + } + return results; } diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RecordsManagementContainerType.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RecordsManagementContainerType.java index 72a7894901..582c6ec1d6 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RecordsManagementContainerType.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RecordsManagementContainerType.java @@ -33,6 +33,7 @@ import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean; import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; import org.alfresco.module.org_alfresco_module_rm.record.RecordService; import org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderService; +import org.alfresco.module.org_alfresco_module_rm.util.RMContainerCacheManager; import org.alfresco.repo.node.NodeServicePolicies; import org.alfresco.repo.policy.Behaviour.NotificationFrequency; import org.alfresco.repo.policy.annotation.Behaviour; @@ -55,7 +56,8 @@ import org.alfresco.service.namespace.QName; defaultType = "rma:recordsManagementContainer" ) public class RecordsManagementContainerType extends BaseBehaviourBean - implements NodeServicePolicies.OnCreateChildAssociationPolicy + implements NodeServicePolicies.OnCreateChildAssociationPolicy, + NodeServicePolicies.OnDeleteChildAssociationPolicy { /** behaviour name */ private static final String BEHAVIOUR_NAME = "onCreateContainerType"; @@ -69,9 +71,21 @@ public class RecordsManagementContainerType extends BaseBehaviourBean /** record folder service */ protected RecordFolderService recordFolderService; + /** RM container cache manager **/ + private RMContainerCacheManager rmContainerCacheManager; + /** I18N */ private static final String MSG_CANNOT_CAST_TO_RM_TYPE = "rm.action.cast-to-rm-type"; + /** + * @param rmContainerCacheManager RM container cache manager + * + */ + public void setRmContainerCacheManager(RMContainerCacheManager rmContainerCacheManager) + { + this.rmContainerCacheManager = rmContainerCacheManager; + } + /** * @param identifierService identifier service */ @@ -194,12 +208,48 @@ public class RecordsManagementContainerType extends BaseBehaviourBean setIdenifierProperty(child); } } + + if (rmContainerCacheManager != null) + { + rmContainerCacheManager.add(child); + } } return null; } }); + } + /** + * Attempts to remove a deleted node from records management root cache + * + * @see org.alfresco.repo.node.NodeServicePolicies.OnDeleteAssociationPolicy#onDeleteAssociation(org.alfresco.service.cmr.repository.AssociationRef) + */ + @Override + @Behaviour + ( + kind = BehaviourKind.ASSOCIATION, + notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT + ) + public void onDeleteChildAssociation(ChildAssociationRef childAssocRef) + { + + AuthenticationUtil.runAsSystem(new RunAsWork() + { + @Override + public Void doWork() + { + // Get the elements of the deleted association + final NodeRef child = childAssocRef.getChildRef(); + + if (rmContainerCacheManager != null) + { + rmContainerCacheManager.remove(child); + } + + return null; + } + }); } /** diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java index 76b31f5250..c9f6e22ef4 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java @@ -39,6 +39,7 @@ import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService; import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean; import org.alfresco.module.org_alfresco_module_rm.search.RecordsManagementSearchService; +import org.alfresco.module.org_alfresco_module_rm.util.RMContainerCacheManager; import org.alfresco.repo.node.NodeServicePolicies; import org.alfresco.repo.policy.Behaviour.NotificationFrequency; import org.alfresco.repo.policy.annotation.Behaviour; @@ -73,7 +74,8 @@ public class RmSiteType extends BaseBehaviourBean implements NodeServicePolicies.OnCreateNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, NodeServicePolicies.BeforeDeleteNodePolicy, - NodeServicePolicies.OnCreateChildAssociationPolicy + NodeServicePolicies.OnCreateChildAssociationPolicy, + NodeServicePolicies.OnDeleteChildAssociationPolicy { /** Constant values */ public static final String COMPONENT_DOCUMENT_LIBRARY = "documentLibrary"; @@ -95,6 +97,9 @@ public class RmSiteType extends BaseBehaviourBean private FilePlanType filePlanType; + /** RM container cache manager **/ + private RMContainerCacheManager rmContainerCacheManager; + /** Map of file plan type's key'ed by corresponding site types */ protected Map mapFilePlanType = new HashMap<>(3); @@ -105,7 +110,7 @@ public class RmSiteType extends BaseBehaviourBean public void setSiteService(SiteService siteService) { this.siteService = siteService; - } + } /** * @param recordsManagementSearchService records management search service @@ -136,6 +141,15 @@ public class RmSiteType extends BaseBehaviourBean this.filePlanType = filePlanType; } + /** + * @param rmContainerCacheManager RM container cache manager + * + */ + public void setRmContainerCacheManager(RMContainerCacheManager rmContainerCacheManager) + { + this.rmContainerCacheManager = rmContainerCacheManager; + } + /** * Registers a file plan type for a specific site type. * @@ -310,6 +324,36 @@ public class RmSiteType extends BaseBehaviourBean } } + /** + * Handles site deletion in order to reset the records management root cache + * + * @param childAssocRef + * + * @see org.alfresco.repo.node.NodeServicePolicies.OnDeleteAssociationPolicy#onDeleteAssociation(org.alfresco.service.cmr.repository.AssociationRef) + */ + @Override + @Behaviour + ( + kind = BehaviourKind.ASSOCIATION + ) + public void onDeleteChildAssociation(ChildAssociationRef childAssocRef) + { + AuthenticationUtil.runAsSystem(new RunAsWork() + { + @Override + public Void doWork() + { + // Resets RM Container Cache Manager + if (rmContainerCacheManager != null) + { + rmContainerCacheManager.reset(); + } + + return null; + } + }); + } + /** * Add the limitation of creating only one rma:filePlan or one dod:filePlan depending on the type of rm site. * Let multiple cm:folder type be created under rm site. @@ -339,6 +383,13 @@ public class RmSiteType extends BaseBehaviourBean }); } + /** + * Handles the deletion node policy (alf:onDeleteNode), resetting the records management root cache + * and enabling file plan behavior as well + * + * @param childAssocRef + * @param isNodeArchived + */ @Behaviour ( kind = BehaviourKind.CLASS, @@ -347,6 +398,12 @@ public class RmSiteType extends BaseBehaviourBean ) public void onDeleteNodeOnCommit(ChildAssociationRef childAssocRef, boolean isNodeArchived) { + // Resets RM Container Cache Manager + if (rmContainerCacheManager != null) + { + rmContainerCacheManager.reset(); + } + filePlanType.enable(); } } diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/util/RMContainerCacheManager.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/util/RMContainerCacheManager.java new file mode 100644 index 0000000000..2517198e02 --- /dev/null +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/util/RMContainerCacheManager.java @@ -0,0 +1,162 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.module.org_alfresco_module_rm.util; + +import java.util.HashSet; +import java.util.Set; + +import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; +import org.alfresco.repo.cache.SimpleCache; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.cmr.repository.StoreRef; +import org.alfresco.service.namespace.QName; +import org.alfresco.util.Pair; + +/** + * Provides operations to manipulate the records management root cache + * + * @author Tiago Salvado + * + * @see RecordsManagementModel + */ +public class RMContainerCacheManager implements RecordsManagementModel +{ + /** node service */ + private NodeService nodeService; + + /** root records management cache */ + private SimpleCache, Set> cache; + + /** + * @param nodeService + * node service + */ + public void setNodeService(NodeService nodeService) + { + this.nodeService = nodeService; + } + + /** + * @param cache + */ + public void setCache(SimpleCache, Set> cache) + { + this.cache = cache; + } + + /** + * Verifies if there is cached nodes for supplied storeRef + * + * @param storeRef + * @return true if there are cached nodes, false otherwise + */ + public boolean isCached(StoreRef storeRef) + { + return cache.contains(getKey(storeRef)); + } + + /** + * Obtains the cached nodes for supplied storeRef + * + * @param storeRef + * @return a set containing the cached nodes + */ + public Set get(StoreRef storeRef) + { + return cache.get(getKey(storeRef)); + } + + /** + * Caches the supplied node + * + * @param nodeRef + */ + public void add(NodeRef nodeRef) + { + if (nodeRef != null && nodeService.hasAspect(nodeRef, ASPECT_RECORDS_MANAGEMENT_ROOT)) + { + Set entries; + Pair key = getKey(nodeRef.getStoreRef()); + + if (cache.contains(key)) + { + entries = this.cache.get(key); + } + else + { + entries = new HashSet<>(); + } + + if (!entries.contains(nodeRef)) + { + entries.add(nodeRef); + } + + cache.put(key, entries); + } + } + + /** + * Removes the supplied entry from the cache + * + * @param nodeRef + */ + public void remove(NodeRef nodeRef) + { + if (nodeRef != null) + { + if (nodeService.hasAspect(nodeRef, ASPECT_RECORDS_MANAGEMENT_ROOT)) + { + Pair key = getKey(nodeRef.getStoreRef()); + if (cache.contains(key)) + { + cache.get(key).remove(nodeRef); + } + } + } + } + + /** + * Resets the cache entries + */ + public void reset() + { + this.cache.clear(); + } + + /** + * Builds the cache key using the supplied storeRef + * + * @param storeRef + * @return a pair corresponding to the cache key + */ + private Pair getKey(StoreRef storeRef) + { + return new Pair(storeRef, ASPECT_RECORDS_MANAGEMENT_ROOT.toString()); + } +} diff --git a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/util/BaseRMTestCase.java b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/util/BaseRMTestCase.java index a8b31ff55e..1d81ab517c 100644 --- a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/util/BaseRMTestCase.java +++ b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/util/BaseRMTestCase.java @@ -57,6 +57,7 @@ import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService; import org.alfresco.module.org_alfresco_module_rm.search.RecordsManagementSearchService; import org.alfresco.module.org_alfresco_module_rm.security.ExtendedSecurityService; import org.alfresco.module.org_alfresco_module_rm.security.FilePlanPermissionService; +import org.alfresco.module.org_alfresco_module_rm.util.RMContainerCacheManager; import org.alfresco.module.org_alfresco_module_rm.vital.VitalRecordService; import org.alfresco.repo.policy.BehaviourFilter; import org.alfresco.repo.policy.PolicyComponent; @@ -173,6 +174,9 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase protected InplaceRecordService inplaceRecordService; protected RelationshipService relationshipService; + /** RM Container Cache Manager */ + protected RMContainerCacheManager rmContainerCacheManager; + /** test utils */ protected UserAndGroupsUtils userAndGroupsUtils; @@ -424,6 +428,9 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase holdService = (HoldService) applicationContext.getBean("HoldService"); inplaceRecordService = (InplaceRecordService) applicationContext.getBean("InplaceRecordService"); relationshipService = (RelationshipService) applicationContext.getBean("RelationshipService"); + + // RM Container Cache Manager + rmContainerCacheManager = (RMContainerCacheManager) applicationContext.getBean("rmContainerCacheManager"); } /** @@ -484,6 +491,11 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase { siteService.deleteSite(collabSiteId); } + + if (rmContainerCacheManager != null) + { + rmContainerCacheManager.reset(); + } } finally { @@ -936,7 +948,7 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase public void then() throws Exception { /** empty implementation */ } public void after() throws Exception { /** empty implementation */ } - + public void run() throws Exception { try From b7a62c8bff7121192f0ed8f44facc18d54ea6328 Mon Sep 17 00:00:00 2001 From: tiagos Date: Tue, 20 Oct 2020 11:44:10 +0100 Subject: [PATCH 2/9] [RM-7162] Added validations to prevent having a cached empty set (cherry picked from commit 1d8747ebe0927601b98cd4bf9eb22322c8c1a088) --- .../util/RMContainerCacheManager.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/util/RMContainerCacheManager.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/util/RMContainerCacheManager.java index 2517198e02..844863f61b 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/util/RMContainerCacheManager.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/util/RMContainerCacheManager.java @@ -34,7 +34,6 @@ import org.alfresco.repo.cache.SimpleCache; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.StoreRef; -import org.alfresco.service.namespace.QName; import org.alfresco.util.Pair; /** @@ -77,7 +76,17 @@ public class RMContainerCacheManager implements RecordsManagementModel */ public boolean isCached(StoreRef storeRef) { - return cache.contains(getKey(storeRef)); + boolean isCached = true; + Pair key = getKey(storeRef); + Set values = cache.get(key); + if (values == null || values.size() == 0) + { + if (values != null) { + cache.remove(key); + } + isCached = false; + } + return isCached; } /** @@ -117,7 +126,10 @@ public class RMContainerCacheManager implements RecordsManagementModel entries.add(nodeRef); } - cache.put(key, entries); + if (entries.size() > 0) + { + cache.put(key, entries); + } } } @@ -136,6 +148,9 @@ public class RMContainerCacheManager implements RecordsManagementModel if (cache.contains(key)) { cache.get(key).remove(nodeRef); + if (cache.get(key).size() == 0) { + cache.remove(key); + } } } } From 1f348ca599e5a96540713fdd4885d66bdb88a12d Mon Sep 17 00:00:00 2001 From: tiagos Date: Tue, 20 Oct 2020 22:00:05 +0100 Subject: [PATCH 3/9] [RM-7162] Changed isCached flag logic. Code formatting. (cherry picked from commit e385b5ae17b24da5645d8c2961b645b4402d056d) --- .../util/RMContainerCacheManager.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/util/RMContainerCacheManager.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/util/RMContainerCacheManager.java index 844863f61b..781edb5b7b 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/util/RMContainerCacheManager.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/util/RMContainerCacheManager.java @@ -76,15 +76,12 @@ public class RMContainerCacheManager implements RecordsManagementModel */ public boolean isCached(StoreRef storeRef) { - boolean isCached = true; Pair key = getKey(storeRef); Set values = cache.get(key); - if (values == null || values.size() == 0) + boolean isCached = (values != null && !values.isEmpty()); + if (!isCached) { - if (values != null) { - cache.remove(key); - } - isCached = false; + cache.remove(key); } return isCached; } @@ -128,7 +125,7 @@ public class RMContainerCacheManager implements RecordsManagementModel if (entries.size() > 0) { - cache.put(key, entries); + cache.put(key, entries); } } } @@ -148,7 +145,8 @@ public class RMContainerCacheManager implements RecordsManagementModel if (cache.contains(key)) { cache.get(key).remove(nodeRef); - if (cache.get(key).size() == 0) { + if (cache.get(key).size() == 0) + { cache.remove(key); } } From ac1a141b80a7f0af7605a6a8ee3a6a8c8fc7e898 Mon Sep 17 00:00:00 2001 From: alfresco-build Date: Fri, 23 Oct 2020 14:35:44 +0100 Subject: [PATCH 4/9] [maven-release-plugin] prepare release V3.3.0.2 --- pom.xml | 4 ++-- rm-automation/pom.xml | 2 +- rm-automation/rm-automation-community-rest-api/pom.xml | 2 +- rm-community/pom.xml | 2 +- rm-community/rm-community-repo/pom.xml | 2 +- rm-community/rm-community-rest-api-explorer/pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 2f68a47086..94f0c31301 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.alfresco alfresco-governance-services pom - 3.3.0.2-SNAPSHOT + 3.3.0.2 Alfresco Governance Services http://www.alfresco.org/ @@ -18,7 +18,7 @@ scm:git:ssh://git@github.com/Alfresco/governance-services.git scm:git:ssh://git@github.com/Alfresco/governance-services.git scm:git:ssh://git@github.com/Alfresco/governance-services.git - HEAD + V3.3.0.2 diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index 2e850071db..21dec77637 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services - 3.3.0.2-SNAPSHOT + 3.3.0.2 diff --git a/rm-automation/rm-automation-community-rest-api/pom.xml b/rm-automation/rm-automation-community-rest-api/pom.xml index d32a0e6c8e..c075d7e364 100644 --- a/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/rm-automation/rm-automation-community-rest-api/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services-automation - 3.3.0.2-SNAPSHOT + 3.3.0.2 diff --git a/rm-community/pom.xml b/rm-community/pom.xml index 82d8550024..88246329e5 100644 --- a/rm-community/pom.xml +++ b/rm-community/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services - 3.3.0.2-SNAPSHOT + 3.3.0.2 diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index 15848f849a..d5c0928ff9 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-governance-services-community - 3.3.0.2-SNAPSHOT + 3.3.0.2 diff --git a/rm-community/rm-community-rest-api-explorer/pom.xml b/rm-community/rm-community-rest-api-explorer/pom.xml index b25aa0fce2..d277264638 100644 --- a/rm-community/rm-community-rest-api-explorer/pom.xml +++ b/rm-community/rm-community-rest-api-explorer/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community - 3.3.0.2-SNAPSHOT + 3.3.0.2 From db48a45892e9185dcdb07b6bb13220c116b70b4d Mon Sep 17 00:00:00 2001 From: alfresco-build Date: Fri, 23 Oct 2020 14:35:55 +0100 Subject: [PATCH 5/9] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- rm-automation/pom.xml | 2 +- rm-automation/rm-automation-community-rest-api/pom.xml | 2 +- rm-community/pom.xml | 2 +- rm-community/rm-community-repo/pom.xml | 2 +- rm-community/rm-community-rest-api-explorer/pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 94f0c31301..66d521cdb5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.alfresco alfresco-governance-services pom - 3.3.0.2 + 3.3.0.3-SNAPSHOT Alfresco Governance Services http://www.alfresco.org/ @@ -18,7 +18,7 @@ scm:git:ssh://git@github.com/Alfresco/governance-services.git scm:git:ssh://git@github.com/Alfresco/governance-services.git scm:git:ssh://git@github.com/Alfresco/governance-services.git - V3.3.0.2 + HEAD diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index 21dec77637..2535eb5d49 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services - 3.3.0.2 + 3.3.0.3-SNAPSHOT diff --git a/rm-automation/rm-automation-community-rest-api/pom.xml b/rm-automation/rm-automation-community-rest-api/pom.xml index c075d7e364..03487fb636 100644 --- a/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/rm-automation/rm-automation-community-rest-api/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services-automation - 3.3.0.2 + 3.3.0.3-SNAPSHOT diff --git a/rm-community/pom.xml b/rm-community/pom.xml index 88246329e5..4b68b1959d 100644 --- a/rm-community/pom.xml +++ b/rm-community/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services - 3.3.0.2 + 3.3.0.3-SNAPSHOT diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index d5c0928ff9..27c470e982 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-governance-services-community - 3.3.0.2 + 3.3.0.3-SNAPSHOT diff --git a/rm-community/rm-community-rest-api-explorer/pom.xml b/rm-community/rm-community-rest-api-explorer/pom.xml index d277264638..90ff3bdb51 100644 --- a/rm-community/rm-community-rest-api-explorer/pom.xml +++ b/rm-community/rm-community-rest-api-explorer/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community - 3.3.0.2 + 3.3.0.3-SNAPSHOT From 89f9c991de6e11e474760698af70d6cf8c434ec5 Mon Sep 17 00:00:00 2001 From: alfresco-build Date: Fri, 23 Oct 2020 20:48:01 +0100 Subject: [PATCH 6/9] [maven-release-plugin] prepare release V3.3.0.3 --- pom.xml | 4 ++-- rm-automation/pom.xml | 2 +- rm-automation/rm-automation-community-rest-api/pom.xml | 2 +- rm-community/pom.xml | 2 +- rm-community/rm-community-repo/pom.xml | 2 +- rm-community/rm-community-rest-api-explorer/pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 66d521cdb5..92f4c2d56c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.alfresco alfresco-governance-services pom - 3.3.0.3-SNAPSHOT + 3.3.0.3 Alfresco Governance Services http://www.alfresco.org/ @@ -18,7 +18,7 @@ scm:git:ssh://git@github.com/Alfresco/governance-services.git scm:git:ssh://git@github.com/Alfresco/governance-services.git scm:git:ssh://git@github.com/Alfresco/governance-services.git - HEAD + V3.3.0.3 diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index 2535eb5d49..eb818063d9 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services - 3.3.0.3-SNAPSHOT + 3.3.0.3 diff --git a/rm-automation/rm-automation-community-rest-api/pom.xml b/rm-automation/rm-automation-community-rest-api/pom.xml index 03487fb636..d76fc6a2a2 100644 --- a/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/rm-automation/rm-automation-community-rest-api/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services-automation - 3.3.0.3-SNAPSHOT + 3.3.0.3 diff --git a/rm-community/pom.xml b/rm-community/pom.xml index 4b68b1959d..f8c4024724 100644 --- a/rm-community/pom.xml +++ b/rm-community/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services - 3.3.0.3-SNAPSHOT + 3.3.0.3 diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index 27c470e982..ba9aba6668 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-governance-services-community - 3.3.0.3-SNAPSHOT + 3.3.0.3 diff --git a/rm-community/rm-community-rest-api-explorer/pom.xml b/rm-community/rm-community-rest-api-explorer/pom.xml index 90ff3bdb51..50dc7a12fb 100644 --- a/rm-community/rm-community-rest-api-explorer/pom.xml +++ b/rm-community/rm-community-rest-api-explorer/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community - 3.3.0.3-SNAPSHOT + 3.3.0.3 From 9004ebd9f6160842b77fd9969dac15581ac4b220 Mon Sep 17 00:00:00 2001 From: alfresco-build Date: Fri, 23 Oct 2020 20:48:12 +0100 Subject: [PATCH 7/9] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- rm-automation/pom.xml | 2 +- rm-automation/rm-automation-community-rest-api/pom.xml | 2 +- rm-community/pom.xml | 2 +- rm-community/rm-community-repo/pom.xml | 2 +- rm-community/rm-community-rest-api-explorer/pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 92f4c2d56c..1b5911abaa 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.alfresco alfresco-governance-services pom - 3.3.0.3 + 3.3.0.4-SNAPSHOT Alfresco Governance Services http://www.alfresco.org/ @@ -18,7 +18,7 @@ scm:git:ssh://git@github.com/Alfresco/governance-services.git scm:git:ssh://git@github.com/Alfresco/governance-services.git scm:git:ssh://git@github.com/Alfresco/governance-services.git - V3.3.0.3 + HEAD diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index eb818063d9..65676a584e 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services - 3.3.0.3 + 3.3.0.4-SNAPSHOT diff --git a/rm-automation/rm-automation-community-rest-api/pom.xml b/rm-automation/rm-automation-community-rest-api/pom.xml index d76fc6a2a2..aa35774364 100644 --- a/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/rm-automation/rm-automation-community-rest-api/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services-automation - 3.3.0.3 + 3.3.0.4-SNAPSHOT diff --git a/rm-community/pom.xml b/rm-community/pom.xml index f8c4024724..581ab685a8 100644 --- a/rm-community/pom.xml +++ b/rm-community/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services - 3.3.0.3 + 3.3.0.4-SNAPSHOT diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index ba9aba6668..c3c377cd48 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-governance-services-community - 3.3.0.3 + 3.3.0.4-SNAPSHOT diff --git a/rm-community/rm-community-rest-api-explorer/pom.xml b/rm-community/rm-community-rest-api-explorer/pom.xml index 50dc7a12fb..2e31b7a75a 100644 --- a/rm-community/rm-community-rest-api-explorer/pom.xml +++ b/rm-community/rm-community-rest-api-explorer/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community - 3.3.0.3 + 3.3.0.4-SNAPSHOT From 5bda402f21aabcb49918cd3b0d2406a033e70a26 Mon Sep 17 00:00:00 2001 From: alfresco-build Date: Mon, 26 Oct 2020 13:20:41 +0000 Subject: [PATCH 8/9] [maven-release-plugin] prepare release V3.3.0.4 --- pom.xml | 4 ++-- rm-automation/pom.xml | 2 +- rm-automation/rm-automation-community-rest-api/pom.xml | 2 +- rm-community/pom.xml | 2 +- rm-community/rm-community-repo/pom.xml | 2 +- rm-community/rm-community-rest-api-explorer/pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 1b5911abaa..4edc21e953 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.alfresco alfresco-governance-services pom - 3.3.0.4-SNAPSHOT + 3.3.0.4 Alfresco Governance Services http://www.alfresco.org/ @@ -18,7 +18,7 @@ scm:git:ssh://git@github.com/Alfresco/governance-services.git scm:git:ssh://git@github.com/Alfresco/governance-services.git scm:git:ssh://git@github.com/Alfresco/governance-services.git - HEAD + V3.3.0.4 diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index 65676a584e..3999ce7269 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services - 3.3.0.4-SNAPSHOT + 3.3.0.4 diff --git a/rm-automation/rm-automation-community-rest-api/pom.xml b/rm-automation/rm-automation-community-rest-api/pom.xml index aa35774364..ebc3cfb943 100644 --- a/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/rm-automation/rm-automation-community-rest-api/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services-automation - 3.3.0.4-SNAPSHOT + 3.3.0.4 diff --git a/rm-community/pom.xml b/rm-community/pom.xml index 581ab685a8..b4651df5cd 100644 --- a/rm-community/pom.xml +++ b/rm-community/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services - 3.3.0.4-SNAPSHOT + 3.3.0.4 diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index c3c377cd48..9c5edf4ada 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-governance-services-community - 3.3.0.4-SNAPSHOT + 3.3.0.4 diff --git a/rm-community/rm-community-rest-api-explorer/pom.xml b/rm-community/rm-community-rest-api-explorer/pom.xml index 2e31b7a75a..6eebef0fb8 100644 --- a/rm-community/rm-community-rest-api-explorer/pom.xml +++ b/rm-community/rm-community-rest-api-explorer/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community - 3.3.0.4-SNAPSHOT + 3.3.0.4 From 3fac7fe6769571df3785cacac8ab2a926b75f87d Mon Sep 17 00:00:00 2001 From: alfresco-build Date: Mon, 26 Oct 2020 13:20:53 +0000 Subject: [PATCH 9/9] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- rm-automation/pom.xml | 2 +- rm-automation/rm-automation-community-rest-api/pom.xml | 2 +- rm-community/pom.xml | 2 +- rm-community/rm-community-repo/pom.xml | 2 +- rm-community/rm-community-rest-api-explorer/pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 4edc21e953..d01bd3099e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.alfresco alfresco-governance-services pom - 3.3.0.4 + 3.3.0.5-SNAPSHOT Alfresco Governance Services http://www.alfresco.org/ @@ -18,7 +18,7 @@ scm:git:ssh://git@github.com/Alfresco/governance-services.git scm:git:ssh://git@github.com/Alfresco/governance-services.git scm:git:ssh://git@github.com/Alfresco/governance-services.git - V3.3.0.4 + HEAD diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index 3999ce7269..947a5f72ac 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services - 3.3.0.4 + 3.3.0.5-SNAPSHOT diff --git a/rm-automation/rm-automation-community-rest-api/pom.xml b/rm-automation/rm-automation-community-rest-api/pom.xml index ebc3cfb943..943e2aad56 100644 --- a/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/rm-automation/rm-automation-community-rest-api/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services-automation - 3.3.0.4 + 3.3.0.5-SNAPSHOT diff --git a/rm-community/pom.xml b/rm-community/pom.xml index b4651df5cd..e787b12c3d 100644 --- a/rm-community/pom.xml +++ b/rm-community/pom.xml @@ -8,7 +8,7 @@ org.alfresco alfresco-governance-services - 3.3.0.4 + 3.3.0.5-SNAPSHOT diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index 9c5edf4ada..b2ae72471e 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -9,7 +9,7 @@ org.alfresco alfresco-governance-services-community - 3.3.0.4 + 3.3.0.5-SNAPSHOT diff --git a/rm-community/rm-community-rest-api-explorer/pom.xml b/rm-community/rm-community-rest-api-explorer/pom.xml index 6eebef0fb8..6bb22a6609 100644 --- a/rm-community/rm-community-rest-api-explorer/pom.xml +++ b/rm-community/rm-community-rest-api-explorer/pom.xml @@ -7,7 +7,7 @@ org.alfresco alfresco-governance-services-community - 3.3.0.4 + 3.3.0.5-SNAPSHOT