Class BundleRestRepository

All Implemented Interfaces:
ReloadableEntityObjectRepository<Bundle,UUID>, Aware, BeanNameAware, org.springframework.data.repository.CrudRepository<BundleRest,UUID>, org.springframework.data.repository.PagingAndSortingRepository<BundleRest,UUID>, org.springframework.data.repository.Repository<BundleRest,UUID>

@Component("core.bundles") public class BundleRestRepository extends DSpaceObjectRestRepository<Bundle,BundleRest>
This is the repository responsible for managing the Bundle Rest object
Author:
Jelle Pelgrims (jelle.pelgrims at atmire.com)
  • Constructor Details

    • BundleRestRepository

      public BundleRestRepository(BundleService dsoService)
  • Method Details

    • findOne

      @PreAuthorize("hasPermission(#id, \'BUNDLE\', \'READ\')") public BundleRest findOne(Context context, UUID id)
      Description copied from class: DSpaceRestRepository
      Method to implement to support retrieval of a specific REST object instance
      Specified by:
      findOne in class DSpaceRestRepository<BundleRest,UUID>
      Parameters:
      context - the dspace context
      id - the rest object id
      Returns:
      the REST object identified by its ID
    • findAll

      public org.springframework.data.domain.Page<BundleRest> findAll(Context context, org.springframework.data.domain.Pageable pageable)
      Description copied from class: DSpaceRestRepository
      Method to implement to support scroll of entity instances from the collection resource endpoint
      Specified by:
      findAll in class DSpaceRestRepository<BundleRest,UUID>
      Parameters:
      context - the dspace context
      pageable - object embedding the requested pagination info
      Returns:
    • patch

      @PreAuthorize("hasPermission(#uuid, \'BUNDLE\', \'WRITE\')") protected void patch(Context context, jakarta.servlet.http.HttpServletRequest request, String apiCategory, String model, UUID uuid, Patch patch) throws AuthorizeException, SQLException
      Apply a patch operation to a bundle
      Overrides:
      patch in class DSpaceRestRepository<BundleRest,UUID>
      Parameters:
      context - The context
      request - The http request
      apiCategory - The API category e.g. "api"
      model - The DSpace model e.g. "metadatafield"
      uuid - The UUID of the bundle to perform patch operations on
      patch - The JSON Patch (https://tools.ietf.org/html/rfc6902) operation
      Throws:
      AuthorizeException
      SQLException
    • uploadBitstream

      public BitstreamRest uploadBitstream(Context context, Bundle bundle, String fileName, InputStream fileInputStream, String properties)
      Method to upload a bitstream to a bundle.
      Parameters:
      context - The context
      bundle - The bundle where the bitstream should be stored
      fileName - The filename as it was uploaded
      fileInputStream - The input stream used to create the bitstream
      properties - The properties to be assigned to the bitstream
      Returns:
      The uploaded bitstream
    • getDomainClass

      public Class<BundleRest> getDomainClass()
      Description copied from class: DSpaceRestRepository
      The REST model supported by the repository
      Specified by:
      getDomainClass in class DSpaceRestRepository<BundleRest,UUID>
    • delete

      @PreAuthorize("hasPermission(#id, \'BUNDLE\', \'DELETE\')") protected void delete(Context context, UUID id) throws AuthorizeException
      Deletes a bundle whose uuid is given and deletes all the bitstreams it contains in BundleService.delete
      Overrides:
      delete in class DSpaceRestRepository<BundleRest,UUID>
      Parameters:
      context - the dspace context
      id - the id of the bundle to delete
      Throws:
      AuthorizeException