@Override public BulkUpdateObjectIdAndChangeToken call() throws Exception { exceptionService.invalidArgumentRequiredString("objectId", objectIdAndChangeToken.getId()); Lock lock = threadLockService.getWriteLock(repositoryId, objectIdAndChangeToken.getId()); try { lock.lock(); Content content = checkExceptionBeforeUpdateProperties( callContext, repositoryId, new Holder<String>(objectIdAndChangeToken.getId()), properties, new Holder<String>(objectIdAndChangeToken.getChangeToken())); contentService.updateProperties(callContext, repositoryId, properties, content); nemakiCachePool.get(repositoryId).removeCmisCache(content.getId()); BulkUpdateObjectIdAndChangeToken result = new BulkUpdateObjectIdAndChangeTokenImpl( objectIdAndChangeToken.getId(), content.getId(), String.valueOf(content.getChangeToken())); return result; } catch (Exception e) { // Don't throw an error // Don't return any BulkUpdateObjectIdAndChangetoken } finally { lock.unlock(); } // TODO Auto-generated method stub return null; }
@Override public void updateConflict(Content content, Holder<String> changeToken) { if ((changeToken == null || changeToken.getValue() == null)) { throw new CmisUpdateConflictException( "Change token is required to update", HTTP_STATUS_CODE_409); } else if (!changeToken.getValue().equals(content.getChangeToken())) { throw new CmisUpdateConflictException( "Cannot update because the changeToken conflicts", HTTP_STATUS_CODE_409); } }