lv.lumii.tda.raapi

## Interface IRepositoryManagement

- All Known Subinterfaces:
    IRepository

      public interface IRepositoryManagement

  The `IRepositoryManagement` interface contains technical operations on repositories such as operations for opening, closing, saving, etc. This interface is a complement to `RAAPI`.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `cancelSave()` Rolls back the started save process.
    `void` | `close()` Closes the repository without save.
    `boolean` | `drop(java.lang.String location)` Deletes the repository at the given location.
    `boolean` | `exists(java.lang.String location)` Checks whether the given location is already occupied by some repository of the same type.
    `boolean` | `finishSave()` Finishes the two-phase save process of the repository.
    `boolean` | `open(java.lang.String location)` Opens or creates (if the repository does not exist yet) the repository at the given location.
    `boolean` | `startSave()` Starts the two-phase save process of the repository.

- - ### Method Detail

    - #### exists

          boolean exists(java.lang.String location)

      Checks whether the given location is already occupied by some repository of the same type. This can be used to ask for the user confirmation to drop an existing repository, when creating a new one at the same location.
      Parameters:
        `location` - a string denoting the location to check. The location string is is specific to the type of the repository, e.g., for ECore this is the .xmi file name, for JR this is the folder name, etc. TDA Kernel requires a URI, containing the repository name followed by a colon followed by a repository-specific location, e.g., "jr:/path/to/repository".
      Returns:
        whether the given location is already occupied by some repository of the same type.

    - #### open

          boolean open(java.lang.String location)

      Opens or creates (if the repository does not exist yet) the repository at the given location. This can be used to ask for the user confirmation to drop an existing repository, when creating a new one at the same location.
      Parameters:
        `location` - a string denoting the location of the repository. The location string is is specific to the type of the repository, e.g., for ECore this is the .xmi file name, for JR this is the folder name, etc. TDA Kernel requires a URI, containing the repository name followed by a colon followed by a repository-specific location, e.g., "jr:/path/to/repository".
      Returns:
        whether the repository has been opened or created.

    - #### close

          void close()

      Closes the repository without save.
      See Also:
        `startSave()`, `finishSave()`, `cancelSave()`

    - #### startSave

          boolean startSave()

      Starts the two-phase save process of the repository. The save process can be rolled back by calling `cancelSave` or commited by calling `finishSave`.
      Returns:
        whether the operation succeeded. If `false` is returned, neither `cancelSave`, nor `finishSave` must be called.
      See Also:
        `finishSave()`, `cancelSave()`

    - #### finishSave

          boolean finishSave()

      Finishes the two-phase save process of the repository. After finishing, the save process cannot be rolled back anymore.
      Returns:
        whether the operation succeeded.
      See Also:
        `startSave()`, `cancelSave()`

    - #### cancelSave

          boolean cancelSave()

      Rolls back the started save process. The repository content on the disk (or other media) is returned to the previous state. The repository content currently loaded in memory is not changed.
      Returns:
        whether the operation succeeded.
      See Also:
        `startSave()`, `finishSave()`

    - #### drop

          boolean drop(java.lang.String location)

      Deletes the repository at the given location. The repository must be closed.
      Parameters:
        `location` - a string denoting the location of the repository. The location string is specific to the type of the repository, e.g., for ECore this is the .xmi file name, for JR this is the folder name, etc. TDA Kernel requires a URI, containing the repository name followed by a colon followed by a repository-specific location, e.g., "jr:/path/to/repository".
      Returns:
        whether the operation succeeded.