Package org.apache.jackrabbit.core.version

Examples of org.apache.jackrabbit.core.version.InternalVersion


        // in order to maintain item cache consistency
        ItemLifeCycleListener[] listeners = new ItemLifeCycleListener[]{this};

        // check special nodes
        if (state.getNodeTypeName().equals(QName.NT_VERSION)) {
            InternalVersion version =
                    session.getVersionManager().getVersion(state.getUUID());
            return createVersionInstance(id, state, def, listeners);

        } else if (state.getNodeTypeName().equals(QName.NT_VERSIONHISTORY)) {
            InternalVersionHistory history =
View Full Code Here


     */
    protected AbstractVersion createVersionInstance(
            NodeId id, NodeState state, NodeDefinition def,
            ItemLifeCycleListener[] listeners) throws RepositoryException {

        InternalVersion version =
                session.getVersionManager().getVersion(id.getUUID());
        return new VersionImpl(this, session, id, state, def, listeners, version);
    }
View Full Code Here

     */
    protected AbstractVersion createVersionInstance(
            NodeId id, NodeState state, NodeDefinition def,
            ItemLifeCycleListener[] listeners) throws RepositoryException {

        InternalVersion version =
                session.getVersionManager().getVersion(id.getUUID());
        return new XAVersion(this, session, id, state, def, listeners, version);
    }
View Full Code Here

     * {@inheritDoc}
     */
    public Version getBaseVersion(String absPath)
            throws RepositoryException {
        NodeStateEx state = getNodeState(absPath);
        InternalVersion v = getBaseVersion(state);
        return (Version) session.getNodeById(v.getId());
    }
View Full Code Here

            throw new InvalidItemStateException(msg);
        }
        // add all versions to map of versions to restore
        Map<NodeId, InternalVersion> toRestore = new HashMap<NodeId, InternalVersion>();
        for (Version version : versions) {
            InternalVersion v = vMgr.getVersion(((VersionImpl) version).getNodeId());
            // check for collision
            NodeId historyId = v.getVersionHistory().getId();
            if (toRestore.containsKey(historyId)) {
                String msg = "Unable to restore. Two or more versions have same version history.";
                log.error(msg);
                throw new VersionException(msg);
            }
View Full Code Here

            NodeStateEx state = getNodeState(parent,
                    ItemValidator.CHECK_PENDING_CHANGES | ItemValidator.CHECK_LOCK | ItemValidator.CHECK_HOLD,
                    Permission.NONE);

            // check if given version is a baseline
            InternalVersion v = getVersion(version);
            if (v instanceof InternalBaseline) {
                restore(state, name, (InternalBaseline) v);
            } else {
                restore(state, name, v, removeExisting);
            }
View Full Code Here

    protected void restore(NodeImpl node, Version version, boolean removeExisting)
            throws RepositoryException {
        NodeStateEx state = getNodeState(node.getPath(),
                ItemValidator.CHECK_PENDING_CHANGES | ItemValidator.CHECK_LOCK | ItemValidator.CHECK_HOLD,
                Permission.NONE);
        InternalVersion v = getVersion(version);
        restore(state, v, removeExisting);
    }
View Full Code Here

                    seenRoot |= JCR_ROOTVERSION.equals(versionName);

                    log.debug("Checking version history of node {}, version {}", nid, versionName);

                    message = intro + " (getting version " + versionName + "  failed)";
                    InternalVersion v = vh.getVersion(versionName);

                    message = intro + "(frozen node of root version " + v.getId() + " missing)";
                    if (null == v.getFrozenNode()) {
                        throw new InconsistentVersioningState(message);
                    }
                }

                if (!seenRoot) {
View Full Code Here

            throws RepositoryException {
        return perform(new SessionOperation<Version> () {
            public Version perform(SessionContext context)
                    throws RepositoryException {
                NodeStateEx state = getNodeState(absPath);
                InternalVersion v = getBaseVersion(state);
                return (Version) session.getNodeById(v.getId());
            }
            public String toString() {
                return "versionManager.getBaseVersion(" + absPath + ")";
            }
        });
View Full Code Here

                // add all versions to map of versions to restore
                Map<NodeId, InternalVersion> toRestore =
                    new HashMap<NodeId, InternalVersion>();
                for (Version version : versions) {
                    InternalVersion v =
                        vMgr.getVersion(((VersionImpl) version).getNodeId());
                    // check for collision
                    NodeId historyId = v.getVersionHistory().getId();
                    if (toRestore.containsKey(historyId)) {
                        throw new VersionException(
                                "Unable to restore. Two or more versions have same version history.");
                    }
                    toRestore.put(historyId, v);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.version.InternalVersion

Copyright © 2018 www.massapicom. 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.