Class RESTProjectsController

    • Field Detail

      • REL_PROJECT

        public static final java.lang.String REL_PROJECT
        rel used for accessing an individual project.
        See Also:
        Constant Field Values
      • PROJECT_HASH_REL

        public static final java.lang.String PROJECT_HASH_REL
        rel used for the project status hash
        See Also:
        Constant Field Values
    • Constructor Detail

      • RESTProjectsController

        protected RESTProjectsController()
        Default constructor. Should not be used.
    • Method Detail

      • getResource

        public ResponseResource<Project> getResource​(@PathVariable
                                                     java.lang.Long identifier)
        Retrieve and serialize an individual instance of a resource by identifier.
        Overrides:
        getResource in class RESTGenericController<Project>
        Parameters:
        identifier - the identifier of the resource to retrieve from the database.
        Returns:
        the model and view for the individual resource.
      • create

        public ResponseResource<Project> create​(@RequestBody
                                                Project resource,
                                                javax.servlet.http.HttpServletResponse response)
        Create a new instance of Type in the database, then respond to the client with the location of the resource.
        Overrides:
        create in class RESTGenericController<Project>
        Parameters:
        resource - the Type that we should de-serialize to get an instance of Type to persist.
        response - a reference to the servlet response.
        Returns:
        a response containing the location of the newly persisted resource.
      • delete

        public ResponseResource<RootResource> delete​(@PathVariable
                                                     java.lang.Long identifier)
        Delete the instance of the resource identified by a specific identifier.
        Overrides:
        delete in class RESTGenericController<Project>
        Parameters:
        identifier - the identifier that should be deleted from the database.
        Returns:
        a response indicating that the resource was deleted.
      • update

        public ResponseResource<RootResource> update​(@PathVariable
                                                     java.lang.Long identifier,
                                                     @RequestBody
                                                     java.util.Map<java.lang.String,​java.lang.Object> representation)
        Update some of the fields of an individual resource in the database. The client should only send the key-value pairs for the properties that are to be updated in the database.
        Overrides:
        update in class RESTGenericController<Project>
        Parameters:
        identifier - the identifier of the resource to be updated.
        representation - the properties to be updated and their new values.
        Returns:
        a response indicating that the resource was updated.
      • getProjectHash

        @RequestMapping(value="/{projectId}/hash",
                        method=GET)
        public ResponseResource<ProjectHashResource> getProjectHash​(@PathVariable
                                                                    java.lang.Long projectId)
        Get the deep project hash for the requested project
        Parameters:
        projectId - the ID of the project to read the hash for
        Returns:
        a response containing the ProjectHashResource