Package org.modeshape.jcr.cache

Examples of org.modeshape.jcr.cache.MutableCachedNode.removeChild()


    }

    void removeLock( ModeShapeLock lock ) {
        MutableCachedNode locksNode = mutableLocksNode();
        NodeKey lockKey = lock.getLockKey();
        locksNode.removeChild(system, lockKey);
        system.destroy(lockKey);
    }

    /**
     * Updates the underlying repository directly (i.e., outside the scope of the {@link Session}) to mark the token for the given
View Full Code Here


            } else {
                // we have a projection that is not valid anymore
                invalidProjections.add(projection);

                // remove the projection from the system area first
                federationNode.removeChild(systemSession, projectionRefKey);
                systemSession.destroy(projectionRefKey);

                // then update the internal (parent) node and remove its external child
                NodeKey projectedNodeKey = new NodeKey(projectedNodeKeyString);
View Full Code Here

            CachedNode storedProjection = systemSession.getNode(projectionRefKey);
            String storedProjectionExternalNodeKey = storedProjection.getProperty(ModeShapeLexicon.EXTERNAL_NODE_KEY,
                                                                                  systemSession).getFirstValue().toString();
            assert storedProjectionExternalNodeKey != null;
            if (storedProjectionExternalNodeKey.equals(externalNodeKey)) {
                federationNode.removeChild(systemSession, projectionRefKey);
                systemSession.destroy(projectionRefKey);
                systemSession.save();
                break;
            }
        }
View Full Code Here

            removeHistories((AbstractJcrNode)nodeIterator.nextNode(), systemSession);
        }

        if (versionHistory != null) {
            MutableCachedNode historyParent = systemSession.mutable(versionHistory.parentKey());
            historyParent.removeChild(systemSession, versionHistory.key());
            systemSession.destroy(versionHistory.key());
        }
    }

    @NotThreadSafe
View Full Code Here

                String principalName = permissionNode.getProperty(ModeShapeLexicon.PERMISSION_PRINCIPAL_NAME, cache)
                                                     .getFirstValue().toString();
                if (!privilegesByPrincipalName.containsKey(principalName)) {
                    permissionChanges().principalRemoved(principalName);
                    NodeKey permissionNodeKey = permissionNode.getKey();
                    aclNode.removeChild(cache, permissionNodeKey);
                    cache.destroy(permissionNodeKey);
                }
            }
        } else {
            org.modeshape.jcr.value.Property primaryType = propertyFactory.create(JcrLexicon.PRIMARY_TYPE,
View Full Code Here

                        // Move the link (there can only be one per parent) before the placeholder ...
                        parent.reorderChild(targetCache, linkableKey, placeholderKey);
                    }

                    // And finally remove the placeholder ...
                    parent.removeChild(targetCache, placeholderKey);

                    // Remove the entry ...
                    entryIterator.remove();
                } catch (RuntimeException e) {
                    // Record the problem and continue to try and copy everything else ...
View Full Code Here

                        if (!cache.isDestroyed(targetChild.getKey())) {
                            // the target child exists but is under a different path in the source than the target
                            // so we need to remove it from its parent in the target to avoid the case when later on, it might be
                            // destroyed
                            MutableCachedNode targetChildParent = cache.mutable(targetChild.getParentKey(cache));
                            targetChildParent.removeChild(cache, targetChild.getKey());
                        }
                        resolvedChild = resolveSourceNode(sourceChild, checkinTime, cache);
                    } else {
                        // Pull the resolved node
                        resolvedChild = inSourceOnly.get(sourceChild);
View Full Code Here

                if (primaryParentKey != null) allParents.add(primaryParentKey);
                for (NodeKey parentKey : allParents) {
                    if (parentKey.equals(targetKey)) continue; // skip the new target ...
                    MutableCachedNode parent = cache.mutable(parentKey);
                    if (parent != null) {
                        parent.removeChild(cache, desiredKey);
                    }
                }
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.