2.17.2: 2011-06-17

net.sf.basedb.core
Interface Removable

All Superinterfaces:
AccessControlled, Identifiable
All Known Implementing Classes:
AnnotatedItem, AnnotationType, AnnotationTypeCategory, ArrayBatch, ArrayDesign, ArraySlide, BioAssaySet, BioMaterial, BioMaterialList, BioPlate, BioPlateEvent, BioPlateEventType, BioPlateType, BioSource, Client, CommonItem, DataFileType, Directory, Experiment, Extract, ExtraValueType, File, FileServer, Formula, Group, Hardware, HardwareType, Hybridization, Image, Job, JobAgent, Label, LabeledExtract, MeasuredBioMaterial, Message, MimeType, News, PermissionTemplate, Plate, PlateEventType, PlateGeometry, PlateMapping, PlateType, Platform, PlatformVariant, PluginConfiguration, PluginDefinition, PluginType, Project, Protocol, ProtocolType, Quantity, Quota, RawBioAssay, ReporterList, ReporterType, Role, Sample, Scan, Software, Transformation, Unit, User

public interface Removable
extends Identifiable

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: 2009-04-06 14:52:39 +0200 (Mon, 06 Apr 2009) $

Method Summary
 boolean isRemoved()
          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.Identifiable
getId, getType, getVersion
 
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
 

Method Detail

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

void setRemoved(boolean removed)
                throws PermissionDeniedException
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 have Permission.DELETE permission for setting the flag to TRUE or Permission.WRITE permission for setting the flag to FALSE

2.17.2: 2011-06-17