Class 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 Detail

      • Client

        public Client()
        Constructor of the Client class. Initializes the gateway.
    • Method Detail

      • getImages

        public java.util.List<ImageWrapper> getImages​(java.lang.String projectName,
                                                      java.lang.String datasetName,
                                                      java.lang.String imageName)
                                               throws ServiceException,
                                                      AccessException,
                                                      java.util.concurrent.ExecutionException
        Gets all images with the name specified inside projects and datasets with the given names.
        Specified by:
        getImages in class Browser
        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.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • getImagesKey

        @Deprecated
        public java.util.List<ImageWrapper> getImagesKey​(java.lang.String key)
                                                  throws ServiceException,
                                                         AccessException,
                                                         java.util.concurrent.ExecutionException
        Deprecated.
        Gets all images with a certain key
        Specified by:
        getImagesKey in class Browser
        Parameters:
        key - Name of the key researched.
        Returns:
        See above.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • getImagesPairKeyValue

        @Deprecated
        public java.util.List<ImageWrapper> getImagesPairKeyValue​(java.lang.String key,
                                                                  java.lang.String value)
                                                           throws ServiceException,
                                                                  AccessException,
                                                                  java.util.concurrent.ExecutionException
        Deprecated.
        Gets all images with a certain key value pair from OMERO
        Specified by:
        getImagesPairKeyValue in class Browser
        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.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • delete

        public void delete​(java.util.Collection<? extends GenericObjectWrapper<?>> objects)
                    throws ServiceException,
                           AccessException,
                           java.util.concurrent.ExecutionException,
                           OMEROServerError,
                           java.lang.InterruptedException
        Deletes multiple objects from OMERO.
        Parameters:
        objects - The OMERO object.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
        OMEROServerError - Server error.
        java.lang.InterruptedException - If block(long) does not return.
      • delete

        public void delete​(GenericObjectWrapper<?> object)
                    throws ServiceException,
                           AccessException,
                           java.util.concurrent.ExecutionException,
                           OMEROServerError,
                           java.lang.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.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
        OMEROServerError - Server error.
        java.lang.InterruptedException - If block(long) does not return.
      • delete

        public void delete​(TableWrapper table)
                    throws ServiceException,
                           AccessException,
                           java.util.concurrent.ExecutionException,
                           OMEROServerError,
                           java.lang.InterruptedException
        Deletes a table from OMERO.
        Parameters:
        table - Table to delete.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
        java.lang.IllegalArgumentException - ID not defined.
        OMEROServerError - Server error.
        java.lang.InterruptedException - If block(long) does not return.
      • getUser

        public ExperimenterWrapper getUser​(java.lang.String username)
                                    throws java.util.concurrent.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.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
        java.util.NoSuchElementException - The requested user does not exist.
      • getGroup

        public GroupWrapper getGroup​(java.lang.String groupName)
                              throws java.util.concurrent.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.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
        java.util.NoSuchElementException - The requested group does not exist.
      • sudoGetUser

        public Client sudoGetUser​(java.lang.String username)
                           throws ServiceException,
                                  AccessException,
                                  java.util.concurrent.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.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
        java.util.NoSuchElementException - The requested user does not exist.