public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> implements BitstreamService
| Modifier and Type | Field and Description |
|---|---|
protected AuthorizeService |
authorizeService |
protected BitstreamDAO |
bitstreamDAO |
protected BitstreamFormatService |
bitstreamFormatService |
protected BitstreamStorageService |
bitstreamStorageService |
protected BundleService |
bundleService |
protected ItemService |
itemService |
choiceAuthorityService, handleService, metadataAuthorityService, metadataFieldService, metadataValueService| Modifier | Constructor and Description |
|---|---|
protected |
BitstreamServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
int |
countBitstreamsWithoutPolicy(Context context) |
Long |
countByStoreNumber(Context context,
Integer storeNumber) |
int |
countDeletedBitstreams(Context context) |
int |
countTotal(Context context) |
Bitstream |
create(Context context,
Bundle bundle,
InputStream is)
Create a new bitstream, with a new ID.
|
Bitstream |
create(Context context,
InputStream is)
Create a new bitstream, with a new ID.
|
void |
delete(Context context,
Bitstream bitstream) |
void |
expunge(Context context,
Bitstream bitstream)
Remove a bitstream that has been set to "deleted" from the database
|
Bitstream |
find(Context context,
UUID id)
Generic find for when the precise type of a DSO is not known, just the
a pair of type number and database ID.
|
List<Bitstream> |
findAll(Context context) |
List<Bitstream> |
findBitstreamsWithNoRecentChecksum(Context context) |
Bitstream |
findByIdOrLegacyId(Context context,
String id) |
Bitstream |
findByLegacyId(Context context,
int id)
Generic find for when the precise type of a DSO is not known, just the
a pair of type number and database ID.
|
Iterator<Bitstream> |
findByStoreNumber(Context context,
Integer storeNumber) |
List<Bitstream> |
findDeletedBitstreams(Context context)
Retrieve all bitstreams with the deleted flag set to true
|
List<Bitstream> |
findDuplicateInternalIdentifier(Context context,
Bitstream bitstream) |
Bitstream |
getBitstreamByName(Item item,
String bundleName,
String bitstreamName) |
Iterator<Bitstream> |
getCollectionBitstreams(Context context,
Collection collection) |
Iterator<Bitstream> |
getCommunityBitstreams(Context context,
Community community) |
Bitstream |
getFirstBitstream(Item item,
String bundleName) |
BitstreamFormat |
getFormat(Context context,
Bitstream bitstream) |
String |
getFormatDescription(Context context,
Bitstream bitstream)
Get the description of the format - either the user's or the description
of the format defined by the system.
|
Iterator<Bitstream> |
getItemBitstreams(Context context,
Item item) |
List<Bitstream> |
getNotReferencedBitstreams(Context context) |
DSpaceObject |
getParentObject(Context context,
Bitstream bitstream)
Return the dspace object that "own" the current object in the hierarchy.
|
int |
getSupportsTypeConstant()
Returns the Constants which this service supports
|
boolean |
isRegisteredBitstream(Bitstream bitstream)
Determine if this bitstream is registered (available elsewhere on
filesystem than in assetstore).
|
Bitstream |
register(Context context,
Bundle bundle,
int assetstore,
String bitstreamPath)
Register a new bitstream, with a new ID.
|
Bitstream |
register(Context context,
int assetstore,
String bitstreamPath)
Register a new bitstream, with a new ID.
|
InputStream |
retrieve(Context context,
Bitstream bitstream)
Retrieve the contents of the bitstream
|
void |
setFormat(Context context,
Bitstream bitstream,
BitstreamFormat bitstreamFormat)
Set the format of the bitstream.
|
void |
setUserFormatDescription(Context context,
Bitstream bitstream,
String desc)
Set the user's format description.
|
void |
update(Context context,
Bitstream bitstream) |
void |
updateLastModified(Context context,
Bitstream bitstream) |
addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, clearMetadata, deleteMetadata, getAdminObject, getAuthoritiesAndConfidences, getElements, getElementsFilled, getIdentifiers, getMDValueByField, getMDValueByLegacyField, getMetadata, getMetadata, getMetadata, getMetadata, getMetadataByMetadataString, getMetadataFirstValue, getMetadataValuePlace, getName, getTypeText, match, removeMetadataValues, setMetadataSingleValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, clearMetadata, getAdminObject, getIdentifiers, getMetadata, getMetadata, getMetadata, getMetadata, getMetadataByMetadataString, getMetadataFirstValue, getName, getTypeText, removeMetadataValues, setMetadataSingleValue@Autowired(required=true) protected BitstreamDAO bitstreamDAO
@Autowired(required=true) protected ItemService itemService
@Autowired(required=true) protected AuthorizeService authorizeService
@Autowired(required=true) protected BitstreamFormatService bitstreamFormatService
@Autowired(required=true) protected BundleService bundleService
@Autowired(required=true) protected BitstreamStorageService bitstreamStorageService
public Bitstream find(Context context, UUID id) throws SQLException
DSpaceObjectServicefind in interface DSpaceObjectService<Bitstream>context - - the contextid - - id within table of type'd objectsSQLException - only upon failure accessing the database.public List<Bitstream> findAll(Context context) throws SQLException
findAll in interface BitstreamServiceSQLExceptionpublic Bitstream create(Context context, InputStream is) throws IOException, SQLException
BitstreamServicecreate in interface BitstreamServicecontext - DSpace context objectis - the bits to put in the bitstreamIOExceptionSQLExceptionpublic Bitstream create(Context context, Bundle bundle, InputStream is) throws IOException, SQLException, AuthorizeException
BitstreamServicecreate in interface BitstreamServicecontext - DSpace context objectbundle - The bundle in which our bitstream should be added.is - the bits to put in the bitstreamIOExceptionSQLExceptionAuthorizeExceptionpublic Bitstream register(Context context, Bundle bundle, int assetstore, String bitstreamPath) throws IOException, SQLException, AuthorizeException
BitstreamServiceregister in interface BitstreamServicecontext - DSpace context objectassetstore - corresponds to an assetstore in dspace.cfgbitstreamPath - the path and filename relative to the assetstoreIOExceptionSQLExceptionAuthorizeExceptionpublic Bitstream register(Context context, int assetstore, String bitstreamPath) throws IOException, SQLException, AuthorizeException
register in interface BitstreamServicecontext - DSpace context objectassetstore - corresponds to an assetstore in dspace.cfgbitstreamPath - the path and filename relative to the assetstoreIOExceptionSQLExceptionAuthorizeExceptionpublic void setUserFormatDescription(Context context, Bitstream bitstream, String desc) throws SQLException
BitstreamServicesetUserFormatDescription in interface BitstreamServicedesc - the user's description of the formatSQLExceptionpublic String getFormatDescription(Context context, Bitstream bitstream) throws SQLException
BitstreamServicegetFormatDescription in interface BitstreamServiceSQLExceptionpublic void setFormat(Context context, Bitstream bitstream, BitstreamFormat bitstreamFormat) throws SQLException
BitstreamServicenull sets the type
of this bitstream to "unknown".setFormat in interface BitstreamServicebitstreamFormat - the format of this bitstream, or null for
unknownSQLExceptionpublic void update(Context context, Bitstream bitstream) throws SQLException, AuthorizeException
update in interface DSpaceObjectService<Bitstream>update in class DSpaceObjectServiceImpl<Bitstream>SQLExceptionAuthorizeExceptionpublic void delete(Context context, Bitstream bitstream) throws SQLException, AuthorizeException
delete in interface DSpaceObjectService<Bitstream>SQLExceptionAuthorizeExceptionpublic int getSupportsTypeConstant()
DSpaceObjectServicegetSupportsTypeConstant in interface DSpaceObjectLegacySupportService<Bitstream>getSupportsTypeConstant in interface DSpaceObjectService<Bitstream>public InputStream retrieve(Context context, Bitstream bitstream) throws IOException, SQLException, AuthorizeException
BitstreamServiceretrieve in interface BitstreamServiceIOExceptionSQLExceptionAuthorizeExceptionpublic boolean isRegisteredBitstream(Bitstream bitstream)
BitstreamServiceisRegisteredBitstream in interface BitstreamServicepublic DSpaceObject getParentObject(Context context, Bitstream bitstream) throws SQLException
DSpaceObjectServicegetParentObject in interface DSpaceObjectService<Bitstream>getParentObject in class DSpaceObjectServiceImpl<Bitstream>SQLExceptionpublic void updateLastModified(Context context, Bitstream bitstream)
updateLastModified in interface DSpaceObjectService<Bitstream>public List<Bitstream> findDeletedBitstreams(Context context) throws SQLException
BitstreamServicefindDeletedBitstreams in interface BitstreamServicecontext - the dspace contextSQLException - ...public void expunge(Context context, Bitstream bitstream) throws SQLException, AuthorizeException
BitstreamServiceexpunge in interface BitstreamServicecontext - the dspace contextbitstream - the bitstream to deleted from the databaseSQLExceptionAuthorizeExceptionpublic List<Bitstream> findDuplicateInternalIdentifier(Context context, Bitstream bitstream) throws SQLException
findDuplicateInternalIdentifier in interface BitstreamServiceSQLExceptionpublic Iterator<Bitstream> getItemBitstreams(Context context, Item item) throws SQLException
getItemBitstreams in interface BitstreamServiceSQLExceptionpublic Iterator<Bitstream> getCollectionBitstreams(Context context, Collection collection) throws SQLException
getCollectionBitstreams in interface BitstreamServiceSQLExceptionpublic Iterator<Bitstream> getCommunityBitstreams(Context context, Community community) throws SQLException
getCommunityBitstreams in interface BitstreamServiceSQLExceptionpublic List<Bitstream> findBitstreamsWithNoRecentChecksum(Context context) throws SQLException
findBitstreamsWithNoRecentChecksum in interface BitstreamServiceSQLExceptionpublic Bitstream getBitstreamByName(Item item, String bundleName, String bitstreamName) throws SQLException
getBitstreamByName in interface BitstreamServiceSQLExceptionpublic Bitstream getFirstBitstream(Item item, String bundleName) throws SQLException
getFirstBitstream in interface BitstreamServiceSQLExceptionpublic BitstreamFormat getFormat(Context context, Bitstream bitstream) throws SQLException
getFormat in interface BitstreamServiceSQLExceptionpublic Iterator<Bitstream> findByStoreNumber(Context context, Integer storeNumber) throws SQLException
findByStoreNumber in interface BitstreamServiceSQLExceptionpublic Long countByStoreNumber(Context context, Integer storeNumber) throws SQLException
countByStoreNumber in interface BitstreamServiceSQLExceptionpublic int countTotal(Context context) throws SQLException
countTotal in interface BitstreamServiceSQLExceptionpublic Bitstream findByIdOrLegacyId(Context context, String id) throws SQLException
findByIdOrLegacyId in interface DSpaceObjectLegacySupportService<Bitstream>SQLExceptionpublic Bitstream findByLegacyId(Context context, int id) throws SQLException
DSpaceObjectLegacySupportServicefindByLegacyId in interface DSpaceObjectLegacySupportService<Bitstream>context - - the contextid - - the legacy id within table of type'd objectsSQLException - only upon failure accessing the database.public int countDeletedBitstreams(Context context) throws SQLException
countDeletedBitstreams in interface BitstreamServiceSQLExceptionpublic int countBitstreamsWithoutPolicy(Context context) throws SQLException
countBitstreamsWithoutPolicy in interface BitstreamServiceSQLExceptionpublic List<Bitstream> getNotReferencedBitstreams(Context context) throws SQLException
getNotReferencedBitstreams in interface BitstreamServiceSQLExceptionCopyright © 2016 DuraSpace. All Rights Reserved.