Package fr.igred.omero
Class AnnotatableWrapper<T extends DataObject>
- java.lang.Object
- 
- fr.igred.omero.GenericObjectWrapper<T>
- 
- fr.igred.omero.AnnotatableWrapper<T>
 
 
- 
- Type Parameters:
- T- Subclass of- DataObject
 - Direct Known Subclasses:
- GenericRepositoryObjectWrapper,- GenericShapeWrapper,- ROIWrapper
 
 public abstract class AnnotatableWrapper<T extends DataObject> extends GenericObjectWrapper<T> Generic class containing a DataObject (or a subclass) object.
- 
- 
Field Summary- 
Fields inherited from class fr.igred.omero.GenericObjectWrapperdata
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedAnnotatableWrapper(T o)Constructor of the class GenericRepositoryObjectWrapper.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description longaddAndReplaceFile(Client client, File file)Uploads a file, links it to the object and unlinks previous files with the same name, or deletes them if they're orphaned.longaddAndReplaceFile(Client client, File file, GenericRepositoryObjectWrapper.ReplacePolicy policy)Uploads a file, links it to the object and unlinks or deletes previous files with the same name.voidaddAndReplaceTable(Client client, TableWrapper table)Adds a table to the object in OMERO and unlinks previous tables with the same name, or deletes them if they're orphaned.voidaddAndReplaceTable(Client client, TableWrapper table, GenericRepositoryObjectWrapper.ReplacePolicy policy)Adds a table to the object in OMERO and unlinks or deletes previous tables with the same name.longaddFile(Client client, File file)Uploads a file and links it to the objectvoidaddFileAnnotation(Client client, FileAnnotationWrapper annotation)Deprecated.Links a file annotation to the object.voidaddKeyValuePair(Client client, String key, String value)Adds a single Key-Value pair to the object.voidaddMapAnnotation(Client client, MapAnnotationWrapper mapAnnotation)Deprecated.Adds a List of Key-Value pair to the object.voidaddPairKeyValue(Client client, String key, String value)Deprecated.Adds a single Key-Value pair to the object.voidaddTable(Client client, TableWrapper table)Adds a table to the object in OMERO.voidaddTag(Client client, TagAnnotationWrapper tag)Deprecated.Adds a tag to the object in OMERO, if possible.voidaddTag(Client client, Long id)Adds a tag to the object in OMERO, if possible.voidaddTag(Client client, String name, String description)Adds a newly created tag to the object in OMERO, if possible.voidaddTags(Client client, TagAnnotationWrapper... tags)Deprecated.Adds multiple tag to the object in OMERO, if possible.voidaddTags(Client client, Long... ids)Adds multiple tags by ID to the object in OMERO, if possible.protected abstract StringannotationLinkType()Returns the type of annotation link for this object.voidcopyAnnotationLinks(Client client, AnnotatableWrapper<?> object)Copies annotation links from some other object to this one.AnnotationListgetAnnotations(Client client)Retrieves annotations linked to the object (of known types).List<FileAnnotationWrapper>getFileAnnotations(Client client)Returns the file annotationsMap<String,String>getKeyValuePairs(Client client)Gets the List of key-value pairs associated to an object as a map (no duplicate key should exist).List<MapAnnotationWrapper>getMapAnnotations(Client client)Gets all map annotations linked to an object in OMERO, if possible.intgetMyRating(Client client)Returns the user rating for this object (averaged if multiple ratings are linked).TableWrappergetTable(Client client, Long fileId)Gets a certain table linked to the object in OMERO.List<TableWrapper>getTables(Client client)Gets all tables linked to the object in OMERO.List<TagAnnotationWrapper>getTags(Client client)Gets all tags linked to an object in OMERO, if possible.StringgetValue(Client client, String key)Gets the value from a Key-Value pair associated to the object.<A extends GenericAnnotationWrapper<?>>
 booleanisLinked(Client client, A annotation)Checks if a specific annotation is linked to the object.protected <A extends AnnotationData>
 voidlink(Client client, A annotation)Attach anAnnotationDatato this object.voidlink(Client client, GenericAnnotationWrapper<?>... annotations)Adds multiple annotations to the object in OMERO, if possible.voidlinkIfNotLinked(Client client, GenericAnnotationWrapper<?>... annotations)Adds multiple annotations to the object in OMERO if they are not already linked.voidrate(Client client, int rating)Rates the object (using a rating annotation).protected voidremoveLink(Client client, String linkType, long childId)Removes the link of the given type with the given child ID.<A extends GenericAnnotationWrapper<?>>
 voidunlink(Client client, A annotation)Unlinks the given annotation from the current object.- 
Methods inherited from class fr.igred.omero.GenericObjectWrapperasDataObject, canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, delete, distinct, flatten, getCreated, getGroupId, getId, getOwner, saveAndUpdate, toString, wrap, wrap
 
- 
 
- 
- 
- 
Constructor Detail- 
AnnotatableWrapperprotected AnnotatableWrapper(T o) Constructor of the class GenericRepositoryObjectWrapper.- Parameters:
- o- The annotatable DataObject to wrap in the GenericRepositoryObjectWrapper.
 
 
- 
 - 
Method Detail- 
annotationLinkTypeprotected abstract String annotationLinkType() Returns the type of annotation link for this object.- Returns:
- See above.
 
 - 
isLinkedpublic <A extends GenericAnnotationWrapper<?>> boolean isLinked(Client client, A annotation) throws ServiceException, AccessException, ExecutionException Checks if a specific annotation is linked to the object.- Type Parameters:
- A- The type of the annotation.
- Parameters:
- client- The client handling the connection.
- annotation- Annotation to be checked.
- Returns:
- True if the object is linked to the given annotation, false otherwise.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
linkprotected <A extends AnnotationData> void link(Client client, A annotation) throws ServiceException, AccessException, ExecutionException Attach anAnnotationDatato this object.- Type Parameters:
- A- The type of the annotation.
- Parameters:
- client- The client handling the connection.
- annotation- The- AnnotationData.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
linkpublic <A extends GenericAnnotationWrapper<?>> void link(Client client, A annotation) throws ServiceException, AccessException, ExecutionException Adds an annotation to the object in OMERO, if possible.- Type Parameters:
- A- The type of the annotation.
- Parameters:
- client- The client handling the connection.
- annotation- Annotation to be added.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
linkpublic void link(Client client, GenericAnnotationWrapper<?>... annotations) throws ServiceException, AccessException, ExecutionException Adds multiple annotations to the object in OMERO, if possible.- Parameters:
- client- The client handling the connection.
- annotations- Annotations to add.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
linkIfNotLinkedpublic void linkIfNotLinked(Client client, GenericAnnotationWrapper<?>... annotations) throws ServiceException, AccessException, ExecutionException Adds multiple annotations to the object in OMERO if they are not already linked.- Parameters:
- client- The client handling the connection.
- annotations- Annotations to add.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
addTagpublic void addTag(Client client, String name, String description) throws ServiceException, AccessException, ExecutionException Adds a newly created tag to the object in OMERO, if possible.- Parameters:
- client- The client handling the connection.
- name- Tag Name.
- description- Tag description.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
addTag@Deprecated public void addTag(Client client, TagAnnotationWrapper tag) throws ServiceException, AccessException, ExecutionException Deprecated.Adds a tag to the object in OMERO, if possible. Uselink(fr.igred.omero.Client, A)instead.- Parameters:
- client- The client handling the connection.
- tag- Tag to be added.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
addTagpublic void addTag(Client client, Long id) throws ServiceException, AccessException, ExecutionException Adds a tag to the object in OMERO, if possible.- Parameters:
- client- The client handling the connection.
- id- ID of the tag to add to the object.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
addTags@Deprecated public void addTags(Client client, TagAnnotationWrapper... tags) throws ServiceException, AccessException, ExecutionException Deprecated.Adds multiple tag to the object in OMERO, if possible. Uselink(Client, GenericAnnotationWrapper[])instead.- Parameters:
- client- The client handling the connection.
- tags- Array of tag annotations to add.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
addTagspublic void addTags(Client client, Long... ids) throws ServiceException, AccessException, ExecutionException Adds multiple tags by ID to the object in OMERO, if possible.- Parameters:
- client- The client handling the connection.
- ids- Array of tag id in OMERO to add.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
getTagspublic List<TagAnnotationWrapper> getTags(Client client) throws ServiceException, AccessException, ExecutionException Gets all tags linked to an object in OMERO, if possible.- Parameters:
- client- The client handling the connection.
- Returns:
- See above.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
getMapAnnotationspublic List<MapAnnotationWrapper> getMapAnnotations(Client client) throws ServiceException, AccessException, ExecutionException Gets all map annotations linked to an object in OMERO, if possible.- Parameters:
- client- The client handling the connection.
- Returns:
- See above.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
addPairKeyValue@Deprecated public void addPairKeyValue(Client client, String key, String value) throws ServiceException, AccessException, ExecutionException Deprecated.Adds a single Key-Value pair to the object.- Parameters:
- client- The client handling the connection.
- key- Name of the key.
- value- Value associated to the key.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
addKeyValuePairpublic void addKeyValuePair(Client client, String key, String value) throws ServiceException, AccessException, ExecutionException Adds a single Key-Value pair to the object.- Parameters:
- client- The client handling the connection.
- key- Name of the key.
- value- Value associated to the key.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
getKeyValuePairspublic Map<String,String> getKeyValuePairs(Client client) throws ServiceException, AccessException, ExecutionException Gets the List of key-value pairs associated to an object as a map (no duplicate key should exist).- Parameters:
- client- The client handling the connection.
- Returns:
- See above.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
getValuepublic String getValue(Client client, String key) throws ServiceException, AccessException, ExecutionException Gets the value from a Key-Value pair associated to the object.- Parameters:
- client- The client handling the connection.
- key- Key researched.
- Returns:
- Value associated to the key.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- NoSuchElementException- Key not found.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
ratepublic void rate(Client client, int rating) throws ServiceException, AccessException, ExecutionException, OMEROServerError, InterruptedException Rates the object (using a rating annotation).- Parameters:
- client- The client handling the connection.
- rating- The rating.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
- OMEROServerError- Server error.
- InterruptedException- The thread was interrupted.
 
 - 
getMyRatingpublic int getMyRating(Client client) throws ServiceException, AccessException, ExecutionException Returns the user rating for this object (averaged if multiple ratings are linked).- Parameters:
- client- The client handling the connection.
- Returns:
- See above.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
addMapAnnotation@Deprecated public void addMapAnnotation(Client client, MapAnnotationWrapper mapAnnotation) throws ServiceException, AccessException, ExecutionException Deprecated.Adds a List of Key-Value pair to the object. Uselink(fr.igred.omero.Client, A)instead.The list is contained in the map annotation. - Parameters:
- client- The client handling the connection.
- mapAnnotation- The map annotation.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
addTablepublic void addTable(Client client, TableWrapper table) throws ServiceException, AccessException, ExecutionException Adds a table to the object in OMERO.- Parameters:
- client- The client handling the connection.
- table- Table to add to the object.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
addAndReplaceTablepublic void addAndReplaceTable(Client client, TableWrapper table, GenericRepositoryObjectWrapper.ReplacePolicy policy) throws ServiceException, AccessException, ExecutionException, OMEROServerError, InterruptedException Adds a table to the object in OMERO and unlinks or deletes previous tables with the same name.- Parameters:
- client- The client handling the connection.
- table- Table to add to the object.
- policy- Whether older tables should be unlinked, deleted or deleted only if they become orphaned.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
- InterruptedException- The thread was interrupted.
- OMEROServerError- Server error.
 
 - 
addAndReplaceTablepublic void addAndReplaceTable(Client client, TableWrapper table) throws ServiceException, AccessException, ExecutionException, OMEROServerError, InterruptedException Adds a table to the object in OMERO and unlinks previous tables with the same name, or deletes them if they're orphaned.- Parameters:
- client- The client handling the connection.
- table- Table to add to the object.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
- InterruptedException- The thread was interrupted.
- OMEROServerError- Server error.
 
 - 
getTablepublic TableWrapper getTable(Client client, Long fileId) throws ServiceException, AccessException, ExecutionException Gets a certain table linked to the object in OMERO.- Parameters:
- client- The client handling the connection.
- fileId- FileId of the table researched.
- Returns:
- See above.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
getTablespublic List<TableWrapper> getTables(Client client) throws ServiceException, AccessException, ExecutionException Gets all tables linked to the object in OMERO.- Parameters:
- client- The client handling the connection.
- Returns:
- See above.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
addFilepublic long addFile(Client client, File file) throws ExecutionException, InterruptedException Uploads a file and links it to the object- Parameters:
- client- The client handling the connection.
- file- File to add.
- Returns:
- ID of the file created in OMERO.
- Throws:
- ExecutionException- A Facility can't be retrieved or instantiated.
- InterruptedException- The thread was interrupted.
 
 - 
addAndReplaceFilepublic long addAndReplaceFile(Client client, File file, GenericRepositoryObjectWrapper.ReplacePolicy policy) throws ExecutionException, InterruptedException, AccessException, ServiceException, OMEROServerError Uploads a file, links it to the object and unlinks or deletes previous files with the same name.- Parameters:
- client- The client handling the connection.
- file- File to add.
- policy- Whether older files should be unlinked, deleted or deleted only if they become orphaned.
- Returns:
- ID of the file created in OMERO.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
- InterruptedException- The thread was interrupted.
- OMEROServerError- Server error.
 
 - 
addAndReplaceFilepublic long addAndReplaceFile(Client client, File file) throws ExecutionException, InterruptedException, AccessException, ServiceException, OMEROServerError Uploads a file, links it to the object and unlinks previous files with the same name, or deletes them if they're orphaned.- Parameters:
- client- The client handling the connection.
- file- File to add.
- Returns:
- ID of the file created in OMERO.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
- InterruptedException- The thread was interrupted.
- OMEROServerError- Server error.
 
 - 
addFileAnnotation@Deprecated public void addFileAnnotation(Client client, FileAnnotationWrapper annotation) throws AccessException, ServiceException, ExecutionException Deprecated.Links a file annotation to the object. Uselink(fr.igred.omero.Client, A)instead.- Parameters:
- client- The client handling the connection.
- annotation- FileAnnotationWrapper to link.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
getFileAnnotationspublic List<FileAnnotationWrapper> getFileAnnotations(Client client) throws ExecutionException, ServiceException, AccessException Returns the file annotations- Parameters:
- client- The client handling the connection.
- Returns:
- The list of tile annotations.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
unlinkpublic <A extends GenericAnnotationWrapper<?>> void unlink(Client client, A annotation) throws ServiceException, AccessException, ExecutionException, OMEROServerError, InterruptedException Unlinks the given annotation from the current object.- Type Parameters:
- A- The type of the annotation.
- Parameters:
- client- The client handling the connection.
- annotation- An annotation.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
- OMEROServerError- Server error.
- InterruptedException- If block(long) does not return.
 
 - 
removeLinkprotected void removeLink(Client client, String linkType, long childId) throws ServiceException, OMEROServerError, AccessException, ExecutionException, InterruptedException Removes the link of the given type with the given child ID.- Parameters:
- client- The client handling the connection.
- linkType- The link type.
- childId- Link child ID.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
- OMEROServerError- Server error.
- InterruptedException- If block(long) does not return.
 
 - 
getAnnotationspublic AnnotationList getAnnotations(Client client) throws AccessException, ServiceException, ExecutionException Retrieves annotations linked to the object (of known types).- Parameters:
- client- The client handling the connection.
- Returns:
- A list of annotations.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 - 
copyAnnotationLinkspublic void copyAnnotationLinks(Client client, AnnotatableWrapper<?> object) throws AccessException, ServiceException, ExecutionException Copies annotation links from some other object to this one.- Parameters:
- client- The client handling the connection.
- object- Other repository object to copy annotations from.
- Throws:
- ServiceException- Cannot connect to OMERO.
- AccessException- Cannot access data.
- ExecutionException- A Facility can't be retrieved or instantiated.
 
 
- 
 
-