Package ome.services.delete
Class DeleteBean
- java.lang.Object
-
- ome.logic.AbstractLevel2Service
-
- ome.services.delete.DeleteBean
-
- All Implemented Interfaces:
ome.api.IDelete
,ome.api.ServiceInterface
,ome.system.SelfConfigurableService
@Transactional public class DeleteBean extends AbstractLevel2Service implements ome.api.IDelete
Strict implementation of theIDelete
service interface which will use theSecuritySystem
viaSecuritySystem.runAsAdmin(AdminAction)
to forcibly delete instances.- Since:
- 3.0-Beta3
- See Also:
IDelete
-
-
Field Summary
Fields Modifier and Type Field Description protected LocalAdmin
admin
static java.lang.String
CHANNELID_QUERY
static java.lang.String
IMAGE_QUERY
Loads anImage
graph including: Pixels, Channel, LogicalChannel, StatsInfo, PlaneInfo, Thumbnails, file maps, OriginalFiles, and Settingsstatic org.slf4j.Logger
log
static java.lang.String
PLATEIMAGES_QUERY
static java.lang.String
SETTINGSID_QUERY
protected SessionFactory
sf
-
Fields inherited from class ome.logic.AbstractLevel2Service
iQuery, iUpdate, metadata, queryFactory, readOnlyStatus, sec
-
-
Constructor Summary
Constructors Constructor Description DeleteBean(LocalAdmin admin, SessionFactory sf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 theImage
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 anImage
and callscollect(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 usesIMAGE_QUERY
to load all the subordinate metadata of theImage
which will be deleted.-
Methods inherited from class ome.logic.AbstractLevel2Service
getBeanHelper, getExtendedMetadata, getQueryFactory, getSecuritySystem, selfConfigure, setExtendedMetadata, setQueryFactory, setQueryService, setReadOnlyStatus, setSecuritySystem, setUpdateService
-
-
-
-
Field Detail
-
log
public static final org.slf4j.Logger log
-
IMAGE_QUERY
public static final java.lang.String IMAGE_QUERY
Loads anImage
graph including: Pixels, Channel, LogicalChannel, StatsInfo, PlaneInfo, Thumbnails, file maps, OriginalFiles, and Settings- See Also:
- Constant Field Values
-
SETTINGSID_QUERY
public static final java.lang.String SETTINGSID_QUERY
- See Also:
- Constant Field Values
-
CHANNELID_QUERY
public static final java.lang.String CHANNELID_QUERY
- See Also:
- Constant Field Values
-
PLATEIMAGES_QUERY
public static final java.lang.String PLATEIMAGES_QUERY
- See Also:
- Constant Field Values
-
admin
protected final LocalAdmin admin
-
sf
protected final SessionFactory sf
-
-
Constructor Detail
-
DeleteBean
public DeleteBean(LocalAdmin admin, SessionFactory sf)
-
-
Method Detail
-
getServiceInterface
public final java.lang.Class<? extends ome.api.ServiceInterface> getServiceInterface()
- Specified by:
getServiceInterface
in interfaceome.system.SelfConfigurableService
-
checkImageDelete
public java.util.List<ome.model.IObject> checkImageDelete(long id, boolean force)
- Specified by:
checkImageDelete
in interfaceome.api.IDelete
-
previewImageDelete
public java.util.List<ome.model.IObject> previewImageDelete(long id, boolean force)
This usesIMAGE_QUERY
to load all the subordinate metadata of theImage
which will be deleted.- Specified by:
previewImageDelete
in interfaceome.api.IDelete
-
deleteImage
public void deleteImage(long id, boolean force) throws ome.conditions.SecurityViolation, ome.conditions.ValidationException
- Specified by:
deleteImage
in interfaceome.api.IDelete
- Throws:
ome.conditions.SecurityViolation
ome.conditions.ValidationException
-
deleteImages
public void deleteImages(java.util.Set<java.lang.Long> ids, boolean force) throws ome.conditions.SecurityViolation, ome.conditions.ValidationException, ome.conditions.ApiUsageException
- Specified by:
deleteImages
in interfaceome.api.IDelete
- Throws:
ome.conditions.SecurityViolation
ome.conditions.ValidationException
ome.conditions.ApiUsageException
-
deleteImagesByDataset
public void deleteImagesByDataset(long datasetId, boolean force) throws ome.conditions.SecurityViolation, ome.conditions.ValidationException, ome.conditions.ApiUsageException
- Specified by:
deleteImagesByDataset
in interfaceome.api.IDelete
- Throws:
ome.conditions.SecurityViolation
ome.conditions.ValidationException
ome.conditions.ApiUsageException
-
deleteSettings
public void deleteSettings(long imageId)
- Specified by:
deleteSettings
in interfaceome.api.IDelete
-
deleteChannels
public void deleteChannels(long imageId)
-
deletePlate
public void deletePlate(long plateId)
- Specified by:
deletePlate
in interfaceome.api.IDelete
-
getImageAndCount
protected void getImageAndCount(ome.model.core.Image[] images, long id, ome.services.delete.UnloadedCollector delete)
Uses the locally defined query to load anImage
and callscollect(UnloadedCollector, Image)
in order to define a list of what will be deleted. This method fulfills thepreviewImageDelete(long, boolean)
contract and as such is used bydeleteImage(long, boolean)
in order to fulfill its contract.
-
collect
protected void collect(ome.services.delete.UnloadedCollector delete, ome.model.core.Image i)
Walks theImage
graph collecting unloaded instances of all entities for later delete.
-
-