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 Summary
FieldsFields inherited from interface org.qubership.atp.itf.lite.backend.service.history.iface.HistoryService
CHILD_ACTIONS_PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionAbstractRetrieveHistoryService(org.javers.core.Javers javers, AbstractVersioningMapper<S, D> abstractVersioningMapper) -
Method Summary
Modifier and TypeMethodDescriptiongetAllHistory(UUID id, Integer offset, Integer limit) Finds all history of changes for provided entity id.protected org.javers.repository.jql.JqlQuerygetChangesByIdPaginationQuery(UUID id, Collection<BigDecimal> commitIds) protected org.javers.repository.jql.JqlQuerygetEntitiesByVersions(UUID id, List<String> versions) Returns collection of entities with requested revision numbers.protected org.javers.repository.jql.JqlQuerygetSnapshotsByLimit(UUID id, Integer offset, Integer limit) protected IntegergetVersionByCommitId(List<org.javers.core.metamodel.object.CdoSnapshot> snapshots, org.javers.core.commit.CommitId id) protected voidprocessChildChanges(org.javers.core.diff.Change propertyChange, HistoryItemDto historyItemDto) protected voidsetCommonFields(AbstractNamedEntity source, AbstractCompareEntityDto destination, org.javers.core.commit.CommitMetadata commitMetadata) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.qubership.atp.itf.lite.backend.service.history.iface.HistoryService
getEntityClass, getItemTypeMethods inherited from interface org.qubership.atp.itf.lite.backend.service.history.iface.RetrieveHistoryService
buildCompareEntity
-
Field Details
-
abstractVersioningMapper
protected final AbstractVersioningMapper<S extends AbstractNamedEntity,D extends AbstractCompareEntityDto> abstractVersioningMapper
-
-
Constructor Details
-
AbstractRetrieveHistoryService
public AbstractRetrieveHistoryService(org.javers.core.Javers javers, AbstractVersioningMapper<S, D> abstractVersioningMapper)
-
-
Method Details
-
getAllHistory
Finds all history of changes for provided entity id.- Specified by:
getAllHistoryin interfaceRetrieveHistoryService- Parameters:
id- object id of requested entityoffset- index of the first element in collectionlimit- number of items in collection- Returns:
- list of changes
-
getEntitiesByVersions
Returns collection of entities with requested revision numbers.- Specified by:
getEntitiesByVersionsin interfaceRetrieveHistoryService- 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
-
getChangesByIdQuery
-
getVersionByCommitId
-
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
-