public final class BitstreamInfoDAO extends DAOSupport
Database Access Object for bitstream information (metadata). Also performs the needed insert/update/delete commands on the database for the checksum checker.
| Modifier and Type | Field and Description |
|---|---|
static String |
GET_OLDEST_BITSTREAM
This selects the next bitstream in order of last processing end date.
|
static String |
GET_OLDEST_BITSTREAM_DATE
Selects the next bitstream in order of last processing end date, ensuring
that no bitstream is checked more than once since the date parameter
used.
|
static String |
GET_OLDEST_BITSTREAM_DATE_ORACLE |
static String |
GET_OLDEST_BITSTREAM_ORACLE |
static int |
SENTINEL
This value should be returned by
next() to indicate that
there are no more values. |
| Constructor and Description |
|---|
BitstreamInfoDAO()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
deleteBitstreamInfo(int id,
Connection conn)
Deletes the bitstream from the most_recent_checksum table if it exist.
|
int |
deleteBitstreamInfoWithHistory(int id) |
BitstreamInfo |
findByBitstreamId(int id)
Find a bitstream by its id.
|
List<Integer> |
getCollectionBitstreams(int collectionId)
Get the bitstream ids for a given collection
|
List<Integer> |
getCommunityBitstreams(int communityId)
Get the bitstream ids for a given community
|
List<Integer> |
getItemBitstreams(int itemId)
Get the bitstream ids for a given Item
|
int |
getOldestBitstream()
Get the oldest bitstream in the most recent checksum table.
|
int |
getOldestBitstream(Timestamp lessThanDate)
Returns the oldest bitstream that in the set of bitstreams that are less
than the specified date.
|
void |
update(BitstreamInfo info)
Updates most_recent_checksum with latest checksum and result of
comparison with previous checksum.
|
void |
updateMissingBitstreams()
Queries the bitstream table for bitstream IDs that are not yet in the
most_recent_checksum table, and inserts them into the
most_recent_checksum and checksum_history tables.
|
cleanup, cleanup, cleanup, cleanuppublic static final int SENTINEL
next() to indicate that
there are no more values.public static final String GET_OLDEST_BITSTREAM
public static final String GET_OLDEST_BITSTREAM_ORACLE
public static final String GET_OLDEST_BITSTREAM_DATE
public static final String GET_OLDEST_BITSTREAM_DATE_ORACLE
public void update(BitstreamInfo info)
info - The BitstreamInfo to update.IllegalArgumentException - if the BitstreamInfo given is null.public BitstreamInfo findByBitstreamId(int id)
id - the bitstream idpublic void updateMissingBitstreams()
protected int deleteBitstreamInfo(int id,
Connection conn)
id - the bitstream id.public int deleteBitstreamInfoWithHistory(int id)
public int getOldestBitstream()
public int getOldestBitstream(Timestamp lessThanDate)
lessThanDate - public List<Integer> getItemBitstreams(int itemId)
itemId - public List<Integer> getCollectionBitstreams(int collectionId)
collectionId - The id of the collectionCopyright © 2013 DuraSpace. All Rights Reserved.