gpt4 book ai didi

xdi2.core.features.nodetypes.XdiCommonRoot.getPeerRoot()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 10:09:05 25 4
gpt4 key购买 nike

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

XdiCommonRoot.getPeerRoot介绍

暂无

代码示例

代码示例来源:origin: projectdanube/xdi2

public static boolean ownsPeerRootXDIArc(Graph graph, XDIArc peerRootXDIArc) {
  XdiPeerRoot xdiPeerRoot = XdiCommonRoot.findCommonRoot(graph).getPeerRoot(peerRootXDIArc, false);
  if (xdiPeerRoot == null) return false;
  XdiRoot xdiRoot = xdiPeerRoot.dereference();
  return xdiRoot instanceof XdiCommonRoot;
}

代码示例来源:origin: projectdanube/xdi2

@Override
public String getRequestPath(String messagingContainerFactoryPath, XDIArc ownerPeerRootXDIArc) {
  XDIAddress ownerXDIAddress = XdiPeerRoot.getXDIAddressOfPeerRootXDIArc(ownerPeerRootXDIArc);
  XdiPeerRoot ownerPeerRoot = XdiCommonRoot.findCommonRoot(this.getRegistryGraph()).getPeerRoot(ownerXDIAddress, false);
  if (ownerPeerRoot == null) return null;
  String requestPath = messagingContainerFactoryPath + "/" + ownerXDIAddress.toString();
  if (log.isDebugEnabled()) log.debug("requestPath for ownerPeerRootXDIArc " + ownerPeerRootXDIArc + " is " + requestPath);
  return requestPath;
}

代码示例来源:origin: projectdanube/xdi2

@Override
public String getLocalSaltAndDigestSecretToken(XDIAddress senderXDIAddress) {
  // sender peer root
  XdiRoot senderXdiPeerRoot = XdiCommonRoot.findCommonRoot(this.getSecretTokenGraph()).getPeerRoot(senderXDIAddress, false);
  senderXdiPeerRoot = senderXdiPeerRoot == null ? null : senderXdiPeerRoot.dereference();
  if (log.isDebugEnabled()) log.debug("Sender peer root: " + senderXdiPeerRoot);
  if (senderXdiPeerRoot == null) return null;
  // find local salt and digest secret token
  String localSaltAndDigestSecretToken = senderXdiPeerRoot == null ? null : SecretTokens.getLocalSaltAndDigestSecretToken(senderXdiPeerRoot);
  // done
  return localSaltAndDigestSecretToken;
}

代码示例来源:origin: projectdanube/xdi2

XdiPeerRoot ownerXdiPeerRoot = XdiCommonRoot.findCommonRoot(this.getRegistryGraph()).getPeerRoot(ownerXDIAddress, false);

代码示例来源:origin: projectdanube/xdi2

XdiPeerRoot ownerXdiPeerRoot = XdiCommonRoot.findCommonRoot(this.getRegistryGraph()).getPeerRoot(ownerXDIAddress, false);

代码示例来源:origin: projectdanube/xdi2

XdiRoot xdiRoot = XdiCommonRoot.findCommonRoot(registryResultGraph).getPeerRoot(query, false);
if (xdiRoot == null) return;

代码示例来源:origin: projectdanube/xdi2

public XdiPeerRoot setSelfPeerRoot(XDIAddress XDIaddress) {
  XdiPeerRoot selfPeerRoot = this.getSelfPeerRoot();
  if (selfPeerRoot != null) selfPeerRoot.getContextNode().delete();
  if (XDIaddress == null) return null;
  selfPeerRoot = this.getPeerRoot(XDIaddress, true);
  ContextNode commonRootContextNode = this.getContextNode();
  ContextNode selfPeerRootContextNode = selfPeerRoot.getContextNode();
  commonRootContextNode.delRelations(XDIDictionaryConstants.XDI_ADD_IS_REF);
  commonRootContextNode.setRelation(XDIDictionaryConstants.XDI_ADD_IS_REF, selfPeerRootContextNode);
  selfPeerRootContextNode.delRelations(XDIDictionaryConstants.XDI_ADD_REF);
  selfPeerRootContextNode.setRelation(XDIDictionaryConstants.XDI_ADD_REF, commonRootContextNode);
  return selfPeerRoot;
}

代码示例来源:origin: projectdanube/xdi2

public void testPeerRoots() throws Exception {
  Graph graph = MemoryGraphFactory.getInstance().openGraph();
  assertEquals(XdiCommonRoot.findCommonRoot(graph).getPeerRoot(XDIAddress.create("=!1111"), true).getContextNode().getXDIAddress(), XDIArc.create("(=!1111)"));
  
  graph.close();
}

代码示例来源:origin: projectdanube/xdi2

Equivalence.setReferenceContextNode(bootstrapOwnerSynonymContextNode, bootstrapOwnerContextNode, true);
ContextNode bootstrapOwnerSynonymPeerRootContextNode = XdiCommonRoot.findCommonRoot(graph).getPeerRoot(bootstrapOwnerSynonym, true).getContextNode();
Equivalence.setReferenceContextNode(bootstrapOwnerSynonymPeerRootContextNode, bootstrapOwnerSelfPeerRootContextNode, false);

代码示例来源:origin: projectdanube/xdi2

public void testSubGraph() throws Exception {

    Graph graph = MemoryGraphFactory.getInstance().openGraph();
    XdiCommonRoot localRoot = XdiCommonRoot.findCommonRoot(graph);
    XdiPeerRoot peerRoot = localRoot.getPeerRoot(XDIAddress.create("=!:uuid:91f28153-f600-ae24-91f2-8153f600ae24"), true);
    XdiInnerRoot innerRoot = peerRoot.getInnerRoot(XDIAddress.create("=!1111"), XDIAddress.create("$add"), true);
    
    assertTrue(XdiAbstractContext.fromContextNode(localRoot.getContextNode()) instanceof XdiCommonRoot);
    assertTrue(XdiAbstractContext.fromContextNode(peerRoot.getContextNode()) instanceof XdiPeerRoot);
    assertTrue(XdiAbstractContext.fromContextNode(innerRoot.getContextNode()) instanceof XdiInnerRoot);
    
    graph.close();
  }
}

代码示例来源:origin: projectdanube/xdi2

public void testSelfPeerRoots() throws Exception {

    Graph graph = MemoryGraphFactory.getInstance().openGraph();
    XdiCommonRoot.findCommonRoot(graph).setSelfPeerRoot(XDIAddress.create("=!1111"));

    XdiPeerRoot selfPeerRoot = XdiCommonRoot.findCommonRoot(graph).getSelfPeerRoot();

    assertEquals(selfPeerRoot.getContextNode().getXDIAddress(), XDIAddress.create("(=!1111)"));
    assertEquals(XdiCommonRoot.findCommonRoot(graph).getPeerRoot(XDIAddress.create("=!1111"), false), selfPeerRoot);
    assertTrue(selfPeerRoot.isSelfPeerRoot());

    graph.close();
  }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com