Class SubjectAreaProjectHandler
-
Field Summary
Fields inherited from class org.odpi.openmetadata.accessservices.subjectarea.handlers.SubjectAreaHandler
genericHandler, invalidParameterHandler, mappersFactory, maxPageSize
-
Constructor Summary
ConstructorsConstructorDescriptionSubjectAreaProjectHandler
(OpenMetadataAPIGenericHandler genericHandler, int maxPageSize) Construct the Subject Area Project Handler needed to operate within a single server instance. -
Method Summary
Modifier and TypeMethodDescriptioncreateProject
(String userId, Project suppliedProject) Create a Project.deleteProject
(String userId, String guid) Delete a Project instancefindProject
(String userId, FindRequest findRequest, boolean exactValue, boolean ignoreCase) Find ProjectgetProjectByGuid
(String userId, String guid) Get a project by guid.getProjectRelationships
(String userId, String guid, FindRequest findRequest) Get Project relationshipsrestoreProject
(String userId, String guid) Restore a ProjectupdateProject
(String userId, String guid, Project suppliedProject, boolean isReplace) Update a ProjectMethods inherited from class org.odpi.openmetadata.accessservices.subjectarea.handlers.SubjectAreaHandler
convertOmrsToOmas, findNodes, getAllRelationshipForEntity, getAllRelationshipsForEntity, getMaxPageSize, getNodesFromEntityDetails, getRelationshipsForEntityByType, getRelationshipsFromRelationships, sanitiseFindRequest, sanitiseFindRequest, setNodeEffectivity, setRelationshipEffectivity, setUniqueQualifiedNameIfBlank, validateGlossarySummaryDuringCreation
-
Constructor Details
-
SubjectAreaProjectHandler
Construct the Subject Area Project Handler needed to operate within a single server instance.- Parameters:
genericHandler
- generic handlermaxPageSize
- maximum page size
-
-
Method Details
-
createProject
Create a Project. There are specializations of projects that can also be created using this operation. To create a specialization, you should specify a nodeType other than Project in the supplied project.Projects with the same name can be confusing. Best practise is to createProjects that have unique names. This Create call does not police that project names are unique. So it is possible to create Projects with the same name as each other.
Valid nodeTypes for this request are:
- Taxonomy to create a Taxonomy
- CanonicalProject to create a canonical project
- TaxonomyAndCanonicalProject to create a project that is both a taxonomy and a canonical project
- Project to create a project that is not a taxonomy or a canonical project
- Parameters:
userId
- unique identifier for requesting user, under which the request is performedsuppliedProject
- Project to create- Returns:
- response, when successful contains the created project.
when not successful the following Exception responses can occur
- UserNotAuthorizedException the requesting user is not authorized to issue this request.
- MetadataServerUncontactableException not able to communicate with a Metadata respository service.
- InvalidParameterException one of the parameters is null or invalid.
- UnrecognizedGUIDException the supplied guid was not recognised.
- ClassificationException Error processing a classification.
- StatusNotSupportedException A status value is not supported.
-
getProjectByGuid
Get a project by guid.- Parameters:
userId
- unique identifier for requesting user, under which the request is performedguid
- guid of the project to get- Returns:
- response which when successful contains the project with the requested guid
when not successful the following Exception responses can occur
- UserNotAuthorizedException the requesting user is not authorized to issue this request.
- MetadataServerUncontactableException not able to communicate with a Metadata respository service.
- InvalidParameterException one of the parameters is null or invalid.
- UnrecognizedGUIDException the supplied guid was not recognised
-
findProject
public SubjectAreaOMASAPIResponse<Project> findProject(String userId, FindRequest findRequest, boolean exactValue, boolean ignoreCase) Find Project- Parameters:
userId
- unique identifier for requesting user, under which the request is performedfindRequest
-FindRequest
exactValue
- a boolean, which when set means that only exact matches will be returned, otherwise matches that start with the search criteria will be returned.ignoreCase
- a boolean, which when set means that case will be ignored, if not set that case will be respected- Returns:
- A list of Projects meeting the search Criteria
- UserNotAuthorizedException the requesting user is not authorized to issue this request.
- MetadataServerUncontactableException not able to communicate with a Metadata respository service.
- InvalidParameterException one of the parameters is null or invalid.
- FunctionNotSupportedException Function not supported this indicates that a find was issued but the repository does not implement find functionality in some way.
-
getProjectRelationships
public SubjectAreaOMASAPIResponse<Relationship> getProjectRelationships(String userId, String guid, FindRequest findRequest) Get Project relationships- Parameters:
userId
- unique identifier for requesting user, under which the request is performedguid
- guid of the project to getfindRequest
-FindRequest
- Returns:
- the relationships associated with the requested Project userId
when not successful the following Exception responses can occur
- UserNotAuthorizedException the requesting user is not authorized to issue this request.
- InvalidParameterException one of the parameters is null or invalid.
- FunctionNotSupportedException Function not supported.
-
updateProject
public SubjectAreaOMASAPIResponse<Project> updateProject(String userId, String guid, Project suppliedProject, boolean isReplace) Update a ProjectIf the caller has chosen to incorporate the project name in their Project Terms or Categories qualified name, renaming the project will cause those qualified names to mismatch the Project name. If the caller has chosen to incorporate the project qualifiedName in their Project Terms or Categories qualified name, changing the qualified name of the project will cause those qualified names to mismatch the Project name. Status is not updated using this call.
- Parameters:
userId
- unique identifier for requesting user, under which the request is performedguid
- guid of the project to updatesuppliedProject
- project to be updatedisReplace
- flag to indicate that this update is a replace. When not set only the supplied (non null) fields are updated.- Returns:
- a response which when successful contains the updated project
when not successful the following Exception responses can occur
- UnrecognizedGUIDException the supplied guid was not recognised
- UserNotAuthorizedException the requesting user is not authorized to issue this request.
- FunctionNotSupportedException Function not supported
- InvalidParameterException one of the parameters is null or invalid.
- MetadataServerUncontactableException not able to communicate with a Metadata respository service.
-
deleteProject
Delete a Project instanceThe deletion of a project is only allowed if there is no project content (i.e. no terms or categories).
There are 2 types of deletion, a soft delete and a hard delete (also known as a purge). All repositories support hard deletes. Soft deletes support is optional.
A soft delete means that the project instance will exist in a deleted state in the repository after the delete operation. This means that it is possible to undo the delete. A hard delete means that the project will not exist after the operation.
- Parameters:
userId
- unique identifier for requesting user, under which the request is performedguid
- guid of the project to be deleted.- Returns:
- a void response
when not successful the following Exception responses can occur
- UnrecognizedGUIDException the supplied guid was not recognised
- UserNotAuthorizedException the requesting user is not authorized to issue this request.
- FunctionNotSupportedException Function not supported
- InvalidParameterException one of the parameters is null or invalid.
- MetadataServerUncontactableException not able to communicate with a Metadata repository service. There is a problem retrieving properties from the metadata repository.
- EntityNotDeletedException a soft delete was issued but the project was not deleted.
-
restoreProject
Restore a ProjectRestore allows the deleted Project to be made active again. Restore allows deletes to be undone. Hard deletes are not stored in the repository so cannot be restored.
- Parameters:
userId
- unique identifier for requesting user, under which the request is performedguid
- guid of the project to restore- Returns:
- response which when successful contains the restored project
when not successful the following Exception responses can occur
- UnrecognizedGUIDException the supplied guid was not recognised
- UserNotAuthorizedException the requesting user is not authorized to issue this request.
- FunctionNotSupportedException Function not supported this indicates that a soft delete was issued but the repository does not support it.
- InvalidParameterException one of the parameters is null or invalid.
- MetadataServerUncontactableException not able to communicate with a Metadata respository service. There is a problem retrieving properties from the metadata repository.
-