All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.modeshape.jcr.cache.change.NodeReordered Maven / Gradle / Ivy

There is a newer version: 5.4.1.Final
Show newest version
package org.modeshape.jcr.cache.change;

import org.modeshape.jcr.cache.NodeKey;
import org.modeshape.jcr.value.Path;

/**
 * A change event which is generated by a {@link javax.jcr.Node#orderBefore(String, String)} operation.
 * 
 * @author Horia Chiorean
 */
public class NodeReordered extends AbstractNodeChange {

    private static final long serialVersionUID = 1L;

    private final Path oldPath;
    private final NodeKey parent;
    private final Path reorderedBeforePath;

    public NodeReordered( NodeKey key,
                          NodeKey parent,
                          Path newPath,
                          Path oldPath,
                          Path reorderedBeforePath ) {
        super(key, newPath);
        this.oldPath = oldPath;
        this.parent = parent;
        this.reorderedBeforePath = reorderedBeforePath;
    }

    public Path getOldPath() {
        return oldPath;
    }

    public NodeKey getParent() {
        return parent;
    }

    /**
     * Gets the path of the node at the "destination" of the reordering.
     * 
     * @return either a node path or null, in case a reordering has happened at the end of the children list
     */
    public Path getReorderedBeforePath() {
        return reorderedBeforePath;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy