简体   繁体   English

如何检查是否从内容存储库中删除了节点?

[英]How to check if node is removed from content repository?

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. 我正在学习如何使用内容存储库(Jackrabbit),并且不知道如何检查是否确实删除了节点。 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. 我已经将持久性管理器配置为使用postgresql。 Everything works, I just want to know how I can see that the node actually was removed. 一切正常,我只想知道如何看到该节点实际上已被删除。

Not sure what you mean by "actually removed". 不知道“实际删除”是什么意思。 At the JCR level, Session.itemExists(path) will tell you if there's an Item (ie a Node or Property) at the specified path or not. 在JCR级别,Session.itemExists(path)会告诉您指定路径上是否有Item(即Node或Property)。 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. 如果要在磁盘上删除相应的数据,这取决于PersistenceManager的实现-有些将仅按需进行垃圾收集,而另一些将在JCR级别将其删除时立即将其删除。 Lower layers (database, OS, disk) might also keep deleted data around for some time. 较低层(数据库,操作系统,磁盘)也可能会将删除的数据保留一段时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM