Package ome.api
Interface IDelete
-
- All Superinterfaces:
ServiceInterface
public interface IDelete extends ServiceInterface
Provides simplifed methods for deleting instances from the database. Various policies may exist for delete and so it is important to consult the implementation documentation to know what types will be deleted by force (using admin privileges) or alternatively throw an exception due to constraint violations.- Since:
- 3.0-Beta3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<ome.model.IObject>checkImageDelete(long id, boolean force)Returns all entities which would prevent the givenImageid from being deleted.voiddeleteImage(long id, boolean force)Deletes anImageand all related (subordinate) metadata as defined below.voiddeleteImages(java.util.Set<java.lang.Long> ids, boolean force)Deletes severalImageinstances within a single transaction via thedeleteImage(long, boolean)method.voiddeleteImagesByDataset(long datasetId, boolean force)Deletes the user-visibleImageinstances of the givenDatasetwithin a single transaction via thedeleteImage(long, boolean).voiddeletePlate(long plateId)Deletes all the images contained in a plate as if deleted by:deleteImage(id, true)so that all Dataset and Annotation links are broken, with WellSamples removed first.voiddeleteSettings(long pixelId)Deletes all rendering settings for the given Pixel id.java.util.List<ome.model.IObject>previewImageDelete(long id, boolean force)Returns all entities which would be deleted by a call todeleteImage(long, boolean).
-
-
-
Method Detail
-
checkImageDelete
java.util.List<ome.model.IObject> checkImageDelete(long id, boolean force)Returns all entities which would prevent the givenImageid from being deleted. The force boolean determines whether or not the user's collections should be removed in order to facilitate the delete. Currently this only includesdatasets. The force boolean determines ifDatasetinstances from the same user will be considered as constraints. Regardless of force, datasets from other users are considered constraints.- Parameters:
id- of theImageto be deleted.force- return value will be included- Returns:
- unloaded entity list
-
previewImageDelete
java.util.List<ome.model.IObject> previewImageDelete(long id, boolean force)Returns all entities which would be deleted by a call todeleteImage(long, boolean).- Parameters:
id-force-- Returns:
- unloaded entity list
-
deleteImage
void deleteImage(long id, boolean force) throws ome.conditions.SecurityViolation, ome.conditions.ValidationException, ome.conditions.ApiUsageExceptionDeletes anImageand all related (subordinate) metadata as defined below. This method callscheckImageDelete(long, boolean)and throws aConstraintViolationExceptionwith the results of that call are not empty; then it forcibly deletes all objects returned bypreviewImageDelete(long, boolean)The deleted metadata includes all of the following types which belong to the current user:
PixelsPlaneInfoRenderingDefOriginalFileImageAnnotationLink
Imagedata graph will be considered corrupted and aValidationExceptionwill be thrown.For the types:
Thumbnail
If the
An image will not be deleted if it is contained in aImageis not owned by the current user, thenSecurityViolationis thrown, unless the user is root or the group leader.Datasetowned by another user. If theImageis contained in otherdatasetsbelonging to the same user, then the force parameter decides what will happen. A force value of true implies that theImagewill be removed as well as the relatedlinks. ThePixels.getRelatedTo()field will be set to null for allPixelspointing to aPixelsinstance which is about to be deleted.- Parameters:
id- id of theImageto be deletedforce-Imagewill be removed even if contained in otherdatasets. If false, aConstraintViolationExceptionwill be raised.- Throws:
ome.conditions.ValidationException- throws an exception if there is any unexpected object which prevents this object from being deleted, i.e. not incheckImageDelete(long, boolean)(check first)ome.conditions.ApiUsageException- if the object has constraints. UsecheckImageDelete(long, boolean)first in order to verify that there are no constraints.ome.conditions.SecurityViolation- If theImagedoes not belong to the current user.
-
deleteImages
void deleteImages(java.util.Set<java.lang.Long> ids, boolean force) throws ome.conditions.SecurityViolation, ome.conditions.ValidationException, ome.conditions.ApiUsageExceptionDeletes severalImageinstances within a single transaction via thedeleteImage(long, boolean)method.- Parameters:
ids- AsdeleteImage(long, boolean)force- AsdeleteImage(long, boolean)- Throws:
ome.conditions.ValidationException- AsdeleteImage(long, boolean)ome.conditions.ApiUsageException- AsdeleteImage(long, boolean)ome.conditions.SecurityViolation- AsdeleteImage(long, boolean)
-
deleteImagesByDataset
void deleteImagesByDataset(long datasetId, boolean force) throws ome.conditions.SecurityViolation, ome.conditions.ValidationException, ome.conditions.ApiUsageExceptionDeletes the user-visibleImageinstances of the givenDatasetwithin a single transaction via thedeleteImage(long, boolean). In addition, beforeImagedeletion is attempted, thelinksto the givenDatasetare first removed, otherwise this method would always require a "force" argument of true.- Parameters:
datasetId- AsdeleteImage(long, boolean)force- AsdeleteImage(long, boolean)- Throws:
ome.conditions.ValidationException- AsdeleteImage(long, boolean)ome.conditions.ApiUsageException- AsdeleteImage(long, boolean)ome.conditions.SecurityViolation- AsdeleteImage(long, boolean)
-
deleteSettings
void deleteSettings(long pixelId)
Deletes all rendering settings for the given Pixel id. This removes all the same objects that deleteImage() would delete below the given Pixels
-
deletePlate
void deletePlate(long plateId)
Deletes all the images contained in a plate as if deleted by:deleteImage(id, true)so that all Dataset and Annotation links are broken, with WellSamples removed first. Then all Wells in the Plate and the Plate itself are removed. WellAnnotationLinks, and PlateAnnotationLinks are deleted as necessary.- Parameters:
plateId-
-
-