Class RESTSampleMetadataController


  • @Controller
    public class RESTSampleMetadataController
    extends java.lang.Object
    REST controller to handle storing and retrieving metadata from a Sample
    • Method Detail

      • getSampleMetadata

        @RequestMapping(value="/api/samples/{sampleId}/metadata",
                        method=GET)
        public ResponseResource<SampleMetadataResponse> getSampleMetadata​(@PathVariable
                                                                          java.lang.Long sampleId)
        Get the metadata for a given Sample
        Parameters:
        sampleId - the id of the Sample to get metadata for
        Returns:
        the metadata for the sample
      • getProjectSampleMetadata

        @RequestMapping(value="/api/projects/{projectId}/samples/metadata",
                        method=GET)
        public ResponseResource<ResourceCollection<SampleMetadataResponse>> getProjectSampleMetadata​(@PathVariable
                                                                                                     java.lang.Long projectId)
        Get all the sample metadata for a given Project
        Parameters:
        projectId - the id of the Project to get metadata for
        Returns:
        A collection of metadata for all the Samples in the Project
      • saveSampleMetadata

        @RequestMapping(value="/api/samples/{sampleId}/metadata",
                        method=POST)
        public ResponseResource<SampleMetadataResponse> saveSampleMetadata​(@PathVariable
                                                                           java.lang.Long sampleId,
                                                                           @RequestBody
                                                                           java.util.Map<java.lang.String,​MetadataEntry> metadataMap)
        Save new metadata for a Sample. Note this will overwrite the existing metadata
        Parameters:
        sampleId - the id of the Sample to save new metadata
        metadataMap - the metadata to save to the Sample
        Returns:
        the updated Sample
      • addSampleMetadata

        @RequestMapping(value="/api/samples/{sampleId}/metadata",
                        method=PUT)
        public ResponseResource<SampleMetadataResponse> addSampleMetadata​(@PathVariable
                                                                          java.lang.Long sampleId,
                                                                          @RequestBody
                                                                          java.util.Map<java.lang.String,​MetadataEntry> metadataMap)
        Add select new metadata fields to the Sample. Note this will only overwrite duplicate terms. Existing metadata will not be affected.
        Parameters:
        sampleId - the Sample to add metadata to
        metadataMap - the new metadata
        Returns:
        the updated Sample