Interface BitstreamFormatService

All Superinterfaces:
DSpaceCRUDService<BitstreamFormat>
All Known Implementing Classes:
BitstreamFormatServiceImpl

public interface BitstreamFormatService extends DSpaceCRUDService<BitstreamFormat>
Service interface class for the BitstreamFormat object. The implementation of this class is responsible for all business logic calls for the BitstreamFormat object and is autowired by spring
Author:
kevinvandevelde at atmire.com
  • Method Details

    • findByMIMEType

      BitstreamFormat findByMIMEType(Context context, String mimeType) throws SQLException
      Find a bitstream format by its (unique) MIME type. If more than one bitstream format has the same MIME type, the one returned is unpredictable.
      Parameters:
      context - DSpace context object
      mimeType - MIME type value
      Returns:
      the corresponding bitstream format, or null if there's no bitstream format with the given MIMEtype.
      Throws:
      SQLException - if database error
    • findByShortDescription

      BitstreamFormat findByShortDescription(Context context, String desc) throws SQLException
      Find a bitstream format by its (unique) short description
      Parameters:
      context - DSpace context object
      desc - the short description
      Returns:
      the corresponding bitstream format, or null if there's no bitstream format with the given short description
      Throws:
      SQLException - if database error
    • findUnknown

      BitstreamFormat findUnknown(Context context) throws SQLException
      Get the generic "unknown" bitstream format.
      Parameters:
      context - DSpace context object
      Returns:
      the "unknown" bitstream format.
      Throws:
      SQLException - if database error
      IllegalStateException - if the "unknown" bitstream format couldn't be found
    • findAll

      List<BitstreamFormat> findAll(Context context) throws SQLException
      Retrieve all bitstream formats from the registry, ordered by ID
      Parameters:
      context - DSpace context object
      Returns:
      the bitstream formats.
      Throws:
      SQLException - if database error
    • findNonInternal

      List<BitstreamFormat> findNonInternal(Context context) throws SQLException
      Retrieve all non-internal bitstream formats from the registry. The "unknown" format is not included, and the formats are ordered by support level (highest first) first then short description.
      Parameters:
      context - DSpace context object
      Returns:
      the bitstream formats.
      Throws:
      SQLException - if database error
    • setShortDescription

      void setShortDescription(Context context, BitstreamFormat bitstreamFormat, String shortDescription) throws SQLException
      Set the short description of the bitstream format
      Parameters:
      context - context
      bitstreamFormat - format
      shortDescription - the new short description
      Throws:
      SQLException - if database error
    • getSupportLevelText

      String getSupportLevelText(BitstreamFormat bitstreamFormat)
      Get the support level text for this bitstream format - one of UNKNOWN,KNOWN or SUPPORTED.
      Parameters:
      bitstreamFormat - format
      Returns:
      the support level
    • setSupportLevel

      void setSupportLevel(BitstreamFormat bitstreamFormat, int supportLevel)
      Set the support level for this bitstream format - one of UNKNOWN,KNOWN or SUPPORTED.
      Parameters:
      bitstreamFormat - format
      supportLevel - the new support level
    • getSupportLevelID

      int getSupportLevelID(String supportLevel)
      If you know the support level string, look up the corresponding type ID constant.
      Parameters:
      supportLevel - String with the name of the action (must be exact match)
      Returns:
      the corresponding action ID, or -1 if the action string is unknown
    • guessFormat

      BitstreamFormat guessFormat(Context context, Bitstream bitstream) throws SQLException
      Attempt to identify the format of a particular bitstream. If the format is unknown, null is returned.
      Parameters:
      context - context
      bitstream - the bitstream to identify the format of
      Returns:
      a format from the bitstream format registry, or null
      Throws:
      SQLException - if database error