Package fr.igred.omero.repository
Class GenericRepositoryObjectWrapper<T extends DataObject>
- java.lang.Object
-
- fr.igred.omero.GenericObjectWrapper<T>
-
- fr.igred.omero.repository.GenericRepositoryObjectWrapper<T>
-
- Type Parameters:
T
- Subclass ofDataObject
- Direct Known Subclasses:
DatasetWrapper
,FolderWrapper
,ImageWrapper
,ProjectWrapper
public abstract class GenericRepositoryObjectWrapper<T extends DataObject> extends GenericObjectWrapper<T>
Generic class containing a DataObject (or a subclass) object.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class fr.igred.omero.GenericObjectWrapper
GenericObjectWrapper.SortById<U extends GenericObjectWrapper<?>>
-
-
Field Summary
-
Fields inherited from class fr.igred.omero.GenericObjectWrapper
data
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
GenericRepositoryObjectWrapper(T object)
Constructor of the class GenericRepositoryObjectWrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
addFile(Client client, File file)
Links a file to the objectvoid
addMapAnnotation(Client client, MapAnnotationWrapper mapAnnotation)
Adds a List of Key-Value pair to the objectvoid
addPairKeyValue(Client client, String key, String value)
Adds a single Key-Value pair to the object.void
addTable(Client client, TableWrapper table)
Adds a table to the object in OMEROvoid
addTag(Client client, TagAnnotationWrapper tag)
Adds a tag to the object in OMERO, if possible.void
addTag(Client client, Long id)
Adds multiple tags to the object in OMERO, if possible.void
addTag(Client client, String name, String description)
Adds a newly created tag to the object in OMERO, if possible.protected void
addTag(Client client, TagAnnotationData tagData)
Private function.void
addTags(Client client, TagAnnotationWrapper... tags)
Adds multiple tag to the object in OMERO, if possible.void
addTags(Client client, Long... ids)
Adds multiple tags by ID to the object in OMERO, if possible.Map<String,String>
getKeyValuePairs(Client client)
Gets the List of NamedValue (Key-Value pair) associated to an object.TableWrapper
getTable(Client client, Long fileId)
Gets a certain table linked to the object in OMEROList<TableWrapper>
getTables(Client client)
Gets all table linked to the object in OMERO.List<TagAnnotationWrapper>
getTags(Client client)
Gets all tag linked to an object in OMERO, if possible.String
getValue(Client client, String key)
Gets the value from a Key-Value pair associated to the object-
Methods inherited from class fr.igred.omero.GenericObjectWrapper
getCreated, getGroupId, getId, getOwner, saveAndUpdate, toString
-
-
-
-
Constructor Detail
-
GenericRepositoryObjectWrapper
protected GenericRepositoryObjectWrapper(T object)
Constructor of the class GenericRepositoryObjectWrapper.- Parameters:
object
- The object contained in the GenericRepositoryObjectWrapper.
-
-
Method Detail
-
addTag
public 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
public void addTag(Client client, TagAnnotationWrapper tag) throws ServiceException, AccessException, ExecutionException
Adds a tag to the object in OMERO, if possible.- 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.
-
addTag
protected void addTag(Client client, TagAnnotationData tagData) throws ServiceException, AccessException, ExecutionException
Private function. Adds a tag to the object in OMERO, if possible.- Parameters:
client
- The client handling the connection.tagData
- Tag to be added.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
addTag
public void addTag(Client client, Long id) throws ServiceException, AccessException, ExecutionException
Adds multiple tags to the object in OMERO, if possible.- Parameters:
client
- The client handling the connection.id
- Id in OMERO of tag to add.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
addTags
public void addTags(Client client, TagAnnotationWrapper... tags) throws ServiceException, AccessException, ExecutionException
Adds multiple tag to the object in OMERO, if possible.- Parameters:
client
- The client handling the connection.tags
- Array of TagAnnotationWrapper to add.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
addTags
public 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.
-
getTags
public List<TagAnnotationWrapper> getTags(Client client) throws ServiceException, AccessException, ExecutionException
Gets all tag linked to an object in OMERO, if possible.- Parameters:
client
- The client handling the connection.- Returns:
- Collection of TagAnnotationWrapper each containing a tag linked to the object.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
addPairKeyValue
public void addPairKeyValue(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.
-
getKeyValuePairs
public Map<String,String> getKeyValuePairs(Client client) throws ServiceException, AccessException, ExecutionException
Gets the List of NamedValue (Key-Value pair) associated to an object.- Parameters:
client
- The client handling the connection.- Returns:
- Collection of NamedValue.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getValue
public String getValue(Client client, String key) throws ServiceException, AccessException, NoSuchElementException, 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.
-
addMapAnnotation
public void addMapAnnotation(Client client, MapAnnotationWrapper mapAnnotation) throws ServiceException, AccessException, ExecutionException
Adds a List of Key-Value pair to the objectThe list is contained in the MapAnnotationWrapper
- Parameters:
client
- The client handling the connection.mapAnnotation
- MapAnnotationWrapper containing a list of NamedValue.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
addTable
public 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.
-
getTable
public 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:
- TableWrapper containing the table information.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getTables
public List<TableWrapper> getTables(Client client) throws ServiceException, AccessException, ExecutionException
Gets all table linked to the object in OMERO.- Parameters:
client
- The client handling the connection.- Returns:
- List of TableWrapper containing the tables information.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
addFile
public long addFile(Client client, File file) throws ExecutionException, InterruptedException
Links a file 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.
-
-