org.nuxeo.ecm.core.api.Lock.getFailed()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(1.1k)|赞(0)|评价(0)|浏览(175)

本文整理了Java中org.nuxeo.ecm.core.api.Lock.getFailed()方法的一些代码示例,展示了Lock.getFailed()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Lock.getFailed()方法的具体详情如下:
包路径:org.nuxeo.ecm.core.api.Lock
类名称:Lock
方法名:getFailed

Lock.getFailed介绍

[英]The failure state, used for removal results.
[中]故障状态,用于删除结果。

代码示例

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core

@Override
public Lock removeLock(DocumentRef docRef) throws LockException {
  Document doc = resolveReference(docRef);
  String owner;
  if (hasPermission(docRef, UNLOCK)) {
    // always unlock
    owner = null;
  } else {
    owner = getPrincipal().getName();
  }
  Lock lock = doc.removeLock(owner);
  if (lock == null) {
    // there was no lock, we're done
    return null;
  }
  if (lock.getFailed()) {
    // lock removal failed due to owner check
    throw new LockException("Document already locked by " + lock.getOwner() + ": " + docRef);
  }
  DocumentModel docModel = readModel(doc);
  Map<String, Serializable> options = new HashMap<>();
  options.put("lock", lock);
  notifyEvent(DocumentEventTypes.DOCUMENT_UNLOCKED, docModel, options, null, null, true, false);
  return lock;
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-storage-sql

if (oldLock != null && oldLock.getFailed()) {

相关文章