|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.Trashcan
public class Trashcan
This class contains functionality to manage items that have been marked for deletion.
Field Summary | |
---|---|
private static boolean |
isDebug
|
private static Logger |
log
Log trashcan events. |
Constructor Summary | |
---|---|
Trashcan()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Logger log
private static final boolean isDebug
Constructor Detail |
---|
public Trashcan()
Method Detail |
---|
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 items
BaseException
- 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 databaseitems
- The items to removeignoreFlag
- TRUE to also remove items that hasn't been flagged for removalprogress
- An optional progress reporter
BaseException
- 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
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |