Interface IOService


  • @Role
    public interface IOService
    This component provides services related to annotations storage and retrieval. It operates with string serialized references for the targets of annotations. This interface does not restrict the implementation of the annotation targets, they can be anything referencable through a string.
    Since:
    2.3M1
    Version:
    $Id: d2bab7711a4678aefcdd5d80d2e89a9cdd450bec $
    • Method Detail

      • getAnnotations

        Collection<Annotation> getAnnotations​(String target)
                                       throws IOServiceException
        Returns all the annotations on the passed content.
        Parameters:
        target - the string serialized reference to the content for which to get the annotations
        Returns:
        all annotations which target the specified content
        Throws:
        IOServiceException - if any exception occurs while manipulating annotations store
      • getAnnotation

        Annotation getAnnotation​(String target,
                                 String annotationID)
                          throws IOServiceException
        Parameters:
        target - the string serialized reference to the content for which the annotation is added
        annotationID - the identifier of the annotation
        Returns:
        the annotation with the given id on the passed target
        Throws:
        IOServiceException - if any exception occurs while manipulating annotations store
      • addAnnotation

        void addAnnotation​(String target,
                           Annotation annotation)
                    throws IOServiceException
        Adds annotation on the specified target.
        Parameters:
        target - serialized reference of the target of the annotation
        annotation - annotation to add on the target
        Throws:
        IOServiceException - can be thrown if any exception occurs while manipulating annotations store
      • removeAnnotation

        void removeAnnotation​(String target,
                              String annotationID)
                       throws IOServiceException
        Removes an annotation given by its identifier, which should be unique among all annotations on the same target.
        Parameters:
        target - serialized reference of the target of the annotation
        annotationID - annotation identifier
        Throws:
        IOServiceException - can be thrown if any exception occurs while manipulating annotations store
      • updateAnnotations

        void updateAnnotations​(String target,
                               Collection<Annotation> annotations)
                        throws IOServiceException
        Updates the set of annotations in the annotations store. They will be identified by their identifiers as returned by Annotation.getId(), and updated each to match the fields in the Annotation objects.
        Parameters:
        target - serialized reference of the target of the annotation
        annotations - collection of annotations to update
        Throws:
        IOServiceException - can be thrown if any exception occurs while manipulating annotations store