Class AnnotatableWrapper<T extends DataObject>

    • Constructor Detail

      • AnnotatableWrapper

        protected AnnotatableWrapper​(T o)
        Constructor of the class RepositoryObjectWrapper.
        Parameters:
        o - The annotatable DataObject to wrap in the RepositoryObjectWrapper.
    • Method Detail

      • annotationLinkType

        protected abstract java.lang.String annotationLinkType()
        Returns the type of annotation link for this object.
        Returns:
        See above.
      • addTag

        public 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.
        Specified by:
        addTag in interface Annotatable
        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

        public 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.
        Specified by:
        addTag in interface Annotatable
        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.
      • getTags

        public 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.
        Specified by:
        getTags in interface Annotatable
        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

        public 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.
        Specified by:
        addKeyValuePair in interface Annotatable
        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.
      • rate

        public 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.

        Specified by:
        rate in interface Annotatable
        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

        public int getMyRating​(Browser browser)
                        throws ServiceException,
                               AccessException,
                               java.util.concurrent.ExecutionException
        Returns the user rating for this object (averaged if multiple ratings are linked).
        Specified by:
        getMyRating in interface Annotatable
        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.
      • addAndReplaceTable

        public 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.
        Specified by:
        addAndReplaceTable in interface Annotatable
        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.
      • getTable

        public 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.
        Specified by:
        getTable in interface Annotatable
        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.
      • addAndReplaceFile

        public 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.
        Specified by:
        addAndReplaceFile in interface Annotatable
        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.
      • unlink

        public <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.
        Specified by:
        unlink in interface Annotatable
        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.
      • removeLink

        protected void removeLink​(Client client,
                                  java.lang.String linkType,
                                  long childId)
                           throws ServiceException,
                                  ServerException,
                                  AccessException,
                                  java.util.concurrent.ExecutionException,
                                  java.lang.InterruptedException
        Removes the link of the given type with the given child ID.
        Parameters:
        client - The client handling the connection.
        linkType - The link type.
        childId - Link child ID.
        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.
      • getAnnotations

        public java.util.List<Annotation> getAnnotations​(Browser browser)
                                                  throws AccessException,
                                                         ServiceException,
                                                         java.util.concurrent.ExecutionException
        Retrieves annotations linked to the object (of known types).
        Specified by:
        getAnnotations in interface Annotatable
        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.