Interface IAnnotationStoreAccessService

All Known Implementing Classes:
AnnotationStoreAccessService

public interface IAnnotationStoreAccessService
Interface for class AnnotationStoreAccess, contains logic for accessing the annotation database.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.boot.configurationprocessor.json.JSONObject
    addAnnotation(org.springframework.boot.configurationprocessor.json.JSONObject jsonAnnotation, String projectId)
    Adds an annotation to the annotation store.
    void
    deleteAnnotation(String annotationId, String etag)
    Deletes an annotation from the annotation store.
    List<org.springframework.boot.configurationprocessor.json.JSONObject>
    Gets all annotations in the annotation store.
    org.springframework.boot.configurationprocessor.json.JSONObject
    getAnnotationById(String annotationId)
    Gets an annotation from the annotation store by its unique annotation identifier.
    List<org.springframework.boot.configurationprocessor.json.JSONObject>
    getAnnotationsByPageId(String pageId, String pageNumber)
    Gets the Annotations belonging to a page from the AnnotationStore.
    List<org.springframework.boot.configurationprocessor.json.JSONObject>
    Gets annotations with specific target source
    List<org.springframework.boot.configurationprocessor.json.JSONObject>
    Gets all annotations in the annotation store modified after a certain time.
    org.springframework.boot.configurationprocessor.json.JSONObject
    updateAnnotation(String annotationId, org.springframework.boot.configurationprocessor.json.JSONObject jsonAnnotation, String etag)
    Updates an annotation already in the annotation store.
  • Method Details

    • addAnnotation

      org.springframework.boot.configurationprocessor.json.JSONObject addAnnotation(org.springframework.boot.configurationprocessor.json.JSONObject jsonAnnotation, String projectId) throws IOException, InterruptedException, org.springframework.boot.configurationprocessor.json.JSONException
      Adds an annotation to the annotation store.
      Parameters:
      jsonAnnotation - annotation as JSONObject
      projectId - id of the project the annotation is associated with, used as subfolder in annotation store
      Returns:
      new Annotation with ID and ETag
      Throws:
      IOException - if an I/O error occurs when sending or receiving http request
      InterruptedException - if the http request is interrupted
      org.springframework.boot.configurationprocessor.json.JSONException - if the response body could not be parsed to json
    • getAnnotationById

      org.springframework.boot.configurationprocessor.json.JSONObject getAnnotationById(String annotationId) throws IOException, InterruptedException, org.springframework.boot.configurationprocessor.json.JSONException
      Gets an annotation from the annotation store by its unique annotation identifier.
      Parameters:
      annotationId - annotation identifier as String
      Returns:
      annotation as JSONObject
      Throws:
      IOException - if an I/O error occurs when sending or receiving http request
      InterruptedException - if the http request is interrupted
      org.springframework.boot.configurationprocessor.json.JSONException - if the response body could not be parsed to json
    • getAnnotationsByPageId

      List<org.springframework.boot.configurationprocessor.json.JSONObject> getAnnotationsByPageId(String pageId, String pageNumber) throws IOException, InterruptedException, org.springframework.boot.configurationprocessor.json.JSONException
      Gets the Annotations belonging to a page from the AnnotationStore.
      Parameters:
      pageId - Identifier of the page
      pageNumber - Number of the page
      Returns:
      List of annotations belonging to a page
      Throws:
      IOException - if an I/O error occurs when sending or receiving http request
      InterruptedException - if the http request is interrupted
      org.springframework.boot.configurationprocessor.json.JSONException - if the response body could not be parsed to json
    • getAnnotationsByTarget

      List<org.springframework.boot.configurationprocessor.json.JSONObject> getAnnotationsByTarget(String target) throws IOException, InterruptedException, org.springframework.boot.configurationprocessor.json.JSONException
      Gets annotations with specific target source
      Parameters:
      target - value of the target source
      Returns:
      List of annotations belonging to a target
      Throws:
      IOException - if an I/O error occurs when sending or receiving http request
      InterruptedException - if the http request is interrupted
      org.springframework.boot.configurationprocessor.json.JSONException - if the response body could not be parsed to json
    • getAllAnnotations

      List<org.springframework.boot.configurationprocessor.json.JSONObject> getAllAnnotations() throws IOException, InterruptedException, org.springframework.boot.configurationprocessor.json.JSONException
      Gets all annotations in the annotation store.
      Returns:
      list of all annotations
      Throws:
      IOException - if an I/O error occurs when sending or receiving http request
      InterruptedException - if the http request is interrupted
      org.springframework.boot.configurationprocessor.json.JSONException - if the response body could not be parsed to json
    • getAnnotationsModifiedAfter

      List<org.springframework.boot.configurationprocessor.json.JSONObject> getAnnotationsModifiedAfter(Instant timestamp) throws org.springframework.boot.configurationprocessor.json.JSONException, IOException, InterruptedException
      Gets all annotations in the annotation store modified after a certain time.
      Parameters:
      timestamp - specified time after which all annotations should be returned as Date
      Returns:
      list of annotations modified after a certain time
      Throws:
      org.springframework.boot.configurationprocessor.json.JSONException - if the response body could not be parsed to json
      IOException - if an I/O error occurs when sending or receiving http request
      InterruptedException - if the http request is interrupted
    • updateAnnotation

      org.springframework.boot.configurationprocessor.json.JSONObject updateAnnotation(String annotationId, org.springframework.boot.configurationprocessor.json.JSONObject jsonAnnotation, String etag) throws IOException, InterruptedException, org.springframework.boot.configurationprocessor.json.JSONException
      Updates an annotation already in the annotation store.
      Parameters:
      annotationId - annotation identifier as String
      jsonAnnotation - updated annotation as JSONObject
      etag - etag for updating annotation
      Returns:
      JSONObject updated Annotation with new etag
      Throws:
      IOException - if an I/O error occurs when sending or receiving http request
      InterruptedException - if the http request is interrupted
      org.springframework.boot.configurationprocessor.json.JSONException - if the response body could not be parsed to json
    • deleteAnnotation

      void deleteAnnotation(String annotationId, String etag) throws IOException, InterruptedException, org.springframework.boot.configurationprocessor.json.JSONException
      Deletes an annotation from the annotation store.
      Parameters:
      annotationId - annotation identifier as String
      etag - String required for deleting annotation
      Throws:
      IOException - if an I/O error occurs when sending or receiving http request
      InterruptedException - if the http request is interrupted
      org.springframework.boot.configurationprocessor.json.JSONException - if the response body could not be parsed to json