T
- Subclass of DataObject
public abstract class AnnotatableWrapper<T extends DataObject> extends ObjectWrapper<T> implements Annotatable
data
Modifier | Constructor and Description |
---|---|
protected |
AnnotatableWrapper(T o)
Constructor of the class AnnotatableWrapper.
|
Modifier and Type | Method and Description |
---|---|
long |
addAndReplaceFile(Client client,
File file,
ReplacePolicy policy)
Uploads a file, links it to the object and unlinks or deletes previous files with the same name.
|
void |
addAndReplaceTable(Client client,
Table table,
ReplacePolicy policy)
Adds a table to the object in OMERO and unlinks or deletes previous tables with the same name.
|
void |
addKeyValuePair(DataManager dm,
String key,
String value)
Adds a single Key-Value pair to the object.
|
void |
addTag(DataManager dm,
Long id)
Adds a tag to the object in OMERO, if possible.
|
void |
addTag(DataManager dm,
String name,
String description)
Adds a newly created tag to the object in OMERO, if possible.
|
protected abstract String |
annotationLinkType()
Returns the type of annotation link for this object.
|
List<Annotation> |
getAnnotations(Browser browser)
Retrieves annotations linked to the object (of known types).
|
List<FileAnnotation> |
getFileAnnotations(Browser browser)
Returns the file annotations
|
List<MapAnnotation> |
getMapAnnotations(Browser browser)
Gets all map annotations linked to an object in OMERO, if possible.
|
int |
getMyRating(Browser browser)
Returns the user rating for this object (averaged if multiple ratings are linked).
|
Table |
getTable(DataManager dm,
Long fileId)
Gets a certain table linked to the object in OMERO.
|
List<TagAnnotation> |
getTags(Browser browser)
Gets all tags linked to an object in OMERO, if possible.
|
void |
rate(Client client,
int rating)
Rates the object (using a rating annotation).
|
protected void |
removeLink(Client client,
String linkType,
long childId)
Removes the link of the given type with the given child ID.
|
<A extends Annotation> |
unlink(Client client,
A annotation)
Unlinks the given annotation from the current object.
|
asDataObject, canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, getCreated, getGroupId, getId, getOwner, getUpdated, saveAndUpdate, toString, wrap, wrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addAndReplaceFile, addAndReplaceTable, addFile, addTable, addTags, copyAnnotationLinks, getAnnotationData, getKeyValuePairs, getTables, getValues, isLinked, link, link, link, linkIfNotLinked
asDataObject, canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, distinct, flatten, getCreated, getElementsOf, getGroupId, getId, getOwner, getUpdated, saveAndUpdate
protected AnnotatableWrapper(T o)
o
- The annotatable DataObject to wrap in the AnnotatableWrapper.protected abstract String annotationLinkType()
public void addTag(DataManager dm, String name, String description) throws ServiceException, AccessException, ExecutionException
addTag
in interface Annotatable
dm
- The data manager.name
- Tag Name.description
- Tag description.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.public void addTag(DataManager dm, Long id) throws ServiceException, AccessException, ExecutionException
addTag
in interface Annotatable
dm
- The data manager.id
- ID of the tag to add to the object.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.public List<TagAnnotation> getTags(Browser browser) throws ServiceException, AccessException, ExecutionException
getTags
in interface Annotatable
browser
- The data browser.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.public List<MapAnnotation> getMapAnnotations(Browser browser) throws ServiceException, AccessException, ExecutionException
getMapAnnotations
in interface Annotatable
browser
- The data browser.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.public void addKeyValuePair(DataManager dm, String key, String value) throws ServiceException, AccessException, ExecutionException
addKeyValuePair
in interface Annotatable
dm
- The data manager.key
- Name of the key.value
- Value associated to the key.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.public void rate(Client client, int rating) throws ServiceException, AccessException, ExecutionException, InterruptedException
If multiple ratings are present, only one will be kept and updated.
rate
in interface Annotatable
client
- The client handling the connection.rating
- The rating.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.InterruptedException
- The thread was interrupted.public int getMyRating(Browser browser) throws ServiceException, AccessException, ExecutionException
getMyRating
in interface Annotatable
browser
- The data browser.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.public void addAndReplaceTable(Client client, Table table, ReplacePolicy policy) throws ServiceException, AccessException, ExecutionException, InterruptedException
addAndReplaceTable
in interface Annotatable
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.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.InterruptedException
- The thread was interrupted.public Table getTable(DataManager dm, Long fileId) throws ServiceException, AccessException, ExecutionException
getTable
in interface Annotatable
dm
- The data manager.fileId
- FileId of the table researched.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.public long addAndReplaceFile(Client client, File file, ReplacePolicy policy) throws ExecutionException, InterruptedException, AccessException, ServiceException
addAndReplaceFile
in interface Annotatable
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.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.InterruptedException
- The thread was interrupted.public List<FileAnnotation> getFileAnnotations(Browser browser) throws ExecutionException, ServiceException, AccessException
getFileAnnotations
in interface Annotatable
browser
- The data browser.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.public <A extends Annotation> void unlink(Client client, A annotation) throws ServiceException, AccessException, ExecutionException, InterruptedException
unlink
in interface Annotatable
A
- The type of the annotation.client
- The client handling the connection.annotation
- An annotation.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.InterruptedException
- If block(long) does not return.protected void removeLink(Client client, String linkType, long childId) throws ServiceException, AccessException, ExecutionException, InterruptedException
client
- The client handling the connection.linkType
- The link type.childId
- Link child ID.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.InterruptedException
- If block(long) does not return.public List<Annotation> getAnnotations(Browser browser) throws AccessException, ServiceException, ExecutionException
getAnnotations
in interface Annotatable
browser
- The data browser.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.Copyright © 2020–2023 GReD. All rights reserved.