Interface Annotatable

    • Method Detail

      • isLinked

        default <A extends Annotation> boolean isLinked​(Browser browser,
                                                        A annotation)
                                                 throws ServiceException,
                                                        AccessException,
                                                        java.util.concurrent.ExecutionException
        Checks if a specific annotation is linked to the object.
        Type Parameters:
        A - The type of the annotation.
        Parameters:
        browser - The data browser.
        annotation - Annotation to be checked.
        Returns:
        True if the object is linked to the given annotation, false otherwise.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • link

        default <A extends Annotation> void link​(DataManager dm,
                                                 A annotation)
                                          throws ServiceException,
                                                 AccessException,
                                                 java.util.concurrent.ExecutionException
        Adds an annotation to the object in OMERO, if possible.
        Type Parameters:
        A - The type of the annotation.
        Parameters:
        dm - The client handling the connection.
        annotation - Annotation to be added.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • link

        default void link​(DataManager dm,
                          Annotation... annotations)
                   throws ServiceException,
                          AccessException,
                          java.util.concurrent.ExecutionException
        Adds multiple annotations to the object in OMERO, if possible.
        Parameters:
        dm - The data manager.
        annotations - Annotations to add.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • linkIfNotLinked

        default void linkIfNotLinked​(Client client,
                                     Annotation... annotations)
                              throws ServiceException,
                                     AccessException,
                                     java.util.concurrent.ExecutionException
        Adds multiple annotations to the object in OMERO if they are not already linked.
        Parameters:
        client - The client handling the connection.
        annotations - Annotations to add.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • addTag

        void addTag​(DataManager dm,
                    java.lang.String name,
                    java.lang.String description)
             throws ServiceException,
                    AccessException,
                    java.util.concurrent.ExecutionException
        Adds a newly created tag to the object in OMERO, if possible.
        Parameters:
        dm - The data manager.
        name - Tag Name.
        description - Tag description.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • addTag

        void addTag​(DataManager dm,
                    java.lang.Long id)
             throws ServiceException,
                    AccessException,
                    java.util.concurrent.ExecutionException
        Adds a tag to the object in OMERO, if possible.
        Parameters:
        dm - The data manager.
        id - ID of the tag to add to the object.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • addTags

        default void addTags​(DataManager dm,
                             java.lang.Long... ids)
                      throws ServiceException,
                             AccessException,
                             java.util.concurrent.ExecutionException
        Adds multiple tags by ID to the object in OMERO, if possible.
        Parameters:
        dm - The data manager.
        ids - Array of tag id in OMERO to add.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • getTags

        java.util.List<TagAnnotation> getTags​(Browser browser)
                                       throws ServiceException,
                                              AccessException,
                                              java.util.concurrent.ExecutionException
        Gets all tags linked to an object in OMERO, if possible.
        Parameters:
        browser - The data browser.
        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.
      • getMapAnnotations

        java.util.List<MapAnnotation> getMapAnnotations​(Browser browser)
                                                 throws ServiceException,
                                                        AccessException,
                                                        java.util.concurrent.ExecutionException
        Gets all map annotations linked to an object in OMERO, if possible.
        Parameters:
        browser - The data browser.
        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.
      • addKeyValuePair

        void addKeyValuePair​(DataManager dm,
                             java.lang.String key,
                             java.lang.String value)
                      throws ServiceException,
                             AccessException,
                             java.util.concurrent.ExecutionException
        Adds a single Key-Value pair to the object.
        Parameters:
        dm - The data manager.
        key - Name of the key.
        value - Value associated to the key.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • getKeyValuePairs

        default java.util.List<java.util.Map.Entry<java.lang.String,​java.lang.String>> getKeyValuePairs​(Browser browser)
                                                                                                       throws ServiceException,
                                                                                                              AccessException,
                                                                                                              java.util.concurrent.ExecutionException
        Gets the List of Key-Value pairs associated to an object.
        Parameters:
        browser - The data browser.
        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.
      • getValues

        default java.util.List<java.lang.String> getValues​(Browser browser,
                                                           java.lang.String key)
                                                    throws ServiceException,
                                                           AccessException,
                                                           java.util.concurrent.ExecutionException
        Gets the value from a Key-Value pair associated to the object.
        Parameters:
        browser - The data browser.
        key - Key researched.
        Returns:
        Value associated to the key.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.NoSuchElementException - Key not found.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • rate

        void rate​(Client client,
                  int rating)
           throws ServiceException,
                  AccessException,
                  java.util.concurrent.ExecutionException,
                  ServerException,
                  java.lang.InterruptedException
        Rates the object (using a rating annotation).

        If multiple ratings are present, only one will be kept and updated.

        Parameters:
        client - The client handling the connection.
        rating - The rating.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
        ServerException - Server error.
        java.lang.InterruptedException - The thread was interrupted.
      • getMyRating

        int getMyRating​(Browser browser)
                 throws ServiceException,
                        AccessException,
                        java.util.concurrent.ExecutionException
        Returns the user rating for this object (averaged if multiple ratings are linked).
        Parameters:
        browser - The data browser.
        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.
      • addTable

        default void addTable​(DataManager dm,
                              Table table)
                       throws ServiceException,
                              AccessException,
                              java.util.concurrent.ExecutionException
        Adds a table to the object in OMERO.
        Parameters:
        dm - The data manager.
        table - Table to add to the object.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • addAndReplaceTable

        void addAndReplaceTable​(Client client,
                                Table table,
                                ReplacePolicy policy)
                         throws ServiceException,
                                AccessException,
                                java.util.concurrent.ExecutionException,
                                ServerException,
                                java.lang.InterruptedException
        Adds a table to the object in OMERO and unlinks or deletes previous tables with the same name.
        Parameters:
        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.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
        java.lang.InterruptedException - The thread was interrupted.
        ServerException - Server error.
      • addAndReplaceTable

        default void addAndReplaceTable​(Client client,
                                        Table table)
                                 throws ServiceException,
                                        AccessException,
                                        java.util.concurrent.ExecutionException,
                                        ServerException,
                                        java.lang.InterruptedException
        Adds a table to the object in OMERO and unlinks previous tables with the same name, or deletes them if they're orphaned.
        Parameters:
        client - The client handling the connection.
        table - Table to add to the object.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
        java.lang.InterruptedException - The thread was interrupted.
        ServerException - Server error.
      • getTable

        Table getTable​(DataManager dm,
                       java.lang.Long fileId)
                throws ServiceException,
                       AccessException,
                       java.util.concurrent.ExecutionException
        Gets a certain table linked to the object in OMERO.
        Parameters:
        dm - The data manager.
        fileId - FileId of the table 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.
      • getTables

        default java.util.List<Table> getTables​(DataManager dm)
                                         throws ServiceException,
                                                AccessException,
                                                java.util.concurrent.ExecutionException
        Gets all tables linked to the object in OMERO.
        Parameters:
        dm - The data manager.
        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.
      • addFile

        default long addFile​(DataManager dm,
                             java.io.File file)
                      throws java.util.concurrent.ExecutionException,
                             java.lang.InterruptedException
        Uploads a file and links it to the object
        Parameters:
        dm - The data manager.
        file - File to add.
        Returns:
        ID of the file created in OMERO.
        Throws:
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
        java.lang.InterruptedException - The thread was interrupted.
      • addAndReplaceFile

        long addAndReplaceFile​(Client client,
                               java.io.File file,
                               ReplacePolicy policy)
                        throws java.util.concurrent.ExecutionException,
                               java.lang.InterruptedException,
                               AccessException,
                               ServiceException,
                               ServerException
        Uploads a file, links it to the object and unlinks or deletes previous files with the same name.
        Parameters:
        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.
        Returns:
        ID of the file created in OMERO.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
        java.lang.InterruptedException - The thread was interrupted.
        ServerException - Server error.
      • addAndReplaceFile

        default long addAndReplaceFile​(Client client,
                                       java.io.File file)
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException,
                                       AccessException,
                                       ServiceException,
                                       ServerException
        Uploads a file, links it to the object and unlinks previous files with the same name, or deletes them if they're orphaned.
        Parameters:
        client - The client handling the connection.
        file - File to add.
        Returns:
        ID of the file created in OMERO.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
        java.lang.InterruptedException - The thread was interrupted.
        ServerException - Server error.
      • getFileAnnotations

        java.util.List<FileAnnotation> getFileAnnotations​(Browser browser)
                                                   throws java.util.concurrent.ExecutionException,
                                                          ServiceException,
                                                          AccessException
        Returns the file annotations
        Parameters:
        browser - The data browser.
        Returns:
        The list of tile annotations.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • unlink

        <A extends Annotation> void unlink​(Client client,
                                           A annotation)
                                    throws ServiceException,
                                           AccessException,
                                           java.util.concurrent.ExecutionException,
                                           ServerException,
                                           java.lang.InterruptedException
        Unlinks the given annotation from the current object.
        Type Parameters:
        A - The type of the annotation.
        Parameters:
        client - The client handling the connection.
        annotation - An annotation.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
        ServerException - Server error.
        java.lang.InterruptedException - If block(long) does not return.
      • getAnnotationData

        default java.util.List<AnnotationData> getAnnotationData​(Browser browser)
                                                          throws AccessException,
                                                                 ServiceException,
                                                                 java.util.concurrent.ExecutionException
        Retrieves annotations linked to the object.
        Parameters:
        browser - The data browser.
        Returns:
        A list of annotations, as AnnotationData.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • getAnnotations

        java.util.List<Annotation> getAnnotations​(Browser browser)
                                           throws AccessException,
                                                  ServiceException,
                                                  java.util.concurrent.ExecutionException
        Retrieves annotations linked to the object (of known types).
        Parameters:
        browser - The data browser.
        Returns:
        A list of annotations.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
      • copyAnnotationLinks

        default void copyAnnotationLinks​(Client client,
                                         Annotatable object)
                                  throws AccessException,
                                         ServiceException,
                                         java.util.concurrent.ExecutionException
        Copies annotation links from some other object to this one.
        Parameters:
        client - The client handling the connection.
        object - Other repository object to copy annotations from.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.