public class BitstreamFormatServiceImpl extends Object implements BitstreamFormatService
| Modifier and Type | Field and Description |
|---|---|
protected AuthorizeService |
authorizeService |
protected BitstreamFormatDAO |
bitstreamFormatDAO |
protected String[] |
supportLevelText
translate support-level ID to string.
|
| Modifier | Constructor and Description |
|---|---|
protected |
BitstreamFormatServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
BitstreamFormat |
create(Context context) |
void |
delete(Context context,
BitstreamFormat bitstreamFormat) |
BitstreamFormat |
find(Context context,
int id)
Get a bitstream format from the database.
|
List<BitstreamFormat> |
findAll(Context context)
Retrieve all bitstream formats from the registry, ordered by ID
|
BitstreamFormat |
findByMIMEType(Context context,
String mimeType)
Find a bitstream format by its (unique) MIME type.
|
BitstreamFormat |
findByShortDescription(Context context,
String desc)
Find a bitstream format by its (unique) short description
|
List<BitstreamFormat> |
findNonInternal(Context context)
Retrieve all non-internal bitstream formats from the registry.
|
BitstreamFormat |
findUnknown(Context context)
Get the generic "unknown" bitstream format.
|
int |
getSupportLevelID(String supportLevel)
If you know the support level string, look up the corresponding type ID
constant.
|
String |
getSupportLevelText(BitstreamFormat bitstreamFormat)
Get the support level text for this bitstream format - one of
UNKNOWN,KNOWN or SUPPORTED. |
BitstreamFormat |
guessFormat(Context context,
Bitstream bitstream)
Attempt to identify the format of a particular bitstream.
|
void |
setShortDescription(Context context,
BitstreamFormat bitstreamFormat,
String shortDescription)
Set the short description of the bitstream format
|
void |
setSupportLevel(BitstreamFormat bitstreamFormat,
int supportLevel)
Set the support level for this bitstream format - one of
UNKNOWN,KNOWN or SUPPORTED. |
void |
update(Context context,
BitstreamFormat bitstreamFormat) |
void |
update(Context context,
List<BitstreamFormat> bitstreamFormats) |
@Autowired(required=true) protected BitstreamFormatDAO bitstreamFormatDAO
@Autowired(required=true) protected AuthorizeService authorizeService
protected final String[] supportLevelText
public BitstreamFormat find(Context context, int id) throws SQLException
find in interface DSpaceCRUDService<BitstreamFormat>context - DSpace context objectid - ID of the bitstream formatSQLException - if database errorpublic BitstreamFormat findByMIMEType(Context context, String mimeType) throws SQLException
BitstreamFormatServicefindByMIMEType in interface BitstreamFormatServicecontext - DSpace context objectmimeType - MIME type valuenull if
there's no bitstream format with the given MIMEtype.SQLException - if database errorpublic BitstreamFormat findByShortDescription(Context context, String desc) throws SQLException
BitstreamFormatServicefindByShortDescription in interface BitstreamFormatServicecontext - DSpace context objectdesc - the short descriptionnull if
there's no bitstream format with the given short descriptionSQLException - if database errorpublic BitstreamFormat findUnknown(Context context) throws SQLException
BitstreamFormatServicefindUnknown in interface BitstreamFormatServicecontext - DSpace context objectSQLException - if database errorpublic List<BitstreamFormat> findAll(Context context) throws SQLException
BitstreamFormatServicefindAll in interface BitstreamFormatServicecontext - DSpace context objectSQLException - if database errorpublic List<BitstreamFormat> findNonInternal(Context context) throws SQLException
BitstreamFormatServicefindNonInternal in interface BitstreamFormatServicecontext - DSpace context objectSQLException - if database errorpublic BitstreamFormat create(Context context) throws SQLException, AuthorizeException
create in interface DSpaceCRUDService<BitstreamFormat>SQLExceptionAuthorizeExceptionpublic void setShortDescription(Context context, BitstreamFormat bitstreamFormat, String shortDescription) throws SQLException
BitstreamFormatServicesetShortDescription in interface BitstreamFormatServicecontext - contextbitstreamFormat - formatshortDescription - the new short descriptionSQLException - if database errorpublic String getSupportLevelText(BitstreamFormat bitstreamFormat)
BitstreamFormatServiceUNKNOWN,KNOWN or SUPPORTED.getSupportLevelText in interface BitstreamFormatServicebitstreamFormat - formatpublic void setSupportLevel(BitstreamFormat bitstreamFormat, int supportLevel)
BitstreamFormatServiceUNKNOWN,KNOWN or SUPPORTED.setSupportLevel in interface BitstreamFormatServicebitstreamFormat - formatsupportLevel - the new support levelpublic void update(Context context, BitstreamFormat bitstreamFormat) throws SQLException, AuthorizeException
update in interface DSpaceCRUDService<BitstreamFormat>SQLExceptionAuthorizeExceptionpublic void update(Context context, List<BitstreamFormat> bitstreamFormats) throws SQLException, AuthorizeException
update in interface DSpaceCRUDService<BitstreamFormat>SQLExceptionAuthorizeExceptionpublic void delete(Context context, BitstreamFormat bitstreamFormat) throws SQLException, AuthorizeException
delete in interface DSpaceCRUDService<BitstreamFormat>SQLExceptionAuthorizeExceptionpublic int getSupportLevelID(String supportLevel)
BitstreamFormatServicegetSupportLevelID in interface BitstreamFormatServicesupportLevel - String with the name of the action (must be exact match)-1 if the action
string is unknownpublic BitstreamFormat guessFormat(Context context, Bitstream bitstream) throws SQLException
BitstreamFormatServiceguessFormat in interface BitstreamFormatServicecontext - contextbitstream - the bitstream to identify the format ofSQLException - if database errorCopyright © 2017 DuraSpace. All rights reserved.