Class MongoSync4RepositoryBase<DOMAIN_CLASS>

java.lang.Object
com.github.cloudyrock.mongock.driver.mongodb.sync.v4.repository.MongoSync4RepositoryBase<DOMAIN_CLASS>
All Implemented Interfaces:
io.changock.driver.core.common.Repository<DOMAIN_CLASS,​org.bson.Document>, io.changock.utils.Process
Direct Known Subclasses:
MongoSync4ChangeEntryRepository, MongoSync4LockRepository

public abstract class MongoSync4RepositoryBase<DOMAIN_CLASS>
extends java.lang.Object
implements io.changock.driver.core.common.Repository<DOMAIN_CLASS,​org.bson.Document>
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected com.mongodb.client.MongoCollection<org.bson.Document> collection  
  • Constructor Summary

    Constructors 
    Constructor Description
    MongoSync4RepositoryBase​(com.mongodb.client.MongoCollection<org.bson.Document> collection, java.lang.String[] uniqueFields, boolean indexCreation)  
  • Method Summary

    Modifier and Type Method Description
    protected void cleanResidualUniqueKeys()  
    protected void createRequiredUniqueIndex()  
    protected boolean doesNeedToBeRemoved​(org.bson.Document index)  
    protected void dropIndex​(org.bson.Document index)  
    protected org.bson.Document getIndexDocument​(java.lang.String[] uniqueFields)  
    void initialize()  
    protected boolean isIdIndex​(org.bson.Document index)  
    protected boolean isIndexFine()  
    protected boolean isRequiredIndexCreated()  
    protected boolean isRightIndex​(org.bson.Document index)  
    protected boolean isUniqueIndex​(org.bson.Document index)  
    org.bson.Document mapFieldInstances​(java.util.List<io.changock.utils.field.FieldInstance> fieldInstanceList)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.changock.driver.core.common.Repository

    toEntity
  • Field Details

    • collection

      protected com.mongodb.client.MongoCollection<org.bson.Document> collection
  • Constructor Details

    • MongoSync4RepositoryBase

      public MongoSync4RepositoryBase​(com.mongodb.client.MongoCollection<org.bson.Document> collection, java.lang.String[] uniqueFields, boolean indexCreation)
  • Method Details

    • initialize

      public void initialize()
      Specified by:
      initialize in interface io.changock.utils.Process
    • isIndexFine

      protected boolean isIndexFine()
    • cleanResidualUniqueKeys

      protected void cleanResidualUniqueKeys()
    • doesNeedToBeRemoved

      protected boolean doesNeedToBeRemoved​(org.bson.Document index)
    • isIdIndex

      protected boolean isIdIndex​(org.bson.Document index)
    • isRequiredIndexCreated

      protected boolean isRequiredIndexCreated()
    • createRequiredUniqueIndex

      protected void createRequiredUniqueIndex()
    • isRightIndex

      protected boolean isRightIndex​(org.bson.Document index)
    • isUniqueIndex

      protected boolean isUniqueIndex​(org.bson.Document index)
    • getIndexDocument

      protected org.bson.Document getIndexDocument​(java.lang.String[] uniqueFields)
    • dropIndex

      protected void dropIndex​(org.bson.Document index)
    • mapFieldInstances

      public org.bson.Document mapFieldInstances​(java.util.List<io.changock.utils.field.FieldInstance> fieldInstanceList)
      Specified by:
      mapFieldInstances in interface io.changock.driver.core.common.Repository<DOMAIN_CLASS,​org.bson.Document>