Package org.modeshape.jcr.cache

Examples of org.modeshape.jcr.cache.SessionCache.save()


        }

        system.mutable(key).removeChild(system, version.key);
        system.destroy(version.key);
        try {
            system.save();
        } catch (org.modeshape.jcr.cache.ReferentialIntegrityException e) {
            // expected by the tck
            throw new ReferentialIntegrityException(e);
        }
    }
View Full Code Here


        // Use a separate system session to set the REFERENCE property on the 'nt:versionLabels' child node ...
        SessionCache system = session.createSystemCache(false);
        Reference labelReference = session.referenceFactory().create(version.key(), true);
        Property ref = session.propertyFactory().create(nameFrom(label), labelReference);
        system.mutable(versionLabels.key()).setProperty(system, ref);
        system.save();
    }

    @Override
    public void removeVersionLabel( String label ) throws VersionException, RepositoryException {
        AbstractJcrNode versionLabels = versionLabels();
View Full Code Here

        }

        // Use a separate system session to remove the REFERENCE property on the 'nt:versionLabels' child node ...
        SessionCache system = session.createSystemCache(false);
        system.mutable(versionLabels.key()).removeProperty(system, propName);
        system.save();
    }

    @Override
    public NodeIterator getAllFrozenNodes() throws RepositoryException {
        return new FrozenNodeIterator(getAllVersions());
View Full Code Here

                ExecutionContext context = runningState.context();
                SessionCache systemSession = runningState.createSystemSession(context, false);
                SystemContent systemContent = new SystemContent(systemSession);
                MutableCachedNode systemNode = systemContent.mutableSystemNode();
                systemNode.setProperty(systemSession, context.getPropertyFactory().create(ModeShapeLexicon.ACL_COUNT, nodesWithAccessControl));
                systemSession.save();
            } catch (RepositoryException e) {
               LOGGER.error(e, JcrI18n.upgrade4_0_0_Alpha1_Failed, e.getMessage());
            }
        }
    }
View Full Code Here

        SessionCache sessionCache = this.session.spawnSessionCache(false);
        String externalNodeKey = documentStore.createExternalProjection(parentNodeToBecomeFederatedKey.toString(), sourceName,
                                                                        externalPath, projectionAlias);
        MutableCachedNode node = sessionCache.mutable(parentNodeToBecomeFederatedKey);
        node.addFederatedSegment(externalNodeKey, projectionAlias);
        sessionCache.save();
    }

    @Override
    public void removeProjection( String projectionPath ) throws RepositoryException {
        CheckArg.isNotNull(projectionPath, "projectionPath");
View Full Code Here

        NodeKey externalNodeKey = session.getNode(path.getString()).key();

        SessionCache sessionCache = session.spawnSessionCache(false);
        MutableCachedNode federatedNode = sessionCache.mutable(federatedNodeKey);
        federatedNode.removeFederatedSegment(externalNodeKey.toString());
        sessionCache.save();
    }
}
View Full Code Here

                String wsName = workspaceNameByKey.get(projectedNodeKey.getWorkspaceKey());
                if (!StringUtil.isBlank(wsName)) {
                    SessionCache sessionCache = repository.repositoryCache().createSession(repository.context(), wsName, false);
                    MutableCachedNode parentNode = sessionCache.mutable(projectedNodeKey);
                    parentNode.removeFederatedSegment(externalNodeKeyString);
                    sessionCache.save();
                }
            }
        }

        if (!invalidProjections.isEmpty()) {
View Full Code Here

            // there isn't a federation node present, so we need to add it
            try {
                Property primaryType = propertyFactory.create(JcrLexicon.PRIMARY_TYPE, ModeShapeLexicon.FEDERATION);
                systemNode.createChild(systemSession, systemNodeKey.withId("mode:federation"), ModeShapeLexicon.FEDERATION,
                                       primaryType);
                systemSession.save();
                federationNodeRef = systemNode.getChildReferences(systemSession).getChild(ModeShapeLexicon.FEDERATION);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
View Full Code Here

                                                               projection.getProjectedNodeKey());
        Property alias = propertyFactory.create(ModeShapeLexicon.PROJECTION_ALIAS, projection.getAlias());
        federationNode.createChild(systemSession, federationNodeKey.withRandomId(), ModeShapeLexicon.PROJECTION, primaryType,
                                   externalNodeKeyProp, projectedNodeKeyProp, alias);

        systemSession.save();
    }

    /**
     * Returns the key of the internal (federated) node which has been projected on the external node with the given key.
     *
 
View Full Code Here

                                                                                  systemSession).getFirstValue().toString();
            assert storedProjectionExternalNodeKey != null;
            if (storedProjectionExternalNodeKey.equals(externalNodeKey)) {
                federationNode.removeChild(systemSession, projectionRefKey);
                systemSession.destroy(projectionRefKey);
                systemSession.save();
                break;
            }
        }
    }
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.