From ae171d5008fbffdfeda7f19c91b257e781f8d408 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Tue, 2 Jun 2015 10:20:37 +0000 Subject: [PATCH] Rename ClassificationService to ClassificationSchemeService. Also rename ClassificationServiceException to ClassificationException. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@105317 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../classified-content-context.xml | 38 +++++++++---------- ...tion.java => ClassificationException.java} | 20 +++++----- .../ClassificationLevelConstraint.java | 14 +++---- .../ClassificationLevelManager.java | 2 +- .../ClassificationReasonManager.java | 2 +- ....java => ClassificationSchemeService.java} | 12 +++--- ...a => ClassificationSchemeServiceImpl.java} | 12 +++--- ... ClassificationSchemeServiceProvider.java} | 28 +++++++------- .../ClassificationServiceBootstrap.java | 2 +- .../ClassificationServiceDAO.java | 2 +- .../classification/ClearanceLevelManager.java | 2 +- .../ContentClassificationService.java | 6 +-- .../ContentClassificationServiceImpl.java | 4 +- .../SecurityClearanceServiceImpl.java | 2 +- .../classification/package-info.java | 2 +- .../RecordsManagementNodeFormFilter.java | 30 +++++++-------- .../ClassificationLevelsGet.java | 16 ++++---- .../script/classification/ReasonsGet.java | 16 ++++---- .../UserSecurityClearancePut.java | 4 +- .../ClassificationLevelsTest.java | 4 +- .../ClassificationReasonsTest.java | 17 ++++----- .../classification/ClassifyTest.java | 2 +- .../classification/SecurityClearanceTest.java | 2 +- .../test/util/BaseRMTestCase.java | 8 ++-- ...ClassificationLevelConstraintUnitTest.java | 4 +- .../ClassificationLevelManagerUnitTest.java | 10 ++--- .../ClassificationReasonManagerUnitTest.java | 2 +- ...ssificationSchemeServiceImplUnitTest.java} | 22 +++++------ ...lassificationServiceBootstrapUnitTest.java | 2 +- .../ClassificationServiceDAOUnitTest.java | 4 +- .../ClearanceLevelManagerUnitTest.java | 2 +- ...tentClassificationServiceImplUnitTest.java | 4 +- .../SecurityClearanceServiceImplUnitTest.java | 6 +-- .../ClassificationLevelsGetUnitTest.java | 6 +-- .../classification/ReasonsGetUnitTest.java | 6 +-- .../UserSecurityClearancePutUnitTest.java | 6 +-- 36 files changed, 160 insertions(+), 161 deletions(-) rename rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/{ClassificationServiceException.java => ClassificationException.java} (81%) rename rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/{ClassificationService.java => ClassificationSchemeService.java} (86%) rename rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/{ClassificationServiceImpl.java => ClassificationSchemeServiceImpl.java} (90%) rename rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/{ClassificationServiceProvider.java => ClassificationSchemeServiceProvider.java} (53%) rename rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/{ClassificationServiceImplUnitTest.java => ClassificationSchemeServiceImplUnitTest.java} (86%) diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/classified-content-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/classified-content-context.xml index c07153d8e1..cff254ead0 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/classified-content-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/classified-content-context.xml @@ -35,32 +35,32 @@ - + - - + - org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService + org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService - + - + - + - + @@ -71,22 +71,22 @@ - - + + - org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService.getClassificationLevels=ACL_ALLOW - org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService.getClassificationReasons=ACL_ALLOW - org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService.getClassificationLevelById=ACL_ALLOW - org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService.getClassificationReasonById=ACL_ALLOW - org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService.getUnclassifiedClassificationLevel=ACL_ALLOW - org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService.*=ACL_DENY + org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService.getClassificationLevels=ACL_ALLOW + org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService.getClassificationReasons=ACL_ALLOW + org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService.getClassificationLevelById=ACL_ALLOW + org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService.getClassificationReasonById=ACL_ALLOW + org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService.getUnclassifiedClassificationLevel=ACL_ALLOW + org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService.*=ACL_DENY - - + + String instances, but may * represent non-String values. It is up to the caller to distinguish. - * + * * @return Returns the values allowed */ private List getAllowedValues() { - List classificationLevels = classificationService.getClassificationLevels(); + List classificationLevels = classificationSchemeService.getClassificationLevels(); List values = new ArrayList(); for (ClassificationLevel classificationLevel : classificationLevels) { diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationLevelManager.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationLevelManager.java index 26f92dce3a..668eb6a7a8 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationLevelManager.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationLevelManager.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.List; import com.google.common.collect.ImmutableList; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.LevelIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.LevelIdNotFound; /** * Container for the configured {@link ClassificationLevel} objects. diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationReasonManager.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationReasonManager.java index ab4972e982..e03babdf66 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationReasonManager.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationReasonManager.java @@ -21,7 +21,7 @@ package org.alfresco.module.org_alfresco_module_rm.classification; import java.util.Collection; import com.google.common.collect.ImmutableList; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.ReasonIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.ReasonIdNotFound; /** * Container for the configured {@link ClassificationReason} objects. diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationService.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationSchemeService.java similarity index 86% rename from rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationService.java rename to rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationSchemeService.java index d80b75cf90..d04eb11448 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationService.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationSchemeService.java @@ -20,18 +20,18 @@ package org.alfresco.module.org_alfresco_module_rm.classification; import java.util.List; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.LevelIdNotFound; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.ReasonIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.LevelIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.ReasonIdNotFound; /** - * The Classification Service supports the 'Classified Records' feature, whereby Alfresco - * content can be given a {@link ClassificationLevel}. This restricts access to that - * content to users having the appropriate security clearance. + * The Classification Scheme Service supports the 'Classified Records' feature, whereby Alfresco content can be given a + * {@link ClassificationLevel}. This restricts access to that content to users having the appropriate security + * clearance. * * @author Neil Mc Erlean * @since 3.0 */ -public interface ClassificationService +public interface ClassificationSchemeService { /** * Returns an immutable list of the defined classification levels visible to the current user. diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationSchemeServiceImpl.java similarity index 90% rename from rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceImpl.java rename to rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationSchemeServiceImpl.java index ec2ce30787..a80888aaf4 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceImpl.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationSchemeServiceImpl.java @@ -23,8 +23,8 @@ import static org.alfresco.module.org_alfresco_module_rm.util.RMParameterCheck.c import java.util.Collections; import java.util.List; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.LevelIdNotFound; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.ReasonIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.LevelIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.ReasonIdNotFound; import org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel; import org.alfresco.module.org_alfresco_module_rm.util.ServiceBaseImpl; import org.alfresco.service.cmr.repository.NodeService; @@ -33,8 +33,8 @@ import org.alfresco.service.cmr.repository.NodeService; * @author Neil Mc Erlean * @since 3.0 */ -public class ClassificationServiceImpl extends ServiceBaseImpl - implements ClassificationService, ClassifiedContentModel +public class ClassificationSchemeServiceImpl extends ServiceBaseImpl implements ClassificationSchemeService, + ClassifiedContentModel { /** The classification levels currently configured in this server. */ private ClassificationLevelManager levelManager; @@ -94,7 +94,7 @@ public class ClassificationServiceImpl extends ServiceBaseImpl } /** - * @see org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService#getClassificationLevelById(java.lang.String) + * @see org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService#getClassificationLevelById(java.lang.String) */ @Override public ClassificationLevel getClassificationLevelById(String classificationLevelId) throws LevelIdNotFound @@ -104,7 +104,7 @@ public class ClassificationServiceImpl extends ServiceBaseImpl } /** - * @see org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService#getClassificationReasonById(java.lang.String) + * @see org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService#getClassificationReasonById(java.lang.String) */ @Override public ClassificationReason getClassificationReasonById(String classificationReasonId) throws ReasonIdNotFound diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceProvider.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationSchemeServiceProvider.java similarity index 53% rename from rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceProvider.java rename to rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationSchemeServiceProvider.java index 7e55c2d032..142ae08066 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceProvider.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationSchemeServiceProvider.java @@ -26,34 +26,34 @@ import org.slf4j.LoggerFactory; /** - * A Spring class used to provide the {@link ClassificationService} to non-Spring classes. - * + * A Spring class used to provide the {@link ClassificationSchemeService} to non-Spring classes. + * * @author tpage */ -public class ClassificationServiceProvider +public class ClassificationSchemeServiceProvider { /** Logging utility for the class. */ - private static final Logger LOGGER = LoggerFactory.getLogger(ClassificationServiceProvider.class); + private static final Logger LOGGER = LoggerFactory.getLogger(ClassificationSchemeServiceProvider.class); /** The Spring application context. */ - private static final AtomicReference CLASSIFICATION_SERVICE_REF = new AtomicReference<>(); + private static final AtomicReference CLASSIFICATION_SCHEME_SERVICE_REF = new AtomicReference<>(); - /** Constructor that takes the classification service and makes it available statically. */ - public ClassificationServiceProvider(ClassificationService classificationService) + /** Constructor that takes the classification scheme service and makes it available statically. */ + public ClassificationSchemeServiceProvider(ClassificationSchemeService classificationSchemeService) { - ClassificationService oldClassificationService = CLASSIFICATION_SERVICE_REF.getAndSet(classificationService); - if (oldClassificationService != null) + ClassificationSchemeService oldClassificationSchemeService = CLASSIFICATION_SCHEME_SERVICE_REF.getAndSet(classificationSchemeService); + if (oldClassificationSchemeService != null) { - LOGGER.debug("Unexpected instantiation of ClassificationServiceProvider has updated reference to classification service."); + LOGGER.debug("Unexpected instantiation of ClassificationSchemeServiceProvider has updated reference to classification scheme service."); } } /** - * Get the ClassificationService as defined in the Spring context. - * + * Get the ClassificationSchemeService as defined in the Spring context. + * * @return The service bean. */ - public static ClassificationService getClassificationService() + public static ClassificationSchemeService getClassificationSchemeService() { - return CLASSIFICATION_SERVICE_REF.get(); + return CLASSIFICATION_SCHEME_SERVICE_REF.get(); } } diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceBootstrap.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceBootstrap.java index 42c3782823..0070dd882b 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceBootstrap.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceBootstrap.java @@ -23,7 +23,7 @@ import java.util.ArrayList; import java.util.List; import com.google.common.collect.ImmutableList; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.MissingConfiguration; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.MissingConfiguration; import org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel; import org.alfresco.module.org_alfresco_module_rm.util.AuthenticationUtil; import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork; diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceDAO.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceDAO.java index 46e0e54222..75469834b9 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceDAO.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceDAO.java @@ -24,7 +24,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.MalformedConfiguration; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.MalformedConfiguration; import org.apache.commons.io.IOUtils; import org.json.JSONArray; import org.json.JSONException; diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClearanceLevelManager.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClearanceLevelManager.java index 5ab1092fcc..197d1bc49a 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClearanceLevelManager.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ClearanceLevelManager.java @@ -21,7 +21,7 @@ package org.alfresco.module.org_alfresco_module_rm.classification; import java.util.List; import com.google.common.collect.ImmutableList; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.LevelIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.LevelIdNotFound; /** * Container for the configured {@link ClearanceLevel} objects. diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationService.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationService.java index f0813bc758..27a606d963 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationService.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationService.java @@ -20,9 +20,9 @@ package org.alfresco.module.org_alfresco_module_rm.classification; import java.util.Set; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.InvalidNode; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.LevelIdNotFound; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.ReasonIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.InvalidNode; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.LevelIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.ReasonIdNotFound; import org.alfresco.service.cmr.repository.InvalidNodeRefException; import org.alfresco.service.cmr.repository.NodeRef; diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationServiceImpl.java index 222eb8e500..8cc47675db 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationServiceImpl.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationServiceImpl.java @@ -29,8 +29,8 @@ import java.util.Set; import org.alfresco.model.ContentModel; import org.alfresco.model.QuickShareModel; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.InvalidNode; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.LevelIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.InvalidNode; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.LevelIdNotFound; import org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel; import org.alfresco.module.org_alfresco_module_rm.util.ServiceBaseImpl; import org.alfresco.service.cmr.dictionary.DictionaryService; diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/SecurityClearanceServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/SecurityClearanceServiceImpl.java index 076d0ba220..1d6b7dea27 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/SecurityClearanceServiceImpl.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/SecurityClearanceServiceImpl.java @@ -25,7 +25,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.LevelIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.LevelIdNotFound; import org.alfresco.module.org_alfresco_module_rm.util.ServiceBaseImpl; import org.alfresco.query.PagingRequest; import org.alfresco.query.PagingResults; diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/package-info.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/package-info.java index 1def2a1185..8ea1ae7681 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/package-info.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/package-info.java @@ -22,7 +22,7 @@ * Nodes within Alfresco can be given a {@link org.alfresco.module.org_alfresco_module_rm.classification.ClassificationLevel} * which then restricts access to them to users having the appropriate clearance. *

- * The {@link org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService} is responsible + * The {@link org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService} is responsible * for the management of those levels and it is the * {@link org.alfresco.module.org_alfresco_module_rm.classification.SecurityClearanceService} which deals * wth users and their clearances. diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/forms/RecordsManagementNodeFormFilter.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/forms/RecordsManagementNodeFormFilter.java index ddc411c2f6..71c1fe0803 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/forms/RecordsManagementNodeFormFilter.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/forms/RecordsManagementNodeFormFilter.java @@ -29,7 +29,7 @@ import java.util.Set; import org.alfresco.model.ContentModel; import org.alfresco.model.ImapModel; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService; import org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel; import org.alfresco.module.org_alfresco_module_rm.compatibility.CompatibilityModel; import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule; @@ -85,8 +85,8 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter /** File Plan Service */ private FilePlanService filePlanService; - /** Classification Service */ - private ClassificationService classificationService; + /** Classification Scheme Service */ + private ClassificationSchemeService classificationSchemeService; /** * Returns the disposition service @@ -109,13 +109,13 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter } /** - * Returns the classification service + * Returns the classification scheme service * - * @return Classification service + * @return Classification scheme service */ - protected ClassificationService getClassificationService() + protected ClassificationSchemeService getClassificationSchemeService() { - return this.classificationService; + return this.classificationSchemeService; } /** @@ -133,15 +133,15 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter */ public void setFilePlanService(FilePlanService filePlanService) { - this.filePlanService = filePlanService; - } + this.filePlanService = filePlanService; + } /** - * @param classificationService classification service + * @param classificationSchemeService classification scheme service */ - public void setClassificationService(ClassificationService classificationService) + public void setClassificationSchemeService(ClassificationSchemeService classificationSchemeService) { - this.classificationService = classificationService; + this.classificationSchemeService = classificationSchemeService; } /** @@ -207,14 +207,14 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter String initialClassificationId = (String) nodeService.getProperty(nodeRef, ClassifiedContentModel.PROP_INITIAL_CLASSIFICATION); if (isNotBlank(initialClassificationId)) { - String initialClassificationDisplayLabel = getClassificationService().getClassificationLevelById(initialClassificationId).getDisplayLabel(); + String initialClassificationDisplayLabel = getClassificationSchemeService().getClassificationLevelById(initialClassificationId).getDisplayLabel(); addTransientPropertyField(form, TRANSIENT_INITIAL_CLASSIFICATION, DataTypeDefinition.TEXT, initialClassificationDisplayLabel); } String currentClassificationId = (String) nodeService.getProperty(nodeRef, ClassifiedContentModel.PROP_CURRENT_CLASSIFICATION); if (isNotBlank(currentClassificationId)) { - String currentClassificationDisplayLabel = getClassificationService().getClassificationLevelById(currentClassificationId).getDisplayLabel(); + String currentClassificationDisplayLabel = getClassificationSchemeService().getClassificationLevelById(currentClassificationId).getDisplayLabel(); addTransientPropertyField(form, TRANSIENT_CURRENT_CLASSIFICATION, DataTypeDefinition.TEXT, currentClassificationDisplayLabel); } @@ -227,7 +227,7 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter for (int i = 0; i < size; i++) { String id = classificationReasons.get(i); - String displayLabel = getClassificationService().getClassificationReasonById(id).getDisplayLabel(); + String displayLabel = getClassificationSchemeService().getClassificationReasonById(id).getDisplayLabel(); classificationReasonLabels.add(id + ": " + displayLabel + (i < size - 1 ? "|": "")); } addTransientPropertyField(form, TRANSIENT_CLASSIFICATION_REASON_LABELS, DataTypeDefinition.TEXT, classificationReasonLabels); diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ClassificationLevelsGet.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ClassificationLevelsGet.java index 12c3fd3743..355af00641 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ClassificationLevelsGet.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ClassificationLevelsGet.java @@ -21,7 +21,7 @@ package org.alfresco.module.org_alfresco_module_rm.script.classification; import java.util.HashMap; import java.util.Map; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService; import org.alfresco.module.org_alfresco_module_rm.script.AbstractRmWebScript; import org.springframework.extensions.webscripts.Cache; import org.springframework.extensions.webscripts.Status; @@ -38,17 +38,17 @@ public class ClassificationLevelsGet extends AbstractRmWebScript /** Constants */ private static final String LEVELS = "levels"; - /** Classification service */ - private ClassificationService classificationService; + /** Classification scheme service */ + private ClassificationSchemeService classificationSchemeService; /** - * Sets the classification service + * Sets the classification scheme service * - * @param classificatonService The classification service + * @param classificationSchemeService The classification scheme service */ - public void setClassificationService(ClassificationService classificationService) + public void setClassificationService(ClassificationSchemeService classificationSchemeService) { - this.classificationService = classificationService; + this.classificationSchemeService = classificationSchemeService; } /** @@ -60,7 +60,7 @@ public class ClassificationLevelsGet extends AbstractRmWebScript protected Map executeImpl(WebScriptRequest req, Status status, Cache cache) { Map result = new HashMap(); - result.put(LEVELS, classificationService.getClassificationLevels()); + result.put(LEVELS, classificationSchemeService.getClassificationLevels()); return result; } } diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ReasonsGet.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ReasonsGet.java index 478f582745..f42ed3dae3 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ReasonsGet.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ReasonsGet.java @@ -21,7 +21,7 @@ package org.alfresco.module.org_alfresco_module_rm.script.classification; import java.util.HashMap; import java.util.Map; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService; import org.alfresco.module.org_alfresco_module_rm.script.AbstractRmWebScript; import org.springframework.extensions.webscripts.Cache; import org.springframework.extensions.webscripts.Status; @@ -38,17 +38,17 @@ public class ReasonsGet extends AbstractRmWebScript /** Constants */ private static final String REASONS = "reasons"; - /** Classification service */ - private ClassificationService classificationService; + /** Classification scheme service */ + private ClassificationSchemeService classificationSchemeService; /** - * Sets the classification service + * Sets the classification scheme service * - * @param classificatonService The classification service + * @param classificationSchemeService The classification scheme service */ - public void setClassificationService(ClassificationService classificationService) + public void setClassificationService(ClassificationSchemeService classificationSchemeService) { - this.classificationService = classificationService; + this.classificationSchemeService = classificationSchemeService; } /** @@ -60,7 +60,7 @@ public class ReasonsGet extends AbstractRmWebScript protected Map executeImpl(WebScriptRequest req, Status status, Cache cache) { Map result = new HashMap(); - result.put(REASONS, classificationService.getClassificationReasons()); + result.put(REASONS, classificationSchemeService.getClassificationReasons()); return result; } } diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/classification/UserSecurityClearancePut.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/classification/UserSecurityClearancePut.java index 0895c275b2..bf7dfad10a 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/classification/UserSecurityClearancePut.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/script/classification/UserSecurityClearancePut.java @@ -18,7 +18,7 @@ */ package org.alfresco.module.org_alfresco_module_rm.script.classification; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException; import org.alfresco.module.org_alfresco_module_rm.classification.SecurityClearance; import org.alfresco.module.org_alfresco_module_rm.classification.SecurityClearanceService; import org.alfresco.module.org_alfresco_module_rm.script.AbstractRmWebScript; @@ -72,7 +72,7 @@ public class UserSecurityClearancePut extends AbstractRmWebScript securityClearance = securityClearanceService.setUserSecurityClearance(username, clearanceId); } - catch (ClassificationServiceException.LevelIdNotFound exception) + catch (ClassificationException.LevelIdNotFound exception) { throw new WebScriptException(Status.STATUS_BAD_REQUEST, "Unable to find clearance level"); } diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/ClassificationLevelsTest.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/ClassificationLevelsTest.java index 367d832edd..c00ee91eaa 100644 --- a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/ClassificationLevelsTest.java +++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/ClassificationLevelsTest.java @@ -62,7 +62,7 @@ public class ClassificationLevelsTest extends BaseRMTestCase public void then() throws Exception { - List levels = classificationService.getClassificationLevels(); + List levels = classificationSchemeService.getClassificationLevels(); assertNotNull(levels); assertEquals("Expected 5 levels to be configured (4 defined in the test plus Unclassified)", 5, levels.size()); @@ -80,7 +80,7 @@ public class ClassificationLevelsTest extends BaseRMTestCase assertEquals(level2.getId(), LEVEL2_ID); assertEquals(level3.getId(), LEVEL3_ID); assertEquals(level4.getId(), LEVEL4_ID); - + assertEquals(ClassificationLevelManager.UNCLASSIFIED, levels.get(4)); } }); diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/ClassificationReasonsTest.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/ClassificationReasonsTest.java index 118e165b02..b46e327a04 100644 --- a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/ClassificationReasonsTest.java +++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/ClassificationReasonsTest.java @@ -22,25 +22,24 @@ package org.alfresco.module.org_alfresco_module_rm.test.integration.classificati import java.util.List; import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationReason; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceImpl; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeServiceImpl; import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase; /** * Tests of classification reason handling. - * + * * @author tpage * @since 3.0 */ public class ClassificationReasonsTest extends BaseRMTestCase { /** - * Given the default classification reasons config file is on the classpath - * When the system has finished starting up + * Given the default classification reasons config file is on the classpath When the system has finished starting up * Then the classification service exposes the classification reasons. *

- * Note that this test requires a clean db, as otherwise the classification service will use the persisted - * classification reasons in preference to those given on the classpath (see the logic in {@link - * ClassificationServiceImpl#initConfiguredClassificationReasons()}). + * Note that this test requires a clean db, as otherwise the classification scheme service will use the persisted + * classification reasons in preference to those given on the classpath (see the logic in + * {@link ClassificationSchemeServiceImpl#initConfiguredClassificationReasons()}). */ public void testLoadBootstrappedClassificationReasons() throws Exception { @@ -58,8 +57,8 @@ public class ClassificationReasonsTest extends BaseRMTestCase public void then() throws Exception { - // Check the classification service exposes the classification reasons. - List reasons = classificationService.getClassificationReasons(); + // Check the classification scheme service exposes the classification reasons. + List reasons = classificationSchemeService.getClassificationReasons(); assertNotNull(reasons); assertEquals("The default classification reasons in test/resources/alfresco/module/" + "org_alfresco_module_rm/classification/rm-classification-reasons.json " diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/ClassifyTest.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/ClassifyTest.java index eaf8dd83f9..3d01841290 100644 --- a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/ClassifyTest.java +++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/ClassifyTest.java @@ -22,7 +22,7 @@ import java.util.Collections; import java.util.List; import com.google.common.collect.Sets; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.LevelIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.LevelIdNotFound; import org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel; import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService; import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase; diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/SecurityClearanceTest.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/SecurityClearanceTest.java index d0b72a8511..2b15367f30 100644 --- a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/SecurityClearanceTest.java +++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/classification/SecurityClearanceTest.java @@ -19,7 +19,7 @@ package org.alfresco.module.org_alfresco_module_rm.test.integration.classification; import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationLevel; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.LevelIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.LevelIdNotFound; import org.alfresco.module.org_alfresco_module_rm.classification.ClearanceLevel; import org.alfresco.module.org_alfresco_module_rm.classification.SecurityClearance; import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase; diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/util/BaseRMTestCase.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/util/BaseRMTestCase.java index aa727101cf..3a6cb4428d 100644 --- a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/util/BaseRMTestCase.java +++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/util/BaseRMTestCase.java @@ -29,8 +29,8 @@ import org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminSe import org.alfresco.module.org_alfresco_module_rm.audit.RecordsManagementAuditService; import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService; import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService; -import org.alfresco.module.org_alfresco_module_rm.classification.ContentClassificationService; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService; +import org.alfresco.module.org_alfresco_module_rm.classification.ContentClassificationService; import org.alfresco.module.org_alfresco_module_rm.classification.SecurityClearanceService; import org.alfresco.module.org_alfresco_module_rm.dataset.DataSetService; import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule; @@ -163,7 +163,7 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase protected HoldService holdService; protected InplaceRecordService inplaceRecordService; protected RelationshipService relationshipService; - protected ClassificationService classificationService; + protected ClassificationSchemeService classificationSchemeService; protected SecurityClearanceService securityClearanceService; protected ContentClassificationService contentClassificationService; @@ -405,7 +405,7 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase holdService = (HoldService) applicationContext.getBean("HoldService"); inplaceRecordService = (InplaceRecordService) applicationContext.getBean("InplaceRecordService"); relationshipService = (RelationshipService) applicationContext.getBean("RelationshipService"); - classificationService = (ClassificationService) applicationContext.getBean("ClassificationService"); + classificationSchemeService = (ClassificationSchemeService) applicationContext.getBean("ClassificationSchemeService"); securityClearanceService = (SecurityClearanceService) applicationContext.getBean("SecurityClearanceService"); contentClassificationService = (ContentClassificationService) applicationContext.getBean("ContentClassificationService"); } diff --git a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationLevelConstraintUnitTest.java b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationLevelConstraintUnitTest.java index 2e5c39fbc8..ec25624113 100644 --- a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationLevelConstraintUnitTest.java +++ b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationLevelConstraintUnitTest.java @@ -42,7 +42,7 @@ public class ClassificationLevelConstraintUnitTest private static final List DEFAULT_LEVELS = Arrays.asList(LEVEL_ONE, LEVEL_TWO); @InjectMocks ClassificationLevelConstraint classificationLevelConstraint; - @Mock ClassificationService mockClassificationService; + @Mock ClassificationSchemeService mockClassificationSchemeService; @Before public void setUp() @@ -50,7 +50,7 @@ public class ClassificationLevelConstraintUnitTest MockitoAnnotations.initMocks(this); // Currently this list of levels suffices for all the tests. - doReturn(DEFAULT_LEVELS).when(mockClassificationService).getClassificationLevels(); + doReturn(DEFAULT_LEVELS).when(mockClassificationSchemeService).getClassificationLevels(); } /** Check that evaluateSingleValue throws no exceptions when an id is found. */ diff --git a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationLevelManagerUnitTest.java b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationLevelManagerUnitTest.java index 29d8febfc6..d658f9a3da 100644 --- a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationLevelManagerUnitTest.java +++ b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationLevelManagerUnitTest.java @@ -23,7 +23,7 @@ import static org.junit.Assert.assertEquals; import java.util.Arrays; import java.util.List; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.LevelIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.LevelIdNotFound; import org.junit.Before; import org.junit.Test; @@ -63,14 +63,14 @@ public class ClassificationLevelManagerUnitTest ClassificationLevel actual = classificationLevelManager.getMostSecureLevel(); assertEquals(LEVEL_1, actual); } - + /** * Given that I have created the classification level manager with a list of classification levels * Then the unclassified level is available */ @Test public void getUnclassifiedLevel() { - assertEquals(LEVELS.size() + 1, classificationLevelManager.getClassificationLevels().size()); - assertEquals(ClassificationLevelManager.UNCLASSIFIED, classificationLevelManager.findLevelById(ClassificationLevelManager.UNCLASSIFIED_ID)); - } + assertEquals(LEVELS.size() + 1, classificationLevelManager.getClassificationLevels().size()); + assertEquals(ClassificationLevelManager.UNCLASSIFIED, classificationLevelManager.findLevelById(ClassificationLevelManager.UNCLASSIFIED_ID)); + } } diff --git a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationReasonManagerUnitTest.java b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationReasonManagerUnitTest.java index 16cdcf1168..42823e9e4f 100644 --- a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationReasonManagerUnitTest.java +++ b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationReasonManagerUnitTest.java @@ -23,7 +23,7 @@ import static org.junit.Assert.assertEquals; import java.util.Arrays; import java.util.List; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.ReasonIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.ReasonIdNotFound; import org.junit.Before; import org.junit.Test; diff --git a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceImplUnitTest.java b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationSchemeServiceImplUnitTest.java similarity index 86% rename from rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceImplUnitTest.java rename to rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationSchemeServiceImplUnitTest.java index 07be295efd..065499b8aa 100644 --- a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceImplUnitTest.java +++ b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationSchemeServiceImplUnitTest.java @@ -27,8 +27,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.LevelIdNotFound; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.ReasonIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.LevelIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.ReasonIdNotFound; import org.alfresco.module.org_alfresco_module_rm.test.util.ExceptionUtils; import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.repository.NodeService; @@ -42,12 +42,12 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; /** - * Unit tests for {@link ClassificationServiceImpl}. + * Unit tests for {@link ClassificationSchemeServiceImpl}. * * @author Neil Mc Erlean * @since 3.0 */ -public class ClassificationServiceImplUnitTest +public class ClassificationSchemeServiceImplUnitTest { private static final List DEFAULT_CLASSIFICATION_LEVELS = asLevelList("Top Secret", "rm.classification.topSecret", "Secret", "rm.classification.secret", @@ -78,7 +78,7 @@ public class ClassificationServiceImplUnitTest return levels; } - @InjectMocks private ClassificationServiceImpl classificationServiceImpl; + @InjectMocks private ClassificationSchemeServiceImpl classificationSchemeServiceImpl; @Mock private NodeService mockNodeService; @Mock private DictionaryService mockDictionaryService; @@ -99,7 +99,7 @@ public class ClassificationServiceImplUnitTest { ClassificationLevel targetLevel = new ClassificationLevel("Secret", "rm.classification.secret"); - List actual = classificationServiceImpl.restrictList(DEFAULT_CLASSIFICATION_LEVELS, targetLevel); + List actual = classificationSchemeServiceImpl.restrictList(DEFAULT_CLASSIFICATION_LEVELS, targetLevel); List expected = asLevelList("Secret", "rm.classification.secret", "Confidential", "rm.classification.confidential", @@ -116,7 +116,7 @@ public class ClassificationServiceImplUnitTest { ClassificationLevel targetLevel = new ClassificationLevel("UnrecognisedLevel", "rm.classification.IMadeThisUp"); - List actual = classificationServiceImpl.restrictList(DEFAULT_CLASSIFICATION_LEVELS, targetLevel); + List actual = classificationSchemeServiceImpl.restrictList(DEFAULT_CLASSIFICATION_LEVELS, targetLevel); assertEquals("Expected an empty list when the target level is not found.", 0, actual.size()); } @@ -127,7 +127,7 @@ public class ClassificationServiceImplUnitTest String levelId = "classificationLevelId1"; ClassificationLevel classificationLevel = new ClassificationLevel(levelId, "displayLabelKey"); when(mockLevelManager.findLevelById(levelId)).thenReturn(classificationLevel); - ClassificationLevel classificationLevelById = classificationServiceImpl.getClassificationLevelById(levelId); + ClassificationLevel classificationLevelById = classificationSchemeServiceImpl.getClassificationLevelById(levelId); assertEquals(classificationLevel, classificationLevelById); } @@ -136,7 +136,7 @@ public class ClassificationServiceImplUnitTest { String classificationLevelId = "aRandomId"; doThrow(new LevelIdNotFound("Id not found!")).when(mockLevelManager).findLevelById(classificationLevelId); - classificationServiceImpl.getClassificationLevelById(classificationLevelId); + classificationSchemeServiceImpl.getClassificationLevelById(classificationLevelId); } @Test @@ -145,7 +145,7 @@ public class ClassificationServiceImplUnitTest String reasonId = "classificationReasonId1"; ClassificationReason classificationReason = new ClassificationReason(reasonId, "displayLabelKey"); when(mockReasonManager.findReasonById(reasonId)).thenReturn(classificationReason); - ClassificationReason classificationReasonById = classificationServiceImpl.getClassificationReasonById(reasonId); + ClassificationReason classificationReasonById = classificationSchemeServiceImpl.getClassificationReasonById(reasonId); assertEquals(classificationReason, classificationReasonById); } @@ -154,6 +154,6 @@ public class ClassificationServiceImplUnitTest { String classificationReasonId = "aRandomId"; doThrow(new ReasonIdNotFound("Id not found!")).when(mockReasonManager).findReasonById(classificationReasonId); - classificationServiceImpl.getClassificationReasonById(classificationReasonId); + classificationSchemeServiceImpl.getClassificationReasonById(classificationReasonId); } } diff --git a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceBootstrapUnitTest.java b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceBootstrapUnitTest.java index c316e550ae..c7001ae395 100644 --- a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceBootstrapUnitTest.java +++ b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceBootstrapUnitTest.java @@ -35,7 +35,7 @@ import java.util.List; import java.util.stream.Stream; import com.google.common.collect.ImmutableList; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.MissingConfiguration; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.MissingConfiguration; import org.alfresco.module.org_alfresco_module_rm.test.util.MockAuthenticationUtilHelper; import org.alfresco.module.org_alfresco_module_rm.util.AuthenticationUtil; import org.alfresco.service.cmr.attributes.AttributeService; diff --git a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceDAOUnitTest.java b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceDAOUnitTest.java index 7666cd3f95..e2b973a915 100644 --- a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceDAOUnitTest.java +++ b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClassificationServiceDAOUnitTest.java @@ -18,14 +18,14 @@ */ package org.alfresco.module.org_alfresco_module_rm.classification; -import static org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceImplUnitTest.asLevelList; +import static org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeServiceImplUnitTest.asLevelList; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.util.List; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.MalformedConfiguration; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.MalformedConfiguration; import org.junit.Test; /** diff --git a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClearanceLevelManagerUnitTest.java b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClearanceLevelManagerUnitTest.java index 63dac33a97..57d33ec8c0 100644 --- a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClearanceLevelManagerUnitTest.java +++ b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ClearanceLevelManagerUnitTest.java @@ -23,7 +23,7 @@ import static org.junit.Assert.assertEquals; import java.util.List; import com.google.common.collect.ImmutableList; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.LevelIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.LevelIdNotFound; import org.junit.Before; import org.junit.Test; diff --git a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationServiceImplUnitTest.java b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationServiceImplUnitTest.java index 6aa36b1c2c..fa982c3ac7 100644 --- a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationServiceImplUnitTest.java +++ b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/ContentClassificationServiceImplUnitTest.java @@ -42,8 +42,8 @@ import com.google.common.collect.Sets; import org.alfresco.model.ContentModel; import org.alfresco.model.QuickShareModel; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.InvalidNode; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.LevelIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.InvalidNode; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.LevelIdNotFound; import org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel; import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.repository.NodeRef; diff --git a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/SecurityClearanceServiceImplUnitTest.java b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/SecurityClearanceServiceImplUnitTest.java index 1c5d0b6c3f..6a5cdf9a23 100644 --- a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/SecurityClearanceServiceImplUnitTest.java +++ b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/classification/SecurityClearanceServiceImplUnitTest.java @@ -31,7 +31,7 @@ import static org.mockito.Mockito.when; import java.util.List; import com.google.common.collect.ImmutableList; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException.LevelIdNotFound; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.LevelIdNotFound; import org.alfresco.module.org_alfresco_module_rm.test.util.MockAuthenticationUtilHelper; import org.alfresco.module.org_alfresco_module_rm.util.AuthenticationUtil; import org.alfresco.service.cmr.dictionary.DictionaryService; @@ -62,7 +62,7 @@ public class SecurityClearanceServiceImplUnitTest @Mock private DictionaryService mockDictionaryService; @Mock private NodeService mockNodeService; @Mock private PersonService mockPersonService; - @Mock private ClassificationService mockClassificationService; + @Mock private ClassificationSchemeService mockClassificationSchemeService; @Mock private ClearanceLevelManager mockClearanceLevelManager; @Mock private ClassificationLevelComparator mockClassificationLevelComparator; @@ -95,7 +95,7 @@ public class SecurityClearanceServiceImplUnitTest { final PersonInfo user1 = createMockPerson("user1", "User", "One", null); MockAuthenticationUtilHelper.setup(mockAuthenticationUtil, user1.getUserName()); - when(mockClassificationService.getUnclassifiedClassificationLevel()) + when(mockClassificationSchemeService.getUnclassifiedClassificationLevel()) .thenReturn(ClassificationLevelManager.UNCLASSIFIED); when(mockClearanceLevelManager.findLevelByClassificationLevelId(ClassificationLevelManager.UNCLASSIFIED_ID)) .thenReturn(ClearanceLevelManager.NO_CLEARANCE); diff --git a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ClassificationLevelsGetUnitTest.java b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ClassificationLevelsGetUnitTest.java index 83f1089818..3ddc2ab837 100644 --- a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ClassificationLevelsGetUnitTest.java +++ b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ClassificationLevelsGetUnitTest.java @@ -28,7 +28,7 @@ import java.util.HashMap; import java.util.List; import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationLevel; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService; import org.alfresco.module.org_alfresco_module_rm.test.util.BaseWebScriptUnitTest; import org.json.JSONObject; import org.junit.Test; @@ -53,7 +53,7 @@ public class ClassificationLevelsGetUnitTest extends BaseWebScriptUnitTest /** ClassificationLevelsGet webscript instance */ private @Spy @InjectMocks ClassificationLevelsGet webScript; - private @Mock ClassificationService mockClassificationService; + private @Mock ClassificationSchemeService mockClassificationSchemeService; private List classificationLevels; @@ -83,7 +83,7 @@ public class ClassificationLevelsGetUnitTest extends BaseWebScriptUnitTest new ClassificationLevel("id2", "labelKey2")); // setup interactions - doReturn(classificationLevels).when(mockClassificationService).getClassificationLevels(); + doReturn(classificationLevels).when(mockClassificationSchemeService).getClassificationLevels(); // execute web script JSONObject json = executeJSONWebScript(new HashMap()); diff --git a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ReasonsGetUnitTest.java b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ReasonsGetUnitTest.java index dc0983f8e9..39f02f934d 100644 --- a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ReasonsGetUnitTest.java +++ b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/ReasonsGetUnitTest.java @@ -29,7 +29,7 @@ import java.util.List; import java.util.Map; import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationReason; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationSchemeService; import org.alfresco.module.org_alfresco_module_rm.test.util.BaseWebScriptUnitTest; import org.json.JSONObject; import org.junit.Test; @@ -53,7 +53,7 @@ public class ReasonsGetUnitTest extends BaseWebScriptUnitTest /** ReasonsGet webscript instance */ private @Spy @InjectMocks ReasonsGet webScript; - private @Mock ClassificationService mockClassificationService; + private @Mock ClassificationSchemeService mockClassificationSchemeService; private List reasonsList; @@ -83,7 +83,7 @@ public class ReasonsGetUnitTest extends BaseWebScriptUnitTest reasonsList = Arrays.asList(reasonA, reasonB); // setup interactions - doReturn(reasonsList).when(mockClassificationService).getClassificationReasons(); + doReturn(reasonsList).when(mockClassificationSchemeService).getClassificationReasons(); // setup web script parameters Map parameters = new HashMap(); diff --git a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/UserSecurityClearancePutUnitTest.java b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/UserSecurityClearancePutUnitTest.java index dff442be12..fa4bb890f5 100644 --- a/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/UserSecurityClearancePutUnitTest.java +++ b/rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/script/classification/UserSecurityClearancePutUnitTest.java @@ -10,7 +10,7 @@ import java.util.Map; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationLevel; -import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceException; +import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException; import org.alfresco.module.org_alfresco_module_rm.classification.ClearanceLevel; import org.alfresco.module.org_alfresco_module_rm.classification.SecurityClearance; import org.alfresco.module.org_alfresco_module_rm.classification.SecurityClearanceService; @@ -114,7 +114,7 @@ public class UserSecurityClearancePutUnitTest extends BaseWebScriptUnitTest Map parameters = buildParameters(USERNAME, username, CLEARANCE_ID, clearanceId); when(mockSecurityClearanceService.setUserSecurityClearance(username, clearanceId)) - .thenThrow(new ClassificationServiceException.LevelIdNotFound(clearanceId)); + .thenThrow(new ClassificationException.LevelIdNotFound(clearanceId)); // Execute web script - this should throw the expected exception. executeJSONWebScript(parameters); @@ -135,7 +135,7 @@ public class UserSecurityClearancePutUnitTest extends BaseWebScriptUnitTest Map parameters = buildParameters(USERNAME, username, CLEARANCE_ID, clearanceId); when(mockSecurityClearanceService.setUserSecurityClearance(username, clearanceId)).thenThrow( - new ClassificationServiceException.LevelIdNotFound(clearanceId)); + new ClassificationException.LevelIdNotFound(clearanceId)); try {