|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.util.AbstractIteratorUtil
org.entityfs.util.IteratorDeleter
public class IteratorDeleter
Delete the entities returned from an Iterator
. If a non-empty
directory is returned from the iterator, it is not deleted. If deleting
entire entity hierarchies, make sure to use a DepthFirstIterator
so
that the directories returned from the iterator are empty.
The deleter locks entities and parent entities as needed, but it never holds
any locks between two copy operations. (In other words: when it calls next
on the iterator, it does not hold any locks.)
An optional ErrorHandlingStrategy
can be used to deal with errors.
The default strategy when an exception is caught is to abort the delete
operation and rethrow the exception.
EntityFS iterators are not thread safe. Don't use them concurrently from several threads without synchronizing access to them.
Entities.deleteRecursively(EntityView)
,
Entities.deleteRecursively(EntityView, boolean)
Constructor Summary | |
---|---|
IteratorDeleter(EntityListable el)
Create an IteratorDeleter that recursively deletes the contents
of the directory view. |
|
IteratorDeleter(EntityListable el,
ErrorHandlingStrategy errorStrategy)
Create an IteratorDeleter that recursively deletes the contents
of the directory view. |
|
IteratorDeleter(Iterator<? extends EntityView> itr)
Delete all entities returned from the iterator and use the default error strategy (see above). |
|
IteratorDeleter(Iterator<? extends EntityView> itr,
ErrorHandlingStrategy errorStrategy)
Delete all entities returned from the iterator and use the supplied error strategy. |
Method Summary | |
---|---|
void |
delete()
Delete all entities returned from the Iterator supplied when
creating this object. |
void |
deleteEntities()
This method calls delete() . |
Methods inherited from class org.entityfs.util.AbstractIteratorUtil |
---|
letErrorStrategyHandle, letErrorStrategyHandle, letErrorStrategyHandle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IteratorDeleter(Iterator<? extends EntityView> itr)
itr
- The iterator that returns entities to delete. Use a
DepthFirstIterator
if deleting entity hierarchies.public IteratorDeleter(Iterator<? extends EntityView> itr, ErrorHandlingStrategy errorStrategy)
itr
- The iterator that returns entities to delete. Use a
DepthFirstIterator
if deleting entity hierarchies.errorStrategy
- The error handling strategy.public IteratorDeleter(EntityListable el)
IteratorDeleter
that recursively deletes the contents
of the directory view. The directory itself is not deleted. The
default error strategy is used (see above).
el
- The entity listable to delete the contents of. If this is a
directory view, only the entities that are visible in the view are
deleted.public IteratorDeleter(EntityListable el, ErrorHandlingStrategy errorStrategy)
IteratorDeleter
that recursively deletes the contents
of the directory view. The directory itself is not deleted. The
supplied error strategy is used.
el
- The entity listable to delete contents in. If this is a
directory view, only the entities that are visible in the view are
deleted.errorStrategy
- The error handling strategy.Method Detail |
---|
public void delete() throws UncheckedInterruptedException
Iterator
supplied when
creating this object.
UncheckedInterruptedException
- If the delete operation was
interrupted.deleteEntities()
public void deleteEntities() throws UncheckedInterruptedException
delete()
. It can be called by JavaScript
scripts that cannot call delete
directly (since that is a
reserved word in JavaScript).
UncheckedInterruptedException
- If the delete operation was
interrupted.delete()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |