Package org.dspace.content.service
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<BitstreamFormat>findAll(Context context)Retrieve all bitstream formats from the registry, ordered by IDBitstreamFormatfindByMIMEType(Context context, String mimeType)Find a bitstream format by its (unique) MIME type.BitstreamFormatfindByShortDescription(Context context, String desc)Find a bitstream format by its (unique) short descriptionList<BitstreamFormat>findNonInternal(Context context)Retrieve all non-internal bitstream formats from the registry.BitstreamFormatfindUnknown(Context context)Get the generic "unknown" bitstream format.intgetSupportLevelID(String supportLevel)If you know the support level string, look up the corresponding type ID constant.StringgetSupportLevelText(BitstreamFormat bitstreamFormat)Get the support level text for this bitstream format - one ofUNKNOWN,KNOWNorSUPPORTED.BitstreamFormatguessFormat(Context context, Bitstream bitstream)Attempt to identify the format of a particular bitstream.voidsetShortDescription(Context context, BitstreamFormat bitstreamFormat, String shortDescription)Set the short description of the bitstream formatvoidsetSupportLevel(BitstreamFormat bitstreamFormat, int supportLevel)Set the support level for this bitstream format - one ofUNKNOWN,KNOWNorSUPPORTED.
-
-
-
Method Detail
-
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 objectmimeType- MIME type value- Returns:
- the corresponding bitstream format, or
nullif 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 objectdesc- the short description- Returns:
- the corresponding bitstream format, or
nullif 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 errorIllegalStateException- 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- contextbitstreamFormat- formatshortDescription- the new short description- Throws:
SQLException- if database error
-
getSupportLevelText
String getSupportLevelText(BitstreamFormat bitstreamFormat)
Get the support level text for this bitstream format - one ofUNKNOWN,KNOWNorSUPPORTED.- Parameters:
bitstreamFormat- format- Returns:
- the support level
-
setSupportLevel
void setSupportLevel(BitstreamFormat bitstreamFormat, int supportLevel)
Set the support level for this bitstream format - one ofUNKNOWN,KNOWNorSUPPORTED.- Parameters:
bitstreamFormat- formatsupportLevel- 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
-1if 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- contextbitstream- the bitstream to identify the format of- Returns:
- a format from the bitstream format registry, or null
- Throws:
SQLException- if database error
-
-