public interface Removable extends Identifiable
Removable
item is an item that can be flagged
as removed. This doesn't generally remove the information about the
item from the database, but can be used by client applications
to hide items that the user is not interested in.
For example, all methods generating lists of items, will by default not include those that are flagged as removed.
At regular intervals, a cleanup application is checking the database for items that are flagged to be removed and deletes them permanently.
Reference implementation
public boolean isRemoved() { return getData().isRemoved(); } public void setRemoved(boolean removed) throws PermissionDeniedException { checkPermission(removed ? Permission.DELETE : Permission.WRITE); getData().setRemoved(removed); }
Modifier and Type | Method and Description |
---|---|
User |
getRemovedBy()
Get the user that flagged this item for removal.
|
boolean |
isRemoved()
Check if the removed flag is set for this item.
|
void |
setRemoved(boolean removed)
Set the removed flag for this item.
|
getId, getType, getVersion
checkPermission, getPermissions, hasPermission
boolean isRemoved()
void setRemoved(boolean removed) throws PermissionDeniedException
removed
- TRUE if the item should be flagged as removed,
FALSE otherwisePermissionDeniedException
- If the logged in user doesn't
have Permission.DELETE
permission for setting the flag
to TRUE or Permission.WRITE
permission for setting the
flag to FALSEUser getRemovedBy() throws PermissionDeniedException, ItemNotFoundException
PermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission for the userItemNotFoundException
- If the user that removed this item
can't be found