Package io.jsondb.events
Interface CollectionFileChangeListener
-
- All Superinterfaces:
java.util.EventListener
- All Known Implementing Classes:
CollectionFileChangeAdapter
public interface CollectionFileChangeListener extends java.util.EventListenerA listener which fires when a change to one or more files which have corresponding identified collections is detected.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcollectionFileAdded(java.lang.String collectionName)Invoked when a new file is detected which has a corresponding identified collection.voidcollectionFileDeleted(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.voidcollectionFileModified(java.lang.String collectionName)Invoked when a file which has a corresponding identified collection is modified by program other than this one.
-
-
-
Method Detail
-
collectionFileAdded
void collectionFileAdded(java.lang.String collectionName)
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.- Parameters:
collectionName- the name of the collection for which a file was detected.
-
collectionFileDeleted
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. However if any operation that modifies the database is done then it will automatically recreate the file.- Parameters:
collectionName- the name of the collection for which a file was deleted.
-
collectionFileModified
void collectionFileModified(java.lang.String collectionName)
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.- Parameters:
collectionName- the name of the collection whose corresponding file was modified.
-
-