Package fr.igred.omero
Class Client
- java.lang.Object
-
- fr.igred.omero.GatewayWrapper
-
- fr.igred.omero.Client
-
public class Client extends GatewayWrapper
Basic class, contains the gateway, the security context, and multiple facilities.Allows the user to connect to OMERO and browse through all the data accessible to the user.
-
-
Constructor Summary
Constructors Constructor Description Client()
Constructor of the Client class.Client(Gateway gateway, SecurityContext ctx, ExperimenterWrapper user)
Constructor of the Client class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(TableWrapper table)
Deletes a table from OMEROvoid
delete(GenericObjectWrapper<?> object)
Deletes an object from OMERO.void
delete(Collection<? extends GenericObjectWrapper<?>> objects)
Deletes multiple objects from OMERO.DatasetWrapper
getDataset(Long id)
Gets the dataset with the specified id from OMERO.List<DatasetWrapper>
getDatasets()
Gets all datasets available from OMERO.List<DatasetWrapper>
getDatasets(Long... ids)
Gets the datasets with the specified ids from OMERO.List<DatasetWrapper>
getDatasets(String name)
Gets all datasets with a certain name from OMERO.GroupWrapper
getGroup(String groupName)
Returns the group which matches the name.ImageWrapper
getImage(Long id)
Returns an ImageWrapper that contains the image with the specified id from OMERO.List<ImageWrapper>
getImages()
Gets all images owned by the current user.List<ImageWrapper>
getImages(Long... ids)
Gets the images with the specified ids from OMEROList<ImageWrapper>
getImages(String name)
Gets all images with a certain name from OMERO.List<ImageWrapper>
getImages(String projectName, String datasetName, String imageName)
Gets all images with the name specified inside projects and datasets with the given names.List<ImageWrapper>
getImagesKey(String key)
Gets all images with a certain keyList<ImageWrapper>
getImagesLike(String motif)
Gets all images with a certain motif in their name from OMERO.List<ImageWrapper>
getImagesPairKeyValue(String key, String value)
Gets all images with a certain key value pair from OMEROList<ImageWrapper>
getImagesTagged(TagAnnotationWrapper tag)
Gets all images tagged with a specified tag from OMERO.List<ImageWrapper>
getImagesTagged(Long tagId)
Gets all images tagged with a specified tag from OMERO.PlateWrapper
getPlate(Long id)
Gets the plate with the specified id from OMERO.List<PlateWrapper>
getPlates()
Gets all plates available from OMERO.List<PlateWrapper>
getPlates(Long... ids)
Gets the plates with the specified ids from OMERO.ProjectWrapper
getProject(Long id)
Gets the project with the specified id from OMERO.List<ProjectWrapper>
getProjects()
Gets all projects available from OMERO.List<ProjectWrapper>
getProjects(Long... ids)
Gets the projects with the specified ids from OMERO.List<ProjectWrapper>
getProjects(String name)
Gets all projects with a certain name from OMERO.ScreenWrapper
getScreen(Long id)
Gets the screen with the specified id from OMERO.List<ScreenWrapper>
getScreens()
Gets all screens available from OMERO.List<ScreenWrapper>
getScreens(Long... ids)
Gets the screens with the specified ids from OMERO.TagAnnotationWrapper
getTag(Long id)
Gets a specific tag from the OMERO databaseList<TagAnnotationWrapper>
getTags()
Gets the list of TagAnnotationWrapper available to the userList<TagAnnotationWrapper>
getTags(String name)
Gets the list of TagAnnotationWrapper with the specified name available to the userExperimenterWrapper
getUser(String username)
Returns the user which matches the username.WellWrapper
getWell(Long id)
Gets the well with the specified id from OMERO.List<WellWrapper>
getWells()
Gets all wells available from OMERO.List<WellWrapper>
getWells(Long... ids)
Gets the wells with the specified ids from OMERO.Client
sudoGetUser(String username)
Gets the client associated with the username in the parameters.-
Methods inherited from class fr.igred.omero.GatewayWrapper
connect, connect, connect, connect, deleteFile, disconnect, findByQuery, getAdminFacility, getBrowseFacility, getCtx, getCurrentGroupId, getDm, getGateway, getId, getImportStore, getMetadata, getRoiFacility, getSessionId, getTablesFacility, getUser, isConnected, save, switchGroup, toString
-
-
-
-
Constructor Detail
-
Client
public Client()
Constructor of the Client class. Initializes the gateway.
-
Client
public Client(Gateway gateway, SecurityContext ctx, ExperimenterWrapper user)
Constructor of the Client class.- Parameters:
gateway
- The gatewayctx
- The security contextuser
- The user
-
-
Method Detail
-
getProject
public ProjectWrapper getProject(Long id) throws ServiceException, AccessException, ExecutionException
Gets the project with the specified id from OMERO.- Parameters:
id
- ID of the project.- Returns:
- ProjectWrapper containing the project.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.NoSuchElementException
- No element with such id.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getProjects
public List<ProjectWrapper> getProjects(Long... ids) throws ServiceException, AccessException, ExecutionException
Gets the projects with the specified ids from OMERO.- Parameters:
ids
- Project IDs- Returns:
- List of ProjectWrappers.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getProjects
public List<ProjectWrapper> getProjects() throws ServiceException, AccessException, ExecutionException
Gets all projects available from OMERO.- Returns:
- Collection of ProjectWrapper.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getProjects
public List<ProjectWrapper> getProjects(String name) throws ServiceException, AccessException, ExecutionException
Gets all projects with a certain name from OMERO.- Parameters:
name
- Name searched.- Returns:
- Collection of ProjectWrapper.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getDataset
public DatasetWrapper getDataset(Long id) throws ServiceException, AccessException, ExecutionException
Gets the dataset with the specified id from OMERO.- Parameters:
id
- ID of the dataset.- Returns:
- ProjectWrapper containing the project.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.NoSuchElementException
- No element with such id.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getDatasets
public List<DatasetWrapper> getDatasets(Long... ids) throws ServiceException, AccessException, ExecutionException
Gets the datasets with the specified ids from OMERO.- Parameters:
ids
- Dataset IDs- Returns:
- List of DatasetWrappers.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getDatasets
public List<DatasetWrapper> getDatasets() throws ServiceException, AccessException, OMEROServerError, ExecutionException
Gets all datasets available from OMERO.- Returns:
- List of DatasetWrappers.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.OMEROServerError
- Server error.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getDatasets
public List<DatasetWrapper> getDatasets(String name) throws ServiceException, AccessException, ExecutionException
Gets all datasets with a certain name from OMERO.- Parameters:
name
- Name searched.- Returns:
- Collection of DatasetWrapper.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImage
public ImageWrapper getImage(Long id) throws ServiceException, AccessException, ExecutionException
Returns an ImageWrapper that contains the image with the specified id from OMERO.- Parameters:
id
- ID of the image.- Returns:
- ImageWrapper containing the image.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.NoSuchElementException
- No element with such id.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImages
public List<ImageWrapper> getImages(Long... ids) throws ServiceException, AccessException, ExecutionException
Gets the images with the specified ids from OMERO- Parameters:
ids
- Image IDs- Returns:
- ImageWrapper list.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImages
public List<ImageWrapper> getImages() throws ServiceException, AccessException, ExecutionException
Gets all images owned by the current user.- Returns:
- ImageWrapper list.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImages
public List<ImageWrapper> getImages(String name) throws ServiceException, AccessException, ExecutionException
Gets all images with a certain name from OMERO.- Parameters:
name
- Name searched.- Returns:
- ImageWrapper list.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImages
public List<ImageWrapper> getImages(String projectName, String datasetName, String imageName) throws ServiceException, AccessException, ExecutionException
Gets all images with the name specified inside projects and datasets with the given names.- Parameters:
projectName
- Expected project name.datasetName
- Expected dataset name.imageName
- Expected image name.- Returns:
- ImageWrapper list.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesLike
public List<ImageWrapper> getImagesLike(String motif) throws ServiceException, AccessException, ExecutionException
Gets all images with a certain motif in their name from OMERO.- Parameters:
motif
- Motif searched in an image name.- Returns:
- ImageWrapper list.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesTagged
public List<ImageWrapper> getImagesTagged(TagAnnotationWrapper tag) throws ServiceException, AccessException, OMEROServerError, ExecutionException
Gets all images tagged with a specified tag from OMERO.- Parameters:
tag
- TagAnnotationWrapper containing the tag researched.- Returns:
- ImageWrapper list.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.OMEROServerError
- Server error.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesTagged
public List<ImageWrapper> getImagesTagged(Long tagId) throws ServiceException, AccessException, OMEROServerError, ExecutionException
Gets all images tagged with a specified tag from OMERO.- Parameters:
tagId
- Id of the tag researched.- Returns:
- ImageWrapper list.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.OMEROServerError
- Server error.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesKey
public List<ImageWrapper> getImagesKey(String key) throws ServiceException, AccessException, ExecutionException
Gets all images with a certain key- Parameters:
key
- Name of the key researched.- Returns:
- ImageWrapper list.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesPairKeyValue
public List<ImageWrapper> getImagesPairKeyValue(String key, String value) throws ServiceException, AccessException, ExecutionException
Gets all images with a certain key value pair from OMERO- Parameters:
key
- Name of the key researched.value
- Value associated with the key.- Returns:
- ImageWrapper list.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getScreen
public ScreenWrapper getScreen(Long id) throws ServiceException, AccessException, ExecutionException
Gets the screen with the specified id from OMERO.- Parameters:
id
- ID of the screen.- Returns:
- ScreenWrapper containing the screen.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.NoSuchElementException
- No element with such id.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getScreens
public List<ScreenWrapper> getScreens(Long... ids) throws ServiceException, AccessException, ExecutionException
Gets the screens with the specified ids from OMERO.- Parameters:
ids
- A list of screen ids- Returns:
- List of ScreenWrappers.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getScreens
public List<ScreenWrapper> getScreens() throws ServiceException, AccessException, ExecutionException
Gets all screens available from OMERO.- Returns:
- List of ScreenWrappers.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getPlate
public PlateWrapper getPlate(Long id) throws ServiceException, AccessException, ExecutionException
Gets the plate with the specified id from OMERO.- Parameters:
id
- ID of the plate.- Returns:
- PlateWrapper containing the plate.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.NoSuchElementException
- No element with such id.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getPlates
public List<PlateWrapper> getPlates(Long... ids) throws ServiceException, AccessException, ExecutionException
Gets the plates with the specified ids from OMERO.- Parameters:
ids
- A list of plate ids- Returns:
- List of PlateWrappers.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getPlates
public List<PlateWrapper> getPlates() throws ServiceException, AccessException, ExecutionException
Gets all plates available from OMERO.- Returns:
- List of PlateWrappers.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getWell
public WellWrapper getWell(Long id) throws ServiceException, AccessException, ExecutionException
Gets the well with the specified id from OMERO.- Parameters:
id
- ID of the well.- Returns:
- WellWrapper containing the well.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.NoSuchElementException
- No element with such id.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getWells
public List<WellWrapper> getWells(Long... ids) throws ServiceException, AccessException, ExecutionException
Gets the wells with the specified ids from OMERO.- Parameters:
ids
- A list of well ids- Returns:
- List of WellWrappers.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getWells
public List<WellWrapper> getWells() throws ServiceException, AccessException, ExecutionException, OMEROServerError
Gets all wells available from OMERO.- Returns:
- List of WellWrapper.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.OMEROServerError
- Server error.
-
getTags
public List<TagAnnotationWrapper> getTags() throws OMEROServerError, ServiceException
Gets the list of TagAnnotationWrapper available to the user- Returns:
- list of TagAnnotationWrapper.
- Throws:
OMEROServerError
- Server error.ServiceException
- Cannot connect to OMERO.
-
getTags
public List<TagAnnotationWrapper> getTags(String name) throws OMEROServerError, ServiceException
Gets the list of TagAnnotationWrapper with the specified name available to the user- Parameters:
name
- Name of the tag searched.- Returns:
- list of TagAnnotationWrapper.
- Throws:
OMEROServerError
- Server error.ServiceException
- Cannot connect to OMERO.
-
getTag
public TagAnnotationWrapper getTag(Long id) throws OMEROServerError, ServiceException
Gets a specific tag from the OMERO database- Parameters:
id
- Id of the tag.- Returns:
- TagAnnotationWrapper containing the specified tag.
- Throws:
OMEROServerError
- Server error.ServiceException
- Cannot connect to OMERO.
-
delete
public void delete(Collection<? extends GenericObjectWrapper<?>> objects) throws ServiceException, AccessException, ExecutionException, OMEROServerError, InterruptedException
Deletes multiple objects from OMERO.- Parameters:
objects
- The OMERO object.- 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.
-
delete
public void delete(GenericObjectWrapper<?> object) throws ServiceException, AccessException, ExecutionException, OMEROServerError, InterruptedException
Deletes an object from OMERO.- Parameters:
object
- The OMERO object.- 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.
-
delete
public void delete(TableWrapper table) throws ServiceException, AccessException, ExecutionException, OMEROServerError, InterruptedException
Deletes a table from OMERO- Parameters:
table
- TableWrapper containing the table to delete.- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.IllegalArgumentException
- ID not defined.OMEROServerError
- Server error.InterruptedException
- If block(long) does not return.
-
getUser
public ExperimenterWrapper getUser(String username) throws ExecutionException, ServiceException, AccessException
Returns the user which matches the username.- Parameters:
username
- The name of the user.- Returns:
- The user matching the username, or null if it does not exist.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.NoSuchElementException
- The requested user does not exist.
-
getGroup
public GroupWrapper getGroup(String groupName) throws ExecutionException, ServiceException, AccessException
Returns the group which matches the name.- Parameters:
groupName
- The name of the group.- Returns:
- The group with the appropriate name, if it exists.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.NoSuchElementException
- The requested group does not exist.
-
sudoGetUser
public Client sudoGetUser(String username) throws ServiceException, AccessException, ExecutionException
Gets the client associated with the username in the parameters. The user calling this function needs to have administrator rights. All action realized with the client returned will be considered as his.- Parameters:
username
- Username of user.- Returns:
- The client corresponding to the new user.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.NoSuchElementException
- The requested user does not exist.
-
-