Class MongoSync4ChangeEntryRepository<CHANGE_ENTRY extends io.changock.driver.api.entry.ChangeEntry>

java.lang.Object
com.github.cloudyrock.mongock.driver.mongodb.sync.v4.repository.MongoSync4RepositoryBase<CHANGE_ENTRY>
com.github.cloudyrock.mongock.driver.mongodb.sync.v4.repository.MongoSync4ChangeEntryRepository<CHANGE_ENTRY>
All Implemented Interfaces:
io.changock.driver.api.entry.ChangeEntryService<CHANGE_ENTRY>, io.changock.driver.core.common.Repository<CHANGE_ENTRY,​org.bson.Document>, io.changock.driver.core.entry.ChangeEntryRepository<CHANGE_ENTRY,​org.bson.Document>, io.changock.utils.Process

public class MongoSync4ChangeEntryRepository<CHANGE_ENTRY extends io.changock.driver.api.entry.ChangeEntry>
extends MongoSync4RepositoryBase<CHANGE_ENTRY>
implements io.changock.driver.core.entry.ChangeEntryRepository<CHANGE_ENTRY,​org.bson.Document>
  • Constructor Details

    • MongoSync4ChangeEntryRepository

      public MongoSync4ChangeEntryRepository​(com.mongodb.client.MongoCollection<org.bson.Document> collection, boolean indexCreation)
  • Method Details

    • isAlreadyExecuted

      public boolean isAlreadyExecuted​(java.lang.String changeSetId, java.lang.String author) throws io.changock.migration.api.exception.ChangockException
      Specified by:
      isAlreadyExecuted in interface io.changock.driver.api.entry.ChangeEntryService<CHANGE_ENTRY extends io.changock.driver.api.entry.ChangeEntry>
      Throws:
      io.changock.migration.api.exception.ChangockException
    • save

      public void save​(CHANGE_ENTRY changeEntry) throws io.changock.migration.api.exception.ChangockException
      Specified by:
      save in interface io.changock.driver.api.entry.ChangeEntryService<CHANGE_ENTRY extends io.changock.driver.api.entry.ChangeEntry>
      Throws:
      io.changock.migration.api.exception.ChangockException
    • buildSearchQueryDBObject

      protected org.bson.conversions.Bson buildSearchQueryDBObject​(java.lang.String changeSetId, java.lang.String author)
      Check if a changeSet with given changeSetId and author and (state == EXECUTED OR state == null OR estate doesn't exists)
      Parameters:
      changeSetId - changeSetId
      author - author
      Returns:
      true if a changeSet with given changeSetId and author is already executed, false otherwise