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

javax.jcr.version.Version Maven / Gradle / Ivy

There is a newer version: 2024.11.18751.20241128T090041Z-241100
Show newest version
/*
 * Copyright 2009 Day Management AG, Switzerland. All rights reserved.
 */
package javax.jcr.version;

import javax.jcr.Node;
import javax.jcr.RepositoryException;
import java.util.Calendar;

/**
 * A Version object wraps an nt:version node. It
 * provides convenient access to version information.
 */
public interface Version extends Node {

    /**
     * Returns the VersionHistory that contains this
     * Version.
     *
     * @return the VersionHistory that contains this
     *         Version.
     * @throws RepositoryException if an error occurs.
     */
    public VersionHistory getContainingHistory() throws RepositoryException;

    /**
     * Returns the date this version was created. This corresponds to the value
     * of the jcr:created property in the nt:version
     * node that represents this version.
     *
     * @return a Calendar object
     * @throws RepositoryException if an error occurs.
     */
    public Calendar getCreated() throws RepositoryException;

    /**
     * Assuming that this Version object was acquired through a
     * Workspace W and is within the
     * VersionHistory H, this method returns the
     * successor of this version along the same line of descent as is returned
     * by H.getAllLinearVersions() where H was also
     * acquired through W.
     * 

* Note that under simple versioning the behavior of this method is * equivalent to getting the unique successor (if any) of this version. * * @return a Version or null if no linear * successor exists. * @throws RepositoryException if an error occurs. * @see VersionHistory#getAllLinearVersions */ public Version getLinearSuccessor() throws RepositoryException; /** * Returns the successor versions of this version. This corresponds to * returning all the nt:version nodes referenced by the * jcr:successors multi-value property in the * nt:version node that represents this version. *

* In a simple versioning repository this method * * @return a Version array. * @throws RepositoryException if an error occurs. */ public Version[] getSuccessors() throws RepositoryException; /** * Assuming that this Version object was acquired through a * Workspace W and is within the * VersionHistory H, this method returns the * predecessor of this version along the same line of descent as is returned * by H.getAllLinearVersions() where H was also * acquired through W. *

* Note that under simple versioning the behavior of this method is * equivalent to getting the unique predecessor (if any) of this version. * * @return a Version or null if no linear * predecessor exists. * @throws RepositoryException if an error occurs. * @see VersionHistory#getAllLinearVersions */ public Version getLinearPredecessor() throws RepositoryException; /** * In both simple and full versioning repositories, this method returns the * predecessor versions of this version. This corresponds to returning all * the nt:version nodes whose jcr:successors * property includes a reference to the nt:version node that * represents this version. * * @return a Version array. * @throws RepositoryException if an error occurs. */ public Version[] getPredecessors() throws RepositoryException; /** * Returns the frozen node of this version. * * @return a Node object * @throws RepositoryException if an error occurs. * @since JCR 2.0 */ public Node getFrozenNode() throws RepositoryException; }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy