本文整理匯總了Java中org.alfresco.service.cmr.repository.NodeRef.Status方法的典型用法代碼示例。如果您正苦於以下問題:Java NodeRef.Status方法的具體用法?Java NodeRef.Status怎麽用?Java NodeRef.Status使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.alfresco.service.cmr.repository.NodeRef
的用法示例。
在下文中一共展示了NodeRef.Status方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: generateKey
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
/**
* Key for a cache object is built from all the known Authorities (which can change dynamically so they must all be
* used) the NodeRef ID and the permission reference itself. This gives a unique key for each permission test.
*/
Serializable generateKey(Set<String> auths, NodeRef nodeRef, PermissionReference perm, CacheType type)
{
LinkedHashSet<Serializable> key = new LinkedHashSet<Serializable>();
key.add(perm.toString());
// We will just have to key our dynamic sets by username. We wrap it so as not to be confused with a static set
if (auths instanceof AuthorityServiceImpl.UserAuthoritySet)
{
key.add((Serializable)Collections.singleton(((AuthorityServiceImpl.UserAuthoritySet)auths).getUsername()));
}
else
{
key.addAll(auths);
}
key.add(nodeRef);
// Ensure some concept of node version or transaction is included in the key so we can track without cache replication
NodeRef.Status nodeStatus = nodeService.getNodeStatus(nodeRef);
key.add(nodeStatus == null ? "null" : nodeStatus.getChangeTxnId());
key.add(type);
return key;
}
示例2: addFtsStatusDoc
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
private void addFtsStatusDoc(List<Document> docs, FTSStatus ftsStatus, NodeRef nodeRef,
NodeRef.Status nodeStatus)
{
// If we are being called during FTS failover, then don't bother generating a new doc
if (ftsStatus == FTSStatus.Clean)
{
return;
}
Document doc = new Document();
doc.add(new Field("ID", GUID.generate(), Field.Store.YES, Field.Index.NO_NORMS, Field.TermVector.NO));
doc.add(new Field("FTSREF", nodeRef.toString(), Field.Store.YES, Field.Index.NO_NORMS, Field.TermVector.NO));
doc.add(new Field("TX", nodeStatus == null ? AlfrescoTransactionSupport.getTransactionId() : nodeStatus
.getChangeTxnId(), Field.Store.YES, Field.Index.NO_NORMS, Field.TermVector.NO));
doc.add(new Field("FTSSTATUS", ftsStatus.name(), Field.Store.NO, Field.Index.NO_NORMS, Field.TermVector.NO));
docs.add(doc);
}
示例3: getNodeStatus
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public Status getNodeStatus(NodeRef nodeRef)
{
ParameterCheck.mandatory("nodeRef", nodeRef);
NodeRef.Status status = nodeDAO.getNodeRefStatus(nodeRef);
return status;
}
示例4: getNodeStatus
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
@Override
public NodeRef.Status getNodeStatus(QNameDAO qnameDAO)
{
NodeRef nodeRef = new NodeRef(store.getStoreRef(), uuid);
boolean deleted = getDeleted(qnameDAO);
return new NodeRef.Status(id, nodeRef, transaction.getChangeTxnId(), transaction.getId(), deleted);
}
示例5: getTxnChangesForStore
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
@Override
public List<NodeRef.Status> getTxnChangesForStore(StoreRef storeRef, Long txnId)
{
Long storeId = (storeRef == null) ? null : getStoreNotNull(storeRef).getId();
List<NodeEntity> nodes = selectTxnChanges(txnId, storeId);
// Convert
List<NodeRef.Status> nodeStatuses = new ArrayList<NodeRef.Status>(nodes.size());
for (NodeEntity node : nodes)
{
nodeStatuses.add(node.getNodeStatus(qnameDAO));
}
// Done
return nodeStatuses;
}
示例6: executeAndCheck
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
private void executeAndCheck(NodeRef nodeRef, RetryingTransactionCallback<Object> callback) throws Throwable
{
UserTransaction txn = txnService.getUserTransaction();
txn.begin();
NodeRef.Status currentStatus = nodeService.getNodeStatus(nodeRef);
assertNotNull(currentStatus);
String currentTxnId = AlfrescoTransactionSupport.getTransactionId();
assertNotNull(currentTxnId);
assertNotSame(currentTxnId, currentStatus.getChangeTxnId());
try
{
callback.execute();
// get the status
NodeRef.Status newStatus = nodeService.getNodeStatus(nodeRef);
assertNotNull(newStatus);
// check
assertEquals("Change didn't update status", currentTxnId, newStatus.getChangeTxnId());
// Make sure we can pre-load the node i.e. nodes in all state need to be pre-loadable
// See CLOUD-1807
Long nodeId = newStatus.getDbId();
nodeDAO.getParentAssocs(nodeId, null, null, null, new DummyChildAssocRefQueryCallback());
nodeDAO.cacheNodesById(Collections.singletonList(nodeId));
txn.commit();
}
catch (Throwable e)
{
try { txn.rollback(); } catch (Throwable ee) {}
throw e;
}
}
示例7: reindexTransaction
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
/**
* Perform full reindexing of the given transaction. A read-only transaction is created
* <b>if one doesn't already exist</b>.
*
* @param txnId the transaction identifier
*/
public void reindexTransaction(final long txnId)
{
if (logger.isDebugEnabled())
{
logger.debug("Reindexing transaction: " + txnId);
}
RetryingTransactionCallback<Object> reindexWork = new RetryingTransactionCallback<Object>()
{
public Object execute() throws Exception
{
// get the node references pertinent to the transaction
List<NodeRef.Status> nodeStatuses = nodeDAO.getTxnChanges(txnId);
// reindex each node
for (NodeRef.Status nodeStatus : nodeStatuses)
{
NodeRef nodeRef = nodeStatus.getNodeRef();
if (nodeStatus.isDeleted()) // node deleted
{
// only the child node ref is relevant
ChildAssociationRef assocRef = new ChildAssociationRef(
ContentModel.ASSOC_CHILDREN,
null,
null,
nodeRef);
indexer.deleteNode(assocRef);
}
else // node created
{
// reindex
indexer.updateNode(nodeRef);
}
}
// done
return null;
}
};
transactionService.getRetryingTransactionHelper().doInTransaction(reindexWork, true, false);
// done
}
示例8: getTxnChanges
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
@Override
public List<NodeRef.Status> getTxnChanges(Long txnId)
{
return getTxnChangesForStore(null, txnId);
}
示例9: getNodeRefStatus
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
/**
* Get the current status of the node, including deleted nodes.
*
* @param nodeRef the node reference
* @return Returns the current status of the reference.
* This will only be <tt>null</tt> if the node never existed or has been
* purged following deletion.
*/
public NodeRef.Status getNodeRefStatus(NodeRef nodeRef);
示例10: getNodeIdStatus
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
/**
* Get the current status of the node, including deleted nodes.
*
* @param nodeId the node id
* @return Returns the current status of the reference.
* This will only be <tt>null</tt> if the node never existed or has been
* purged following deletion.
*/
public NodeRef.Status getNodeIdStatus(Long nodeId);
示例11: getTxnChangesForStore
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
/**
* @return Returns the node statuses for a transaction, limited to the store
*/
public List<NodeRef.Status> getTxnChangesForStore(StoreRef storeRef, Long txnId);
示例12: getTxnChanges
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
/**
* @return Returns the node statuses for a transaction, regardless of store
*/
public List<NodeRef.Status> getTxnChanges(Long txnId);
示例13: getNodeStatus
import org.alfresco.service.cmr.repository.NodeRef; //導入方法依賴的package包/類
public NodeRef.Status getNodeStatus(QNameDAO qnameDAO);