/** {@inheritDoc} */ public void refresh(boolean keepChanges) throws InvalidItemStateException, RepositoryException { item.refresh(keepChanges); }
public void refresh(boolean b) throws RepositoryException { this.item.refresh(b); } }
/** {@inheritDoc} */ public void refresh(boolean keepChanges) throws RepositoryException, RemoteException { try { item.refresh(keepChanges); } catch (RepositoryException ex) { throw getRepositoryException(ex); } }
public void execute() throws Exception { getDelegate().refresh(keepChanges); } });
/** * @see org.apache.jackrabbit.webdav.jcr.transaction.TxLockManagerImpl.Transaction#rollback(TransactionResource) */ public void rollback(TransactionResource resource) throws DavException { try { getItem(resource).refresh(false); } catch (RepositoryException e) { throw new JcrDavException(e); } }
public Long call() throws Exception { if (items.isEmpty()) { return 0L; } Item item = items.get(rnd.nextInt(items.size())); long t1 = System.currentTimeMillis(); item.refresh(rnd.nextBoolean()); long t2 = System.currentTimeMillis(); return t2 - t1; }
public void refresh(boolean keepChanges) throws RepositoryException { getActionHandler().beforeItemRefresh(this, keepChanges); getDelegate().refresh(keepChanges); getActionHandler().afterItemRefresh(this, keepChanges); }
/** * If this resource exists but does not contain a transaction id, complete * will try to persist any modifications present on the underlying * repository item. * * @throws DavException if calling {@link Item#save()} fails */ void complete() throws DavException { if (exists() && getTransactionId() == null) { try { if (item.isModified()) { item.save(); } } catch (RepositoryException e) { // this includes LockException, ConstraintViolationException etc. not detected before log.error("Error while completing request: " + e.getMessage() +" -> reverting changes."); try { item.refresh(false); } catch (RepositoryException re) { log.error("Error while reverting changes: " + re.getMessage()); } throw new JcrDavException(e); } } }
/** * @see IOHandler#importContent(ImportContext, boolean) */ public boolean importContent(ImportContext context, boolean isCollection) throws IOException { if (!canImport(context, isCollection)) { throw new IOException(getName() + ": Cannot import " + context.getSystemId()); } boolean success = false; try { Node contentNode = getContentNode(context, isCollection); success = importData(context, isCollection, contentNode); if (success) { success = importProperties(context, isCollection, contentNode); } } catch (RepositoryException e) { success = false; throw new IOException(e.getMessage()); } finally { // revert any changes made in case the import failed. if (!success) { try { context.getImportRoot().refresh(false); } catch (RepositoryException e) { throw new IOException(e.getMessage()); } } } return success; }
public void testNodeIsModifiedAfterRemovePolicy() throws RepositoryException, AccessDeniedException, NotExecutableException { checkCanReadAc(path); checkCanModifyAc(path); Item item = superuser.getItem(path); if (acMgr.getPolicies(path).length == 0) { // no policy to remove ->> apply one AccessControlPolicyIterator it = acMgr.getApplicablePolicies(path); if (it.hasNext()) { AccessControlPolicy policy = it.nextAccessControlPolicy(); acMgr.setPolicy(path, policy); superuser.save(); // remember for teardown addedPolicies.put(path, policy); } else { throw new NotExecutableException(); } } // test transient behaviour of the removal try { AccessControlPolicy[] plcs = acMgr.getPolicies(path); if (plcs.length > 0) { acMgr.removePolicy(path, plcs[0]); assertTrue("After removing a policy the node must be marked modified.", item.isModified()); } } finally { item.refresh(false); } }