01: /*
02: * Copyright 2006 Day Management AG, Switzerland. All rights reserved.
03: */
04: package javax.jcr.version;
05:
06: import javax.jcr.Node;
07: import javax.jcr.RepositoryException;
08: import java.util.Calendar;
09:
10: /**
11: * A <code>Version</code> object wraps an <code>nt:version</code> node. It
12: * provides convenient access to version information.
13: */
14: public interface Version extends Node {
15:
16: /**
17: * Returns the <code>VersionHistory</code> that contains this <code>Version</code>.
18: * @return the <code>VersionHistory</code> that contains this <code>Version</code>.
19: * @throws RepositoryException if an error occurs.
20: */
21: public VersionHistory getContainingHistory()
22: throws RepositoryException;
23:
24: /**
25: * Returns the date this version was created. This corresponds to the value
26: * of the <code>jcr:created</code> property in the <code>nt:version</code>
27: * node that represents this version.
28: *
29: * @return a <code>Calendar</code> object
30: * @throws RepositoryException if an error occurs.
31: */
32: public Calendar getCreated() throws RepositoryException;
33:
34: /**
35: * Returns the successor versions of this version. This corresponds to
36: * returning all the <code>nt:version</code> nodes referenced by the
37: * <code>jcr:successors</code> multi-value property in the
38: * <code>nt:version</code> node that represents this version.
39: *
40: * @return a <code>Version</code> array.
41: * @throws RepositoryException if an error occurs.
42: */
43: public Version[] getSuccessors() throws RepositoryException;
44:
45: /**
46: * Returns the predecessor versions of this version. This corresponds to
47: * returning all the <code>nt:version</code> nodes whose
48: * <code>jcr:successors</code> property includes a reference to the
49: * <code>nt:version</code> node that represents this version.
50: *
51: * @return a <code>Version</code> array.
52: * @throws RepositoryException if an error occurs.
53: */
54: public Version[] getPredecessors() throws RepositoryException;
55:
56: /**
57: * Returns the frozen node of this version.
58: *
59: * @return a <code>Node</code> object
60: * @throws RepositoryException if an error occurs.
61: * @since JCR 2.0
62: */
63: public Node getFrozenNode() throws RepositoryException;
64: }
|