diff --git a/open-metadata-implementation/access-services/subject-area/subject-area-api/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/ffdc/SubjectAreaErrorCode.java b/open-metadata-implementation/access-services/subject-area/subject-area-api/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/ffdc/SubjectAreaErrorCode.java index 4b66197ddac..524eb589764 100644 --- a/open-metadata-implementation/access-services/subject-area/subject-area-api/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/ffdc/SubjectAreaErrorCode.java +++ b/open-metadata-implementation/access-services/subject-area/subject-area-api/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/ffdc/SubjectAreaErrorCode.java @@ -253,14 +253,6 @@ public enum SubjectAreaErrorCode implements ExceptionMessageSet { "Cannot continue with create with the supplied Categories, as they do not exist", "The system is unable to process the request as the Term create requires the supplied Categories to exist.", "Correct the code in the caller to create Terms specifying not categories opr existing categories."), - MODIFICATION_OPERATION_ATTEMPTED_ON_READ_ONLY_NODE(400, "OMAS-SUBJECT-AREA-400-074", - "Cannot continue with the {0} operation with the supplied Node - {1}, as it is read only", - "The system is unable to process the request the modification request is not allowed on a read-only Node.", - "Amend the code to not issue modification requests on a read-only Node."), - MODIFICATION_OPERATION_ATTEMPTED_ON_READ_ONLY_RELATIONSHIP(400, "OMAS-SUBJECT-AREA-400-075", - "Cannot continue with the {0} operation with the supplied Relationship {1}, as it is read only", - "The system is unable to process the request the modification request is not allowed on a read-only Relationship.", - "Amend the code to not issue modification requests on a read-only Relationship."), INVALID_RELATIONSHIPTYPES_FOR_GRAPH(400, "OMAS-SUBJECT-AREA-400-076", "Cannot continue with the {0} operation because an invalid relationship name {1} was supplied in the filter", "The system is unable to process the request as it cannot identify the requested Relationship type.", @@ -269,9 +261,6 @@ public enum SubjectAreaErrorCode implements ExceptionMessageSet { "Cannot continue with the {0} operation because there is the Unknown relationship name {1} was supplied in the filter", "The system is unable to process the request as it cannot identify the requested Unknown Relationship type.", "Amend the code to supply only known Relationship Types for the graph operation."), - - - OMRS_NOT_INITIALIZED(404, "OMAS-SUBJECT-AREA-404-001", "The open metadata repository services are not initialized for the {0} operation", "The system is unable to connect to the open metadata property server.", diff --git a/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaCategoryHandler.java b/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaCategoryHandler.java index 5d18b360ff6..fc8c51b4167 100644 --- a/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaCategoryHandler.java +++ b/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaCategoryHandler.java @@ -370,7 +370,6 @@ public SubjectAreaOMASAPIResponse updateCategory(String userId, String response = getCategoryByGuid(userId, guid); if (response.head().isPresent()) { Category storedCategory = response.head().get(); - checkReadOnly(methodName, storedCategory, "update"); CategoryMapper categoryMapper = mappersFactory.get(CategoryMapper.class); EntityDetail suppliedEntity = categoryMapper.map(suppliedCategory); @@ -426,21 +425,16 @@ public SubjectAreaOMASAPIResponse deleteCategory(String userId, String SubjectAreaOMASAPIResponse response = new SubjectAreaOMASAPIResponse<>(); try { - response = getCategoryByGuid(userId, guid); - if (response.head().isPresent()) { - Category categoryToBeDeleted = response.head().get(); - checkReadOnly(methodName, categoryToBeDeleted, "delete"); - } - genericHandler.deleteBeanInRepository(userId, - null, - null, - guid, - "guid", - OpenMetadataAPIMapper.GLOSSARY_CATEGORY_TYPE_GUID, - OpenMetadataAPIMapper.GLOSSARY_CATEGORY_TYPE_NAME, - null, - null, - methodName); + genericHandler.deleteBeanInRepository(userId, + null, + null, + guid, + "guid", + OpenMetadataAPIMapper.GLOSSARY_CATEGORY_TYPE_GUID, + OpenMetadataAPIMapper.GLOSSARY_CATEGORY_TYPE_NAME, + null, + null, + methodName); } catch (PropertyServerException | UserNotAuthorizedException | InvalidParameterException e) { response.setExceptionInfo(e, className); } diff --git a/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaGlossaryHandler.java b/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaGlossaryHandler.java index 88ddc9db700..3f18c6c5502 100644 --- a/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaGlossaryHandler.java +++ b/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaGlossaryHandler.java @@ -262,8 +262,6 @@ public SubjectAreaOMASAPIResponse updateGlossary(String userId, String response = getGlossaryByGuid(userId, guid); if (response.head().isPresent()) { Glossary currentGlossary = response.head().get(); - checkReadOnly(methodName, currentGlossary, "update"); - GlossaryMapper glossaryMapper = mappersFactory.get(GlossaryMapper.class); EntityDetail entityDetail = glossaryMapper.map(currentGlossary); genericHandler.updateBeanInRepository(userId, @@ -320,11 +318,6 @@ public SubjectAreaOMASAPIResponse deleteGlossary(String userId, String SubjectAreaOMASAPIResponse response = new SubjectAreaOMASAPIResponse<>(); boolean issueDelete = false; try { - response = getGlossaryByGuid(userId, guid); - Glossary currentGlossary = response.head().get(); - if (response.head().isPresent()) { - checkReadOnly(methodName, currentGlossary, "delete"); - } // if this is a not a purge then check there are no relationships before deleting, // otherwise the deletion could remove all anchored entities. if (genericHandler.isBeanIsolated(userId, diff --git a/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaHandler.java b/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaHandler.java index 817f9f4bebb..e2c95d133b3 100644 --- a/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaHandler.java +++ b/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaHandler.java @@ -451,34 +451,6 @@ protected void setUniqueQualifiedNameIfBlank(Node node) { node.setQualifiedName(node.getName() + "@" + UUID.randomUUID().toString()); } } - /** - * Check whether the node is readonly and throw and exception if it is - * @param methodName calling methodName - * @param node node to check - * @param operation operation being attempted - * @throws PropertyServerException exception thrown when the node is readonly - */ - protected void checkReadOnly(String methodName, Node node, String operation ) throws PropertyServerException { - if (node.isReadOnly()) { - // reject - ExceptionMessageDefinition messageDefinition = SubjectAreaErrorCode.MODIFICATION_OPERATION_ATTEMPTED_ON_READ_ONLY_NODE.getMessageDefinition(operation, node.getNodeType().toString()); - throw new PropertyServerException(messageDefinition, className , methodName); - } - } - /** - * Check whether the relationship is readonly and throw and exception if it is - * @param methodName calling methodName - * @param relationship relationship to check - * @param operation operation being attempted - * @throws PropertyServerException exception thrown when the relationship is readonly - */ - protected void checkRelationshipReadOnly(String methodName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship relationship, String operation ) throws PropertyServerException { - if (relationship.getInstanceProvenanceType() != InstanceProvenanceType.LOCAL_COHORT) { - // reject - ExceptionMessageDefinition messageDefinition = SubjectAreaErrorCode.MODIFICATION_OPERATION_ATTEMPTED_ON_READ_ONLY_RELATIONSHIP.getMessageDefinition(operation, relationship.getType().getTypeDefName()); - throw new PropertyServerException(messageDefinition, className , methodName); - } - } /** * Set the effectivity to and from dates date for a Node diff --git a/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaProjectHandler.java b/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaProjectHandler.java index 155e0da7fab..59dcfbb5cc6 100644 --- a/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaProjectHandler.java +++ b/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaProjectHandler.java @@ -253,7 +253,6 @@ public SubjectAreaOMASAPIResponse updateProject(String userId, String g // Project storedProject = response.head().get(); - checkReadOnly(methodName, storedProject, "update"); ProjectMapper projectMapper = mappersFactory.get(ProjectMapper.class); EntityDetail suppliedEntity = projectMapper.map(suppliedProject); @@ -315,11 +314,6 @@ public SubjectAreaOMASAPIResponse deleteProject(String userId, String g final String methodName = "deleteProject"; SubjectAreaOMASAPIResponse response = new SubjectAreaOMASAPIResponse<>(); boolean issueDelete = false; try { - response = getProjectByGuid(userId, guid); - if (response.head().isPresent()) { - Project currentProject = response.head().get(); - checkReadOnly(methodName, currentProject, "delete"); - } if (genericHandler.isBeanIsolated(userId, guid, OpenMetadataAPIMapper.PROJECT_TYPE_NAME, diff --git a/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaRelationshipHandler.java b/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaRelationshipHandler.java index ae40f7f32ff..586c7a80214 100644 --- a/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaRelationshipHandler.java +++ b/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaRelationshipHandler.java @@ -189,9 +189,6 @@ public SubjectAreaOMASAPIResponse updateRelationship response = getRelationship(methodName, userId, clazz, relationshipGuid); R storedOMASRelationship = response.results().get(0); org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship storedRelationship = mapper.map(storedOMASRelationship); - - checkRelationshipReadOnly(methodName, storedRelationship, "update"); - org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship relationshipToUpdate = mapper.map(relationship); relationshipToUpdate.setGUID(relationshipGuid); @@ -278,8 +275,6 @@ public SubjectAreaOMASAPIResponse deleteRelationship mapper.getTypeName(), restAPIName); - checkRelationshipReadOnly(methodName, oMRSRelationship, "delete"); - genericHandler.unlinkElementFromElement(userId, false, null, diff --git a/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaTermHandler.java b/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaTermHandler.java index 6a883cf2afc..9a1d1eabbcd 100644 --- a/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaTermHandler.java +++ b/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/handlers/SubjectAreaTermHandler.java @@ -456,7 +456,6 @@ public SubjectAreaOMASAPIResponse updateTerm(String userId, String guid, T response = getTermByGuid(userId, guid); if (response.head().isPresent()) { Term storedTerm = response.head().get(); - checkReadOnly(methodName, storedTerm, "update"); TermMapper termMapper = mappersFactory.get(TermMapper.class); EntityDetail suppliedEntity = termMapper.map(suppliedTerm); @@ -680,10 +679,6 @@ public SubjectAreaOMASAPIResponse deleteTerm(String userId, String guid) { final String methodName = "deleteTerm"; SubjectAreaOMASAPIResponse response = new SubjectAreaOMASAPIResponse<>(); try { - if (response.head().isPresent()) { - Term termToBeDeleted = response.head().get(); - checkReadOnly(methodName, termToBeDeleted, "delete"); - } genericHandler.deleteBeanInRepository(userId, null, null,