Interface BaselineRepository

All Known Implementing Classes:
BaselineRepositoryImpl

public interface BaselineRepository
A central administration point for the baselines and the baseline candidates.
  • Method Summary

    Modifier and Type Method Description
    boolean baselineExists​(java.lang.String baselineCandidateName)
    Returns true if the baseline exists and false otherwise.
    void copyBaselineCandidateToBaseline​(java.lang.String baselineCandidateName)
    Copies the content of the baseline candidate to the baseline.
    void createBaselineCandidate​(com.fasterxml.jackson.databind.JsonNode data, java.lang.String name)
    Creates a new JsonFile and writes the data into this file.
    void createBaselineCandidate​(java.lang.String data, java.lang.String name)
    Creates a new TextFile and writes the data into this file.
    java.io.File getBaselineAsFile​(java.lang.String name)
    Returns the content of the baseline in a file.
    java.io.File getBaselineCandidateAsFile​(java.lang.String name)
    Returns the content of the baseline candidate in a file.
    java.util.List<java.lang.String> getBaselineCandidateNames()
    Returns a list of all baseline candidates names.
    com.fasterxml.jackson.databind.JsonNode getContentOfJsonBaseline​(java.lang.String baseline)
    Returns the content of the requested baseline.
    java.lang.String getContentOfTextBaseline​(java.lang.String baseline)
    Returns the content of the requested baseline.
    java.lang.String getDifferences​(java.lang.String baselineCandidateName)
    Computes differences of the baseline candidate and the baseline.
    boolean removeBaselineCandidate​(java.lang.String name)
    Removes an baseline candidate by its name.
  • Method Details

    • createBaselineCandidate

      void createBaselineCandidate​(java.lang.String data, java.lang.String name) throws BaselineCandidateCreationFailedException
      Creates a new TextFile and writes the data into this file.
      Parameters:
      data - The data that should be stored in the TextFile
      name - The name of the current baseline
      Throws:
      BaselineCandidateCreationFailedException - if the baseline candidate cannot be created
    • createBaselineCandidate

      void createBaselineCandidate​(com.fasterxml.jackson.databind.JsonNode data, java.lang.String name) throws BaselineCandidateCreationFailedException
      Creates a new JsonFile and writes the data into this file.
      Parameters:
      data - The data that should be stored in the JsonFile
      name - The name of the current baseline
      Throws:
      BaselineCandidateCreationFailedException - if the baseline candidate cannot be created
    • removeBaselineCandidate

      boolean removeBaselineCandidate​(java.lang.String name)
      Removes an baseline candidate by its name.
      Parameters:
      name - the name of the baseline candidate that should be removed
      Returns:
      true if the baseline candidate has successfully been removed, false otherwise.
    • getBaselineCandidateNames

      java.util.List<java.lang.String> getBaselineCandidateNames()
      Returns a list of all baseline candidates names.
      Returns:
      a list of all baseline candidates names.
    • getContentOfJsonBaseline

      com.fasterxml.jackson.databind.JsonNode getContentOfJsonBaseline​(java.lang.String baseline) throws BaselineNotFoundException
      Returns the content of the requested baseline.
      Parameters:
      baseline - the baseline for which the content should be returned
      Returns:
      the content of the baseline
      Throws:
      BaselineNotFoundException - if the baseline cannot be found
    • getContentOfTextBaseline

      java.lang.String getContentOfTextBaseline​(java.lang.String baseline) throws BaselineNotFoundException
      Returns the content of the requested baseline.
      Parameters:
      baseline - the baseline for which the content should be returned
      Returns:
      the content of the baseline
      Throws:
      BaselineNotFoundException - if the baseline cannot be found
    • copyBaselineCandidateToBaseline

      void copyBaselineCandidateToBaseline​(java.lang.String baselineCandidateName) throws BaselineCandidateNotFoundException, BaselineCreationFailedException, CopyingFailedException
      Copies the content of the baseline candidate to the baseline.
      Parameters:
      baselineCandidateName - the name of the baseline candidate
      Throws:
      BaselineCandidateNotFoundException - if the candidate of the baseline cannot be found
      BaselineCreationFailedException - if the baseline cannot be created
      CopyingFailedException - in the case the content of the baseline candidate cannot be copied to the baseline
    • getDifferences

      java.lang.String getDifferences​(java.lang.String baselineCandidateName) throws BaselineCandidateNotFoundException, BaselineNotFoundException
      Computes differences of the baseline candidate and the baseline.
      Parameters:
      baselineCandidateName - the name of the baseline candidate
      Returns:
      a string with the differences
      Throws:
      BaselineCandidateNotFoundException - if the candidate of the baseline cannot be found
      BaselineNotFoundException - if the baseline cannot be found
    • baselineExists

      boolean baselineExists​(java.lang.String baselineCandidateName)
      Returns true if the baseline exists and false otherwise.
      Parameters:
      baselineCandidateName - the baseline candidate for which the baseline should be found.
      Returns:
      true if the baseline exists and false otherwise.
    • getBaselineCandidateAsFile

      java.io.File getBaselineCandidateAsFile​(java.lang.String name) throws java.io.IOException
      Returns the content of the baseline candidate in a file.
      Parameters:
      name - the name of the baseline candidate.
      Returns:
      the content of the baseline candidate in a file.
      Throws:
      java.io.IOException - in the case of problems with the created file.
    • getBaselineAsFile

      java.io.File getBaselineAsFile​(java.lang.String name) throws java.io.IOException
      Returns the content of the baseline in a file.
      Parameters:
      name - the name of the baseline.
      Returns:
      the content of the baseline in a file.
      Throws:
      java.io.IOException - in the case of problems with the created file.