public class Trashcan extends Object
Modifier and Type | Field and Description |
---|---|
private static boolean |
isDebug |
private static org.slf4j.Logger |
log
Log trashcan events.
|
Constructor and Description |
---|
Trashcan() |
Modifier and Type | Method and Description |
---|---|
static int |
delete(SessionControl sc,
Collection<? extends Identifiable> items,
boolean ignoreFlag,
ProgressReporter progress)
Delete items permanently.
|
static int |
deleteAll(SessionControl sc,
ProgressReporter progress)
Delete all items in the trashcan of the logged in user.
|
static ResultList<Removable> |
getItems(DbControl dc,
Item itemType,
int firstItem,
int maxItems) |
static ResultList<Removable> |
getItems(DbControl dc,
Set<Item> itemTypes,
int firstItem,
int maxItems)
Load all items flagged for deletion that are owned by the logged in user.
|
private static final org.slf4j.Logger log
private static final boolean isDebug
public static ResultList<Removable> getItems(DbControl dc, Item itemType, int firstItem, int maxItems) throws BaseException
BaseException
getItems(DbControl, Set, int, int)
public static ResultList<Removable> getItems(DbControl dc, Set<Item> itemTypes, int firstItem, int maxItems) throws BaseException
dc
- The DbControl
to use for database accessitemTypes
- Limit the list to only return items of the types,
included in the set, use null or an empty set to return items of all typesfirstItem
- The index of the first item to return (0-based)maxItems
- The maximum number of items to return, or 0 to return all itemsBaseException
- If there is an error of some kindpublic static int delete(SessionControl sc, Collection<? extends Identifiable> items, boolean ignoreFlag, ProgressReporter progress) throws BaseException
sc
- The session control to use for connecting to the database. To
avoid multithread-related problems the session control is cloned
before being used by this method.items
- The items to removeignoreFlag
- TRUE to also remove items that hasn't been flagged for removalprogress
- An optional progress reporterBaseException
- If an item can't be deleted.public static int deleteAll(SessionControl sc, ProgressReporter progress)
getItems(DbControl, Item, int, int)
to load all items
that have been flagged for removal and then
delete(SessionControl, Collection, boolean, ProgressReporter)
to remove those items. See the delete
for
more information about transactions.sc
- The session control to use for connecting to the databaseprogress
- An optional progress reporter