Interface IRepositoryReadOnlyConnection

All Known Subinterfaces:
IRepositoryConnection

public interface IRepositoryReadOnlyConnection
Connection to hierarchical file storage. The connection can be obtained both inside and outside the transaction. It will never expire so can be cached into a user session.
  • Method Details

    • getRepositoryInfo

      IRepositoryInfo getRepositoryInfo()
      Returns:
      the information about connected repository (IRepositoryInfo)
    • isConnected

      boolean isConnected() throws RepositoryException
      Returns:
      whether it is connected
      Throws:
      RepositoryException
    • exists

      boolean exists(ILocation loc) throws RepositoryException
      Whether given location exists.

      The location can't be a null

      Parameters:
      loc - location
      Returns:
      true if location exists
      Throws:
      RepositoryException - if error occurs
    • isFolder

      boolean isFolder(ILocation loc) throws RepositoryException
      Whether given location exists and is a folder.

      The location can't be a null

      Parameters:
      loc - location
      Returns:
      true if location exists and is a folder
      Throws:
      RepositoryException - if error occurs
    • isFile

      boolean isFile(ILocation loc) throws RepositoryException
      Whether given location exists and is a file.

      The location can't be a null

      Parameters:
      loc - location
      Returns:
      true if location exists and is a file
      Throws:
      RepositoryException - if error occurs
    • getSubLocations

      List getSubLocations(ILocation loc, boolean recurse) throws RepositoryException
      Return list of locations which are under given location.

      The location can't be a null

      Parameters:
      loc - location
      recurse - whether recurse deep inside
      Returns:
      collection of ILocations. The locations are always ordered in such a way, that parents go before their children.
      Throws:
      RepositoryException - if error occurs
    • getSubLocations

      List getSubLocations(ILocation loc, boolean recurse, boolean foldersOnly) throws RepositoryException
      Return list of locations filtered by type which are under given location.

      The location can't be a null

      Parameters:
      loc - location
      recurse - whether recurse deep inside
      foldersOnly - whether to return only folders or only files
      Returns:
      collection of ILocations. The locations are always ordered in such a way, that parents go before their children.
      Throws:
      RepositoryException - if error occurs
      Since:
      3.5.0
    • getResourceProperties

      IResourceProperties getResourceProperties(ILocation loc) throws RepositoryException
      Return system properties for resource on given location.

      The location can't be a null

      Parameters:
      loc - location
      Returns:
      resource properties
      Throws:
      RepositoryException - if error occurs
    • getContent

      InputStream getContent(ILocation loc) throws RepositoryException
      Get file content.

      The location can't be a null

      Parameters:
      loc - location
      Returns:
      file content as stream of bytes
      Throws:
      RepositoryException - if error occurs
    • getFirstRevision

      String getFirstRevision(ILocation loc) throws RepositoryException
      The first ("oldest") revision name for the given location. If location has the revision it will be returned

      The location can't be a null

      Returns:
      the first ("oldest") revision name, can't be a null
      Throws:
      RepositoryException
    • getLastRevision

      String getLastRevision(ILocation loc) throws RepositoryException
      Get the last revision for the given location. If location has the revision it will be returned

      The location can't be a null

      Parameters:
      loc - location
      Returns:
      current revision
      Throws:
      RepositoryException - if error occurs
    • getChanges

      Map getChanges(Collection loctions, Date startDate, Date endDate) throws com.polarion.platform.service.repository.driver.DriverException
      Return the locations changes for selected location from date to date
      Parameters:
      loctions -
      startDate - start date
      endDate - end date
      Returns:
      Map from revision IRevisionMetaData to List of ILocationChangeMetaData. Map will include all changes which happen AFTER start date and BEFORE end date inside given locations. Exception if startDate is the same as endDate. In that case should returns changes for the lastest revision of selected locations and all sublocations BEFORE endDate. In case repository-wide revision it means all changes in the latest revision, in case of location wide revision will be returned information for ALL resources in the in the givel locations which have at least one modification BEFORE endDate.
      Throws:
      com.polarion.platform.service.repository.driver.DriverException
      RepositoryException - if error occurs
    • getChanges

      Map getChanges(Date startDate, Date endDate) throws com.polarion.platform.service.repository.driver.DriverException
      Return the locations changes for whole repository from date to date
      Parameters:
      startDate - start date
      endDate - end date
      Returns:
      Map from revision IRevisionMetaData to List of ILocationChangeMetaData. Map will include all changes which happen AFTER start date and BEFORE end date. Exception if startDate is the same as endDate. In that case should returns changes for the lastest revision BEFORE endDate. In case repository-wide revision it means all changes in the latest revision, in case of location wide revision will be returned information for ALL resources in the repository which have at least one modification BEFORE endDate.
      Throws:
      com.polarion.platform.service.repository.driver.DriverException
      RepositoryException - if error occurs
    • getRevisionMetaData

      IRevisionMetaData getRevisionMetaData(ILocation loc, boolean extended) throws RepositoryException
      Return meta data for given resource and revision.

      If revision is not specified in location, latest revision is taken.

      The location can't be a null

      Parameters:
      loc - resource location
      extended - if IExtendedRevisionMetaData should be returned
      Returns:
      revision meta data
      Throws:
      RepositoryException - if error occurs
    • getRevisionsMetaData

      List getRevisionsMetaData(ILocation loc, boolean extended) throws RepositoryException
      Return all meta data for given resource.

      If revision will specified in location, it will be ignored.

      The location can't be a null

      Parameters:
      loc - resource location
      extended - if IExtendedRevisionMetaData should be returned. NOTE that if extended == true, then the call is much more expensive than for false.
      Returns:
      List of IRevisionMetaDatas
      Throws:
      RepositoryException - if error occurs
    • getRevisionsMetaData

      List getRevisionsMetaData(ILocation loc, String toRevision, boolean extended) throws com.polarion.platform.service.repository.driver.DriverException
      Return selected metadata for given resource. The location can be a null.
      Parameters:
      loc - resource location with start revision. If null then only metadata for toRevision are returned (thus returned List has just one item).
      toRevision - end revision or null for latest
      extended - if IExtendedRevisionMetaData should be returned NOTE that if extended == true, then the call is much more expensive than for false.
      Returns:
      List of IRevisionMetaDatas
      Throws:
      com.polarion.platform.service.repository.driver.DriverException
      RepositoryException - if error occurs
    • getProperty

      String getProperty(ILocation loc, String name) throws RepositoryException
      Get property value.

      The location or name can't be a null

      Parameters:
      loc - resource location
      name - property name
      Returns:
      property value or null if not set
      Throws:
      RepositoryException - if error occurs
    • getProperties

      Map getProperties(ILocation loc) throws RepositoryException
      Get properties map. The location can't be a null.

      The location can't be a null

      Parameters:
      loc - resource location
      Returns:
      Map (property name (String) -> property value (String)) (not null)
      Throws:
      RepositoryException - if error occurs
    • getCurrentRepositoryState

      String getCurrentRepositoryState() throws RepositoryException
      Return the id of a current repository state.

      The IDataService.getLastStorageRevision() method should be used instead of this one in use cases related to the model objects (i.e. the ones returned by IDataService.getInstance(IObjectId)).

      The meaning of a repository state depends on the repository itself and the driver implementation. Generally it is a repository-wide identifier that reflects the state of the repository in time. E.g. for SVN, it is a revision for CVS - it can be a date or tag. for CVS it can be a date or tag.

      Returns:
      the id of a current state of a repository
      Throws:
      RepositoryException
    • getRepositoryState

      String getRepositoryState(@NotNull Date date) throws RepositoryException
      Return the id of a repository state at the given moment.

      The IDataService.getStorageRevisionAt(Date) method should be used instead of this one in use cases related to the model objects (i.e. the ones returned by IDataService.getInstance(IObjectId)).

      See getCurrentRepositoryState() for explanation of the meaning of a repository state.

      The date can't be a null

      Parameters:
      date - - timestamp used to get the state
      Returns:
      the id of a repository state for a given time
      Throws:
      RepositoryException
    • getPreviousState

      String getPreviousState(String repositoryState) throws RepositoryException
      Returns the previous state for the given state.

      The IDataService.getPreviousStorageRevision(String) method should be used instead of this one in use cases related to the model objects (i.e. the ones returned by IDataService.getInstance(IObjectId)).

      Parameters:
      repositoryState - can't be a null
      Returns:
      the previous state
      Throws:
      RepositoryException
    • getNextState

      String getNextState(String repositoryState) throws RepositoryException
      Returns the next state for given state.

      state can't be a null

      Parameters:
      repositoryState - state to get next
      Returns:
      the next state
      Throws:
      RepositoryException
    • getRepositoryStateDate

      Date getRepositoryStateDate(String repositoryState) throws RepositoryException
      Return a date of some repository state.

      See getCurrentRepositoryState() for explanation of the meaning of a repository state.

      The state can't be a null

      Parameters:
      repositoryState -
      Returns:
      Date of given state or null if repository newer had such state.
      Throws:
      RepositoryException
    • getChanges

      Map getChanges(Collection loctions, String startState, String endState) throws com.polarion.platform.service.repository.driver.DriverException
      Return the locations changes for selected location from state (exclusive) to state (inclusive)

      See getCurrentRepositoryState() for explanation of the meaning of a repository state.

      Parameters:
      loctions -
      startState - start state if null from the initial state
      endState - end state if null to the current state
      Returns:
      Map from revision IRevisionMetaData to List of ILocationChangeMetaData. Map will include all changes which happen from the start state to the end state (inclusive) inside given locations.
      Throws:
      com.polarion.platform.service.repository.driver.DriverException
      RepositoryException - if error occurs
    • getChanges

      Map getChanges(String startState, String endState) throws com.polarion.platform.service.repository.driver.DriverException
      Return the locations changes for whole repository from state (exclusive) to state (inclusive)

      See getCurrentRepositoryState() for explanation of the meaning of a repository state.

      Parameters:
      startState - start state if null from the initial state
      endState - end state if null to the current state
      Returns:
      Map from revision IRevisionMetaData to List of ILocationChangeMetaData. Map will include all changes which happen from the start state to the end state (inclusive).
      Throws:
      com.polarion.platform.service.repository.driver.DriverException
      RepositoryException - if error occurs
    • getMergedRevisionsMetaData

      List<IRevisionMetaData> getMergedRevisionsMetaData(String state) throws com.polarion.platform.service.repository.driver.DriverException
      Returns list (in implementation-dependent order) of meta data of revisions which were merged into given state.

      Empty list will be returned if repository does not support merges/merge tracking.

      Parameters:
      state - repository state (current state if null)
      Returns:
      List of IRevisionMetaDatas (not null)
      Throws:
      com.polarion.platform.service.repository.driver.DriverException - if error occurs
      Since:
      3.3.0