Class JaversSnapshotRepositoryImpl
java.lang.Object
org.qubership.atp.ram.repositories.impl.JaversSnapshotRepositoryImpl
- All Implemented Interfaces:
JaversSnapshotRepository
@Repository
public class JaversSnapshotRepositoryImpl
extends Object
implements JaversSnapshotRepository
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteByCdoIdAndVersions(String cdoId, List<Long> versions) Remove old objects by cdoId and versions.voiddeleteByCdoIds(List<String> cdoIds) Remove objects by cdoIds.Returns all unique cdoIds.findCdoIdAndCount(List<String> listOfCdoId) Returns cdoId and number of objects with current cdoId.Returns terminal snapshots id.voidupdateAsInitial(String cdoId, Long version) Update object with min version as initial.
-
Constructor Details
-
JaversSnapshotRepositoryImpl
public JaversSnapshotRepositoryImpl()
-
-
Method Details
-
findCdoIdAndCount
Returns cdoId and number of objects with current cdoId. Query example: { "$match": { "globalId.cdoId": { "$in": {listOfCdoId} } } }, { "$group": { "_id": "$globalId.cdoId", "version": { "$addToSet": "$version" } } }, { "$project": { "cdoId": "$_id", "$versions": "$version", "_id": 0 } }- Specified by:
findCdoIdAndCountin interfaceJaversSnapshotRepository- Returns:
ListofJaversCountResponse
-
findAllCdoIds
Returns all unique cdoIds. Query example: { "$group": { "_id": "$globalId.cdoId", } }, { "$project": { "cdoId": "$_id", "_id": 0 } }- Specified by:
findAllCdoIdsin interfaceJaversSnapshotRepository- Returns:
ListofJaversIdsResponse
-
deleteByCdoIdAndVersions
Remove old objects by cdoId and versions. Query example: { "globalId.cdoId": {cdoId}, "version": { "$in": [{versions}] } }- Specified by:
deleteByCdoIdAndVersionsin interfaceJaversSnapshotRepository- Parameters:
cdoId- cdo idversions-ListofLongof old versions
-
updateAsInitial
Update object with min version as initial. Query example: { "globalId.cdoId": {cdoId}, "version": {version}, }, { $set: { "type": "INITIAL" } }- Specified by:
updateAsInitialin interfaceJaversSnapshotRepository- Parameters:
cdoId- cdo idversion- version
-
findTerminatedSnapshots
Returns terminal snapshots id. Query example: { $match: { "type": "TERMINAL" } }, { $project: { "cdoId": "$globalId.cdoId", "_id": 0 } }- Specified by:
findTerminatedSnapshotsin interfaceJaversSnapshotRepository- Returns:
ListofJaversIdsResponse
-
deleteByCdoIds
Remove objects by cdoIds. Query example: { "globalId.cdoId": { $in: [{cdoIds}] } }- Specified by:
deleteByCdoIdsin interfaceJaversSnapshotRepository- Parameters:
cdoIds-ListofStringof old cdoIds.
-