Package net.sf.basedb.core
Interface Removable
- All Superinterfaces:
AccessControlled
,Identifiable
- All Known Implementing Classes:
AnnotatedItem
,AnnotationType
,AnnotationTypeCategory
,ArrayBatch
,ArrayDesign
,ArraySlide
,BioAssaySet
,BioMaterial
,BioPlate
,BioPlateEvent
,BioPlateEventType
,BioPlateType
,BioSource
,Client
,CommonItem
,DataFileType
,DerivedBioAssay
,Directory
,Experiment
,Extract
,ExtraValueType
,File
,FileServer
,Formula
,Group
,Hardware
,ItemList
,ItemSubtype
,Job
,JobAgent
,Kit
,MeasuredBioMaterial
,Message
,MimeType
,News
,PermissionTemplate
,PhysicalBioAssay
,Plate
,PlateEventType
,PlateGeometry
,PlateMapping
,PlateType
,Platform
,PlatformVariant
,PluginConfiguration
,PluginDefinition
,PluginType
,Project
,Protocol
,Quantity
,Quota
,RawBioAssay
,ReporterCloneTemplate
,ReporterList
,ReporterType
,Role
,Sample
,Software
,Tag
,Transformation
,Unit
,User
A
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); }
- Version:
- 2.0
- Author:
- Nicklas
- Last modified
- $Date: 2015-11-18 09:08:17 +0100 (on, 18 nov 2015) $
-
Method Summary
Modifier and TypeMethodDescriptionGet the user that flagged this item for removal.boolean
Check if the removed flag is set for this item.void
setRemoved
(boolean removed) Set the removed flag for this item.Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getType, getVersion
-
Method Details
-
isRemoved
boolean isRemoved()Check if the removed flag is set for this item.- Returns:
- TRUE if the item is flagged as removed, FALSE otherwise
-
setRemoved
Set the removed flag for this item.- Parameters:
removed
- TRUE if the item should be flagged as removed, FALSE otherwise- Throws:
PermissionDeniedException
- If the logged in user doesn't havePermission.DELETE
permission for setting the flag to TRUE orPermission.WRITE
permission for setting the flag to FALSE
-
getRemovedBy
Get the user that flagged this item for removal.- Returns:
- A User object, or null if this item has not been flagged
- Throws:
PermissionDeniedException
- If the logged in user doesn't havePermission.READ
permission for the userItemNotFoundException
- If the user that removed this item can't be found- Since:
- 3.7
-