Class CollectionFileChangeAdapter

  • All Implemented Interfaces:
    CollectionFileChangeListener, java.util.EventListener

    public abstract class CollectionFileChangeAdapter
    extends java.lang.Object
    implements CollectionFileChangeListener
    An abstract adapter class for receiving Collection File Change events. The methods in this class are empty. This class exists as convenience for creating listener objects. Extend this class to create a Collection File Change listener and override only the methods for the events of interest. (If you implement the CollectionFileChangeListener interface, you have to define all of the methods in it. This abstract class defines null methods for them all, so you can only have to define methods for events you care about.)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void collectionFileAdded​(java.lang.String collectionName)
      Invoked when a new file is detected which has a corresponding identified collection.
      void collectionFileDeleted​(java.lang.String collectionName)
      Invoked when a file which has a corresponding identified collection is deleted Deleting files in the background is a dangerous operation after such a operation if the database is reloaded that data will be permanently lost.
      void collectionFileModified​(java.lang.String collectionName)
      Invoked when a file which has a corresponding identified collection is modified by program other than this one.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CollectionFileChangeAdapter

        public CollectionFileChangeAdapter()
    • Method Detail

      • collectionFileAdded

        public void collectionFileAdded​(java.lang.String collectionName)
        Description copied from interface: CollectionFileChangeListener
        Invoked when a new file is detected which has a corresponding identified collection. A identified collection is that for which the package scan found a POJO with the @Document annotation. This also means that such a identified collection did not have a corresponding collection file before. New files which do not have corresponding identified collection are ignored.
        Specified by:
        collectionFileAdded in interface CollectionFileChangeListener
        Parameters:
        collectionName - the name of the collection for which a file was detected.
      • collectionFileDeleted

        public void collectionFileDeleted​(java.lang.String collectionName)
        Description copied from interface: CollectionFileChangeListener
        Invoked when a file which has a corresponding identified collection is deleted Deleting files in the background is a dangerous operation after such a operation if the database is reloaded that data will be permanently lost. However if any operation that modifies the database is done then it will automatically recreate the file.
        Specified by:
        collectionFileDeleted in interface CollectionFileChangeListener
        Parameters:
        collectionName - the name of the collection for which a file was deleted.
      • collectionFileModified

        public void collectionFileModified​(java.lang.String collectionName)
        Description copied from interface: CollectionFileChangeListener
        Invoked when a file which has a corresponding identified collection is modified by program other than this one. Ideally you might want to reload the database on receiving this event. If you ignore and change to the database happens due to a insert of update or any other Database mutating operation the file will be overwritten with the in memory state.
        Specified by:
        collectionFileModified in interface CollectionFileChangeListener
        Parameters:
        collectionName - the name of the collection whose corresponding file was modified.