/** * Return versionhistory that contains this version item * * @return versionhistory that contains this version item * @throws RepositoryException * @see javax.jcr.version.Version#getContainingHistory() */ private VersionHistory getVersionHistoryItem() throws RepositoryException { return ((Version)item).getContainingHistory(); }
/** * Get containing version history. * * @return version history associated to this version */ public VersionHistory getContainingHistory() throws RepositoryException { return this.state.getContainingHistory(); }
@Override public VersionHistory getContainingHistory() throws RepositoryException { return version.getContainingHistory(); }
/** * @inheritDoc */ public VersionHistory getContainingHistory() throws RepositoryException { VersionHistory vHistory = version.getContainingHistory(); return factory.getVersionHistoryDecorator(session, vHistory); }
/** * Returns the version history of this node. * <p> * The default implementation returns the containing version history of * the base version of this node. * * @return version history * @throws RepositoryException if an error occurs */ public VersionHistory getVersionHistory() throws RepositoryException { return getBaseVersion().getContainingHistory(); }
/** * Returns the version history of this node. * <p> * The default implementation returns the containing version history of * the base version of this node. * * @return version history * @throws RepositoryException if an error occurs */ public VersionHistory getVersionHistory() throws RepositoryException { return getBaseVersion().getContainingHistory(); }
/** * Returns the version history of this node. * <p> * The default implementation returns the containing version history of * the base version of this node. * * @return version history * @throws RepositoryException if an error occurs */ public VersionHistory getVersionHistory() throws RepositoryException { return getBaseVersion().getContainingHistory(); }
/** * Returns the version history of this node. * <p> * The default implementation returns the containing version history of * the base version of this node. * * @return version history * @throws RepositoryException if an error occurs */ public VersionHistory getVersionHistory() throws RepositoryException { return getBaseVersion().getContainingHistory(); }
@Override public VersionHistory getContainingHistory() throws RepositoryException { return getWrappedVersion().getContainingHistory(); }
/** * Return versionhistory that contains this version item * * @return versionhistory that contains this version item * @throws RepositoryException * @see javax.jcr.version.Version#getContainingHistory() */ private VersionHistory getVersionHistoryItem() throws RepositoryException { return ((Version)getNode()).getContainingHistory(); }
@Override public VersionHistory getContainingHistory() throws RepositoryException { VersionHistory internalHistory = delegate.getContainingHistory(); return new VersionHistoryFacade<>(internalHistory, session); }
private int purgeVersions() throws RepositoryException { int count = 0; Iterator<Version> versions = this.versionsToPurge.iterator(); while (versions.hasNext()) { Version version = versions.next(); if (!JcrConstants.JCR_ROOTVERSION.equals(version.getName())) { version.getContainingHistory().removeVersion(version.getName()); count++; } versions.remove(); } return count; }
/** {@inheritDoc} */ public RemoteVersionHistory getContainingHistory() throws RepositoryException, RemoteException { try { return getFactory().getRemoteVersionHistory(version.getContainingHistory()); } catch (RepositoryException ex) { throw getRepositoryException(ex); } }
public JcrVersionHistory execute() throws Exception { return JcrVersionHistory.Wrapper.wrap(getDelegate().getContainingHistory(), getJcrSession()); } });
public VersionHistory getContainingHistory() throws RepositoryException { return VersionHistoryWrapper .wrap(getDelegate().getContainingHistory(), getSessionWrapper()); }
/** * Checks if the specified version belongs to this <code>VersionHistory</code>. * This method throws <code>VersionException</code> if {@link Version#getContainingHistory()} * is not the same item than this <code>VersionHistory</code>. * * @param version * @throws javax.jcr.version.VersionException * @throws javax.jcr.RepositoryException */ private void checkValidVersion(Version version) throws VersionException, RepositoryException { if (!version.getContainingHistory().isSame(this)) { throw new VersionException("Specified version '" + version.getName() + "' is not part of this history."); } }
/** * Checks if the specified version belongs to this <code>VersionHistory</code>. * This method throws <code>VersionException</code> if {@link Version#getContainingHistory()} * is not the same item than this <code>VersionHistory</code>. * * @param version * @throws javax.jcr.version.VersionException * @throws javax.jcr.RepositoryException */ private void checkValidVersion(Version version) throws VersionException, RepositoryException { if (!version.getContainingHistory().isSame(this)) { throw new VersionException("Specified version '" + version.getName() + "' is not part of this history."); } }
/** * Tests if {@link javax.jcr.version.Version#getContainingHistory()} returns * the correct VersionHistory instance. */ public void testGetContainingHistory() throws RepositoryException { // create version versionableNode.checkout(); Version version = versionableNode.checkin(); assertTrue("Method getContainingHistory() must return the same VersionHistory " + "as getVersionHistory() of the corresponding Node.", versionableNode.getVersionHistory().isSame(version.getContainingHistory())); } }
/** * Tests if VersionHistory.getVersionableUUID() returns the uuid of the * corresponding versionable node. */ public void testGetVersionableUUID() throws RepositoryException { // create version versionableNode.checkout(); Version version = versionableNode.checkin(); assertEquals("Method getVersionableUUID() must return the UUID of the corresponding Node.", version.getContainingHistory().getVersionableUUID(), versionableNode.getUUID()); }
/** * @since oak */ @Test public void testGetVersion() throws Exception { // accessing the version history must be allowed if the versionable node // is readable to the editing test session. Node testNode = testSession.getNode(versionablePath); VersionHistory vh = testNode.getVersionHistory(); Version version = vh.getVersion(v.getName()); assertTrue(v.isSame(version)); assertTrue(vh.isSame(version.getContainingHistory())); version = vh.getVersion(v2.getName()); assertTrue(v2.isSame(version)); assertTrue(vh.isSame(version.getContainingHistory())); }