Class SubjectAreaProjectHandler


  • public class SubjectAreaProjectHandler
    extends SubjectAreaHandler
    SubjectAreaProjectHandler manages Project objects from the property server. It runs server-side in the subject Area OMAS and retrieves entities and relationships through the OMRSRepositoryConnector.
    • Constructor Detail

      • SubjectAreaProjectHandler

        public SubjectAreaProjectHandler​(OpenMetadataAPIGenericHandler genericHandler,
                                         int maxPageSize)
        Construct the Subject Area Project Handler needed to operate within a single server instance.
        Parameters:
        genericHandler - generic handler
        maxPageSize - maximum page size
    • Method Detail

      • createProject

        public SubjectAreaOMASAPIResponse<Project> createProject​(String userId,
                                                                 Project suppliedProject)
        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 performed
        suppliedProject - 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

        public SubjectAreaOMASAPIResponse<Project> getProjectByGuid​(String userId,
                                                                    String guid)
        Get a project by guid.
        Parameters:
        userId - unique identifier for requesting user, under which the request is performed
        guid - 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 performed
        findRequest - 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 performed
        guid - guid of the project to get
        findRequest - 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 Project

        If 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 performed
        guid - guid of the project to update
        suppliedProject - project to be updated
        isReplace - 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

        public SubjectAreaOMASAPIResponse<Project> deleteProject​(String userId,
                                                                 String guid)
        Delete a Project instance

        The 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 performed
        guid - 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

        public SubjectAreaOMASAPIResponse<Project> restoreProject​(String userId,
                                                                  String guid)
        Restore a Project

        Restore 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 performed
        guid - 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.