How to check if node is removed from content repository?

920 Views Asked by At

I am learning how to use a content repository (Jackrabbit) and I wonder how it is possible to check if a node actually was removed. I use datastore and I know that is immutable however the node must be stored somewhere? I have configured the persistence manager to use postgresql. Everything works, I just want to know how I can see that the node actually was removed.

1

There are 1 best solutions below

8
On

Not sure what you mean by "actually removed". At the JCR level, Session.itemExists(path) will tell you if there's an Item (i.e. a Node or Property) at the specified path or not. Call this with an admin session to make sure access control doesn't get in the way.

If you're looking for on-disk deletion of the corresponding data, that's down to the PersistenceManager implementation - some will only garbage collect deleted data on demand, while others will delete it immediately when it is deleted at the JCR level. Lower layers (database, OS, disk) might also keep deleted data around for some time.