Class AbstractRetrieveHistoryService<S extends AbstractNamedEntity,D extends AbstractCompareEntityDto>

java.lang.Object
org.qubership.atp.itf.lite.backend.service.history.impl.AbstractRetrieveHistoryService<S,D>
All Implemented Interfaces:
HistoryService, RetrieveHistoryService
Direct Known Subclasses:
AbstractRequestRetrieveHistoryService, FolderRetrieveHistoryService

public abstract class AbstractRetrieveHistoryService<S extends AbstractNamedEntity,D extends AbstractCompareEntityDto> extends Object implements RetrieveHistoryService
  • Field Details

  • Constructor Details

    • AbstractRetrieveHistoryService

      public AbstractRetrieveHistoryService(org.javers.core.Javers javers, AbstractVersioningMapper<S,D> abstractVersioningMapper)
  • Method Details

    • getAllHistory

      public HistoryItemResponseDto getAllHistory(UUID id, Integer offset, Integer limit)
      Finds all history of changes for provided entity id.
      Specified by:
      getAllHistory in interface RetrieveHistoryService
      Parameters:
      id - object id of requested entity
      offset - index of the first element in collection
      limit - number of items in collection
      Returns:
      list of changes
    • getEntitiesByVersions

      public List<CompareEntityResponseDto> getEntitiesByVersions(UUID id, List<String> versions)
      Returns collection of entities with requested revision numbers.
      Specified by:
      getEntitiesByVersions in interface RetrieveHistoryService
      Parameters:
      id - uuid of entity in DB.
      versions - collection of requested revision numbers.
      Returns:
      collection of CompareEntityResponse.
    • getChangesByIdPaginationQuery

      protected org.javers.repository.jql.JqlQuery getChangesByIdPaginationQuery(UUID id, Collection<BigDecimal> commitIds)
    • getSnapshotsByLimit

      protected org.javers.repository.jql.JqlQuery getSnapshotsByLimit(UUID id, Integer offset, Integer limit)
    • getChangesByIdQuery

      protected org.javers.repository.jql.JqlQuery getChangesByIdQuery(UUID id)
    • getVersionByCommitId

      protected Integer getVersionByCommitId(List<org.javers.core.metamodel.object.CdoSnapshot> snapshots, org.javers.core.commit.CommitId id)
    • setCommonFields

      protected void setCommonFields(AbstractNamedEntity source, AbstractCompareEntityDto destination, org.javers.core.commit.CommitMetadata commitMetadata)
    • processChildChanges

      protected void processChildChanges(org.javers.core.diff.Change propertyChange, HistoryItemDto historyItemDto)
    • getCountOfCommits

      public Integer getCountOfCommits(UUID id)