@Transactional public class DeleteBean extends AbstractLevel2Service implements ome.api.IDelete
IDelete
service interface which will use
the SecuritySystem
via
SecuritySystem.runAsAdmin(AdminAction)
to forcibly
delete instances.IDelete
Modifier and Type | Field and Description |
---|---|
protected LocalAdmin |
admin |
static java.lang.String |
CHANNELID_QUERY |
static java.lang.String |
IMAGE_QUERY
Loads an
Image graph including: Pixels, Channel, LogicalChannel,
StatsInfo, PlaneInfo, Thumbnails, file maps, OriginalFiles, and Settings |
static org.slf4j.Logger |
log |
static java.lang.String |
PLATEIMAGES_QUERY |
static java.lang.String |
SETTINGSID_QUERY |
protected SessionFactory |
sf |
iQuery, iUpdate, metadata, queryFactory, readOnlyStatus, sec
Constructor and Description |
---|
DeleteBean(LocalAdmin admin,
SessionFactory sf) |
Modifier and Type | Method and Description |
---|---|
java.util.List<ome.model.IObject> |
checkImageDelete(long id,
boolean force) |
protected void |
collect(ome.services.delete.UnloadedCollector delete,
ome.model.core.Image i)
Walks the
Image graph collecting unloaded instances of all
entities for later delete. |
void |
deleteChannels(long imageId) |
void |
deleteImage(long id,
boolean force) |
void |
deleteImages(java.util.Set<java.lang.Long> ids,
boolean force) |
void |
deleteImagesByDataset(long datasetId,
boolean force) |
void |
deletePlate(long plateId) |
void |
deleteSettings(long imageId) |
protected void |
getImageAndCount(ome.model.core.Image[] images,
long id,
ome.services.delete.UnloadedCollector delete)
Uses the locally defined query to load an
Image and calls
collect(UnloadedCollector, Image) in order to define a list of
what will be deleted. |
java.lang.Class<? extends ome.api.ServiceInterface> |
getServiceInterface() |
java.util.List<ome.model.IObject> |
previewImageDelete(long id,
boolean force)
This uses
IMAGE_QUERY to load all the subordinate metadata of the
Image which will be deleted. |
getBeanHelper, getExtendedMetadata, getQueryFactory, getSecuritySystem, selfConfigure, setExtendedMetadata, setQueryFactory, setQueryService, setReadOnlyStatus, setSecuritySystem, setUpdateService
public static final org.slf4j.Logger log
public static final java.lang.String IMAGE_QUERY
Image
graph including: Pixels, Channel, LogicalChannel,
StatsInfo, PlaneInfo, Thumbnails, file maps, OriginalFiles, and Settingspublic static final java.lang.String SETTINGSID_QUERY
public static final java.lang.String CHANNELID_QUERY
public static final java.lang.String PLATEIMAGES_QUERY
protected final LocalAdmin admin
protected final SessionFactory sf
public DeleteBean(LocalAdmin admin, SessionFactory sf)
public final java.lang.Class<? extends ome.api.ServiceInterface> getServiceInterface()
getServiceInterface
in interface ome.system.SelfConfigurableService
public java.util.List<ome.model.IObject> checkImageDelete(long id, boolean force)
checkImageDelete
in interface ome.api.IDelete
public java.util.List<ome.model.IObject> previewImageDelete(long id, boolean force)
IMAGE_QUERY
to load all the subordinate metadata of the
Image
which will be deleted.previewImageDelete
in interface ome.api.IDelete
public void deleteImage(long id, boolean force) throws ome.conditions.SecurityViolation, ome.conditions.ValidationException
deleteImage
in interface ome.api.IDelete
ome.conditions.SecurityViolation
ome.conditions.ValidationException
public void deleteImages(java.util.Set<java.lang.Long> ids, boolean force) throws ome.conditions.SecurityViolation, ome.conditions.ValidationException, ome.conditions.ApiUsageException
deleteImages
in interface ome.api.IDelete
ome.conditions.SecurityViolation
ome.conditions.ValidationException
ome.conditions.ApiUsageException
public void deleteImagesByDataset(long datasetId, boolean force) throws ome.conditions.SecurityViolation, ome.conditions.ValidationException, ome.conditions.ApiUsageException
deleteImagesByDataset
in interface ome.api.IDelete
ome.conditions.SecurityViolation
ome.conditions.ValidationException
ome.conditions.ApiUsageException
public void deleteSettings(long imageId)
deleteSettings
in interface ome.api.IDelete
public void deleteChannels(long imageId)
public void deletePlate(long plateId)
deletePlate
in interface ome.api.IDelete
protected void getImageAndCount(ome.model.core.Image[] images, long id, ome.services.delete.UnloadedCollector delete)
Image
and calls
collect(UnloadedCollector, Image)
in order to define a list of
what will be deleted.
This method fulfills the previewImageDelete(long, boolean)
contract and as such is used by deleteImage(long, boolean)
in
order to fulfill its contract.protected void collect(ome.services.delete.UnloadedCollector delete, ome.model.core.Image i)
Image
graph collecting unloaded instances of all
entities for later delete.