Package fr.igred.omero
Class Client
- java.lang.Object
-
- fr.igred.omero.GatewayWrapper
-
- fr.igred.omero.Browser
-
- fr.igred.omero.Client
-
public class Client extends Browser
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 Deprecated Methods Modifier and Type Method Description void
delete(TableWrapper table)
Deprecated.Deletes a table from OMERO.void
delete(GenericObjectWrapper<?> object)
Deletes an object from OMERO.void
delete(Collection<? extends GenericObjectWrapper<?>> objects)
Deletes multiple objects from OMERO.void
deleteTable(TableWrapper table)
Deletes a table from OMERO.void
deleteTables(Collection<? extends TableWrapper> tables)
Deletes tables from OMERO.GroupWrapper
getGroup(long groupId)
Returns the group which matches the group ID.GroupWrapper
getGroup(String groupName)
Returns the group which matches the name.List<ImageWrapper>
getImages(GenericAnnotationWrapper<?> annotation)
Gets all images with the specified annotation 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)
Deprecated.Gets all images with a certain keyList<ImageWrapper>
getImagesPairKeyValue(String key, String value)
Deprecated.Gets all images with a certain key value pair from OMEROExperimenterWrapper
getUser(long userId)
Returns the user which matches the user ID.ExperimenterWrapper
getUser(String username)
Returns the user which matches the username.Client
sudoGetUser(String username)
Gets the client associated with the username in the parameters.-
Methods inherited from class fr.igred.omero.Browser
getDataset, getDatasets, getDatasets, getDatasets, getDatasets, getFolder, getFolders, getFolders, getImage, getImages, getImages, getImages, getImagesLike, getImagesTagged, getImagesTagged, getImagesWithKey, getImagesWithKeyValuePair, getMapAnnotation, getMapAnnotations, getMapAnnotations, getMapAnnotations, getPlate, getPlates, getPlates, getPlates, getProject, getProjects, getProjects, getProjects, getProjects, getScreen, getScreens, getScreens, getScreens, getTag, getTags, getTags, getWell, getWells, getWells, getWells, loadFolders
-
Methods inherited from class fr.igred.omero.GatewayWrapper
closeImport, connect, connect, connect, connect, deleteFile, deleteFiles, disconnect, findByQuery, getAdminFacility, getBrowseFacility, getCtx, getCurrentGroupId, getDm, getGateway, getId, getImportStore, getMetadata, getQueryService, 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
-
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.- Specified by:
getImages
in classBrowser
- Parameters:
projectName
- Expected project name.datasetName
- Expected dataset name.imageName
- Expected image name.- Returns:
- See above.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImages
public List<ImageWrapper> getImages(GenericAnnotationWrapper<?> annotation) throws ServiceException, AccessException, OMEROServerError, ExecutionException
Gets all images with the specified annotation from OMERO.- Specified by:
getImages
in classBrowser
- Parameters:
annotation
- TagAnnotation containing the tag researched.- Returns:
- See above.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.OMEROServerError
- Server error.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesKey
@Deprecated public List<ImageWrapper> getImagesKey(String key) throws ServiceException, AccessException, ExecutionException
Deprecated.Gets all images with a certain key- Specified by:
getImagesKey
in classBrowser
- Parameters:
key
- Name of the key researched.- Returns:
- See above.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
getImagesPairKeyValue
@Deprecated public List<ImageWrapper> getImagesPairKeyValue(String key, String value) throws ServiceException, AccessException, ExecutionException
Deprecated.Gets all images with a certain key value pair from OMERO- Specified by:
getImagesPairKeyValue
in classBrowser
- Parameters:
key
- Name of the key researched.value
- Value associated with the key.- Returns:
- See above.
- Throws:
ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.
-
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.Make sure a folder is loaded before deleting it.
- 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
@Deprecated public void delete(TableWrapper table) throws ServiceException, AccessException, ExecutionException, OMEROServerError, InterruptedException
Deprecated.Deletes a table from OMERO.- Parameters:
table
- 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.
-
deleteTable
public void deleteTable(TableWrapper table) throws ServiceException, AccessException, ExecutionException, OMEROServerError, InterruptedException
Deletes a table from OMERO.- Parameters:
table
- 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.
-
deleteTables
public void deleteTables(Collection<? extends TableWrapper> tables) throws ServiceException, AccessException, ExecutionException, OMEROServerError, InterruptedException
Deletes tables from OMERO.- Parameters:
tables
- List of tables 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 cannot be found.
-
getUser
public ExperimenterWrapper getUser(long userId) throws ServiceException, OMEROServerError
Returns the user which matches the user ID.- Parameters:
userId
- The ID of the user.- Returns:
- The user matching the user ID, or null if it does not exist.
- Throws:
ServiceException
- Cannot connect to OMERO.OMEROServerError
- Server error.NoSuchElementException
- The requested user cannot be found.
-
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 cannot be found.
-
getGroup
public GroupWrapper getGroup(long groupId) throws ServiceException, OMEROServerError
Returns the group which matches the group ID.- Parameters:
groupId
- The ID of the group.- Returns:
- The group with the appropriate group ID, if it exists.
- Throws:
ServiceException
- Cannot connect to OMERO.OMEROServerError
- Server error.NoSuchElementException
- The requested group cannot be found.
-
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.
-
-