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 theIDeleteservice interface which will use theSecuritySystemviaSecuritySystem.runAsAdmin(AdminAction)to forcibly delete instances.- Since:
- 3.0-Beta3
- See Also:
IDelete
-
-
Field Summary
Fields Modifier and Type Field Description protected LocalAdminadminstatic java.lang.StringCHANNELID_QUERYstatic java.lang.StringIMAGE_QUERYLoads anImagegraph including: Pixels, Channel, LogicalChannel, StatsInfo, PlaneInfo, Thumbnails, file maps, OriginalFiles, and Settingsstatic org.slf4j.Loggerlogstatic java.lang.StringPLATEIMAGES_QUERYstatic java.lang.StringSETTINGSID_QUERYprotected SessionFactorysf-
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 voidcollect(ome.services.delete.UnloadedCollector delete, ome.model.core.Image i)Walks theImagegraph collecting unloaded instances of all entities for later delete.voiddeleteChannels(long imageId)voiddeleteImage(long id, boolean force)voiddeleteImages(java.util.Set<java.lang.Long> ids, boolean force)voiddeleteImagesByDataset(long datasetId, boolean force)voiddeletePlate(long plateId)voiddeleteSettings(long imageId)protected voidgetImageAndCount(ome.model.core.Image[] images, long id, ome.services.delete.UnloadedCollector delete)Uses the locally defined query to load anImageand 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_QUERYto load all the subordinate metadata of theImagewhich 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 anImagegraph 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:
getServiceInterfacein interfaceome.system.SelfConfigurableService
-
checkImageDelete
public java.util.List<ome.model.IObject> checkImageDelete(long id, boolean force)- Specified by:
checkImageDeletein interfaceome.api.IDelete
-
previewImageDelete
public java.util.List<ome.model.IObject> previewImageDelete(long id, boolean force)This usesIMAGE_QUERYto load all the subordinate metadata of theImagewhich will be deleted.- Specified by:
previewImageDeletein interfaceome.api.IDelete
-
deleteImage
public void deleteImage(long id, boolean force) throws ome.conditions.SecurityViolation, ome.conditions.ValidationException- Specified by:
deleteImagein interfaceome.api.IDelete- Throws:
ome.conditions.SecurityViolationome.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:
deleteImagesin interfaceome.api.IDelete- Throws:
ome.conditions.SecurityViolationome.conditions.ValidationExceptionome.conditions.ApiUsageException
-
deleteImagesByDataset
public void deleteImagesByDataset(long datasetId, boolean force) throws ome.conditions.SecurityViolation, ome.conditions.ValidationException, ome.conditions.ApiUsageException- Specified by:
deleteImagesByDatasetin interfaceome.api.IDelete- Throws:
ome.conditions.SecurityViolationome.conditions.ValidationExceptionome.conditions.ApiUsageException
-
deleteSettings
public void deleteSettings(long imageId)
- Specified by:
deleteSettingsin interfaceome.api.IDelete
-
deleteChannels
public void deleteChannels(long imageId)
-
deletePlate
public void deletePlate(long plateId)
- Specified by:
deletePlatein 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 anImageand 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 theImagegraph collecting unloaded instances of all entities for later delete.
-
-