• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Graph类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中xdi2.core.Graph的典型用法代码示例。如果您正苦于以下问题:Java Graph类的具体用法?Java Graph怎么用?Java Graph使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Graph类属于xdi2.core包,在下文中一共展示了Graph类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: convertXdiToCards

import xdi2.core.Graph; //导入依赖的package包/类
public List<Card> convertXdiToCards(Graph graph) {
	Assert.notNull(graph);
	CloudUser user = (CloudUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();

	List<Card> cards = new ArrayList<Card>();
	
	ContextNode contextNode = graph.getDeepContextNode(XDIAddressUtil.concatXDIAddresses(user.getCloudNumber().getXDIAddress(), XDI_CARDS));
	if (contextNode == null) {
		return cards;
	}
	XdiEntityCollection cardCollection = XdiEntityCollection.fromContextNode(contextNode);
	if (cardCollection == null) {
		return cards;
	}
	long start = System.currentTimeMillis();
	ReadOnlyIterator<XdiEntityInstance> iCards = cardCollection.getXdiInstances();

	while (iCards.hasNext()) {
		XdiEntityInstance cardXdi = iCards.next();

		cards.add(convertXdiToCard(cardXdi));
	}
	log.debug("Took " + (System.currentTimeMillis()-start) + "ms to convert " + cards.size() + " cards");
	return cards;
}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:26,代码来源:CardXdiModelConverter.java


示例2: testAccessGranting

import xdi2.core.Graph; //导入依赖的package包/类
public static void testAccessGranting(){
		PersonalCloud pc1 = PersonalCloud.open(
				 XDI3Segment.create("=dev.animesh"), "animesh123",
				 PersonalCloud.XRI_S_DEFAULT_LINKCONTRACT, "","");

				ProfileInfo pc1Prof = new ProfileInfo();
				 pc1Prof.setEmail("[email protected]");
				 pc1Prof.setPhone("1-240-620-4205");
				 pc1.saveProfileInfo(pc1Prof);
				pc1.allowAccess(pc1Prof, XDILinkContractConstants.XRI_S_GET,
				XDI3Segment.create("=markus"));
				Graph pc1Graph = pc1.getWholeGraph();
				
				// open someone else's personal cloud
//				 PersonalCloud pc_markus = PersonalCloud.open(
//				 XDI3Segment.create("=markus"),pc1.getCloudNumber(),
//				 XDI3Segment.create(pc1.getCloudNumber().toString() +"$do"), "");				
//				
//				System.out.println(pc_markus.getProfileInfo().getPhone());


				// pc1.allowAccess(todoList, XDILinkContractConstants.XRI_S_GET,
				// XDI3Segment.create("=markus"));


	}
 
开发者ID:peacekeeper,项目名称:clouds-client-basic,代码行数:27,代码来源:Test.java


示例3: generateFacebookField

import xdi2.core.Graph; //导入依赖的package包/类
private FacebookProfileField generateFacebookField(XDIAddress fieldXdiAddress, Graph graph) {
	
	LiteralNode l = graph.getRootContextNode().getDeepLiteralNode(fieldXdiAddress);
	if (l != null) {
		return new FacebookProfileField(l.getLiteralDataString(), fieldXdiAddress.toString());
	}
	
	return null;
}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:10,代码来源:FacebookService.java


示例4: signMessage

import xdi2.core.Graph; //导入依赖的package包/类
public static Graph signMessage(String message, XDIAddress[] addresses, String key) {

		try {
			// parse the message to graph
			Graph graph = MemoryGraphFactory.getInstance().openGraph();
			XDIReader xdiReader = XDIReaderRegistry.getAuto();
			xdiReader.read(graph, new StringReader(message));

			// find the addresses
			for (XDIAddress address : addresses) {

				ContextNode contextNode = graph.getDeepContextNode(address, true);
				if (contextNode == null) throw new RuntimeException("No context node found at address " + address);

				// sign
				RSASignature signature = (RSASignature) Signatures.createSignature(contextNode, "sha", 256, "rsa", 2048, true);

				PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(Base64.decodeBase64(key));
				KeyFactory keyFactory = KeyFactory.getInstance("RSA");
				Key k = keyFactory.generatePrivate(keySpec);

				new RSAStaticPrivateKeySignatureCreator((PrivateKey) k).createSignature(signature);
			}

			return graph;
		}
		catch(Exception e) {
			log.warn("Error while signing a message:\n" + message, e);
		}

		return null;

	}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:34,代码来源:XdiUtils.java


示例5: convertToPersonalProfile

import xdi2.core.Graph; //导入依赖的package包/类
public PersonalProfile convertToPersonalProfile(Graph graph) {
	CloudUser user = (CloudUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();

	PersonalProfile profile = new PersonalProfile();

	profile.setXdiData(graph.toString("XDI DISPLAY", null));

	profile.setFirstName(getStringLiteralForSegment(graph, user.getCloudNumber(), XDI_FIRST_NAME));
	profile.setLastName(getStringLiteralForSegment(graph, user.getCloudNumber(), XDI_LAST_NAME));
	profile.setNickname(getStringLiteralForSegment(graph, user.getCloudNumber(), XDI_NICKNAME));
	profile.setGender(getStringLiteralForSegment(graph, user.getCloudNumber(), XDI_GENDER));
	profile.setBirthDate(getStringLiteralForSegment(graph, user.getCloudNumber(), XDI_BIRTH_DATE));
	profile.setNationality(getStringLiteralForSegment(graph, user.getCloudNumber(), XDI_NATIONALITY));
	profile.setPhone(getStringLiteralForSegment(graph, user.getCloudNumber(), XDI_PHONE));
	profile.setMobilePhone(getStringLiteralForSegment(graph, user.getCloudNumber(), XDI_MOBILE_PHONE));
	profile.setWorkPhone(getStringLiteralForSegment(graph, user.getCloudNumber(), XDI_WORK_PHONE));
	profile.setEmail(getStringLiteralForSegment(graph, user.getCloudNumber(), XDI_EMAIL));
	profile.setWebsite(getStringLiteralForSegment(graph, user.getCloudNumber(), XDI_WEBSITE));

	PostalAddress address = new PostalAddress();

	address.setStreet(getStringLiteralForSegment(graph, user.getCloudNumber(), XDI_ADDRESS_STREET));
	address.setCountry(getStringLiteralForSegment(graph, user.getCloudNumber(), XDI_ADDRESS_COUNTRY));
	address.setLocality(getStringLiteralForSegment(graph, user.getCloudNumber(), XDI_ADDRESS_LOCALITY));
	address.setPostalCode(getStringLiteralForSegment(graph, user.getCloudNumber(), XDI_ADDRESS_POSTAL_CODE));
	address.setRegion(getStringLiteralForSegment(graph, user.getCloudNumber(), XDI_ADDRESS_REGION));

	profile.setAddress(address);

	return profile;
}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:32,代码来源:XdiModelConverter.java


示例6: convertLCBaseToAbstractConnection

import xdi2.core.Graph; //导入依赖的package包/类
private AbstractConnection convertLCBaseToAbstractConnection(LinkContractBase<?> linkContract, AbstractConnection connection) {
	Assert.notNull(linkContract);
	Assert.notNull(connection);

	// isolate the LC part of the graph
	Graph tempGraph = MemoryGraphFactory.getInstance().openGraph();
	CopyUtil.copyContextNode(linkContract.getContextNode(), tempGraph, null);
	connection.setXdi(tempGraph.toString("XDI DISPLAY", null));

	connection.setXdiAddress(linkContract.getContextNode().getXDIAddress().toString());

	// Permissions
	IterableIterator<XDIAddress> permissions = linkContract.getPermissionTargetXDIAddresses(XDILinkContractConstants.XDI_ADD_GET);
	CollectionUtils.forAllDo(permissions.iterator(), new PermissionsClosure<XDIAddress>(connection, "get"));

	permissions = linkContract.getPermissionTargetXDIAddresses(XDILinkContractConstants.XDI_ADD_SET);
	CollectionUtils.forAllDo(permissions.iterator(), new PermissionsClosure<XDIAddress>(connection, "set"));

	permissions = linkContract.getPermissionTargetXDIAddresses(XDILinkContractConstants.XDI_ADD_DEL);
	CollectionUtils.forAllDo(permissions.iterator(), new PermissionsClosure<XDIAddress>(connection, "del"));

	permissions = linkContract.getPermissionTargetXDIAddresses(XDILinkContractConstants.XDI_ADD_ALL);
	CollectionUtils.forAllDo(permissions.iterator(), new PermissionsClosure<XDIAddress>(connection, "all"));

	IterableIterator<XDIStatement> permissionStatements = linkContract.getPermissionTargetXDIStatements(XDILinkContractConstants.XDI_ADD_GET);
	CollectionUtils.forAllDo(permissionStatements.iterator(), new PermissionsClosure<XDIStatement>(connection, "get"));

	permissionStatements = linkContract.getPermissionTargetXDIStatements(XDILinkContractConstants.XDI_ADD_SET);
	CollectionUtils.forAllDo(permissionStatements.iterator(), new PermissionsClosure<XDIStatement>(connection, "set"));

	permissionStatements = linkContract.getPermissionTargetXDIStatements(XDILinkContractConstants.XDI_ADD_DEL);
	CollectionUtils.forAllDo(permissionStatements.iterator(), new PermissionsClosure<XDIStatement>(connection, "del"));

	permissionStatements = linkContract.getPermissionTargetXDIStatements(XDILinkContractConstants.XDI_ADD_ALL);
	CollectionUtils.forAllDo(permissionStatements.iterator(), new PermissionsClosure<XDIStatement>(connection, "all"));

	return connection;
}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:39,代码来源:XdiModelConverter.java


示例7: addCardButtonMessages

import xdi2.core.Graph; //导入依赖的package包/类
private void addCardButtonMessages(List<XDIStatement> statements, XDIAddress cardXdiAddress) throws Xdi2ClientException {
	CloudUser user = (CloudUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	String signatureKeys[] = cloudService.getSignatureKeyPair();
	
	String cloudCardUri = null;
	try {
		cloudCardUri = configuration.getCloudCardAppUri() + URLEncoder.encode(cardXdiAddress.toString(), "UTF-8");
	} catch (UnsupportedEncodingException e) {
		log.error("Unable to URI encode (" + cardXdiAddress.toString() + ") ");
	}

	String messageConnectXdiAddress = user.getCloudNumber() + "[$msg]@0";
	String messageConnect = messageConnectXdiAddress + "/$is()/({$to})\n";
	messageConnect += messageConnectXdiAddress + "/$do/({$to}/[+]!:uuid:ca51aeb9-e09e-4305-89d7-87a944a1e1fa)[+]!:uuid:ca51aeb9-e09e-4305-89d7-87a944a1e1fa#community$do\n";
	messageConnect += messageConnectXdiAddress + "/$is$do/(" + user.getCloudNumber() + "/[+]!:uuid:ca51aeb9-e09e-4305-89d7-87a944a1e1fa)[+]!:uuid:ca51aeb9-e09e-4305-89d7-87a944a1e1fa#community$do\n";
	messageConnect += messageConnectXdiAddress + "$do/$do$is{}/+danubeclouds#forever{$do}\n";
	messageConnect += messageConnectXdiAddress + "{$card}/$is/" + cardXdiAddress + "\n";
	messageConnect += messageConnectXdiAddress + "<#return><$uri>&/&/\"" + cloudCardUri + "\"\n";

	String messageGetXdiAddress = user.getCloudNumber() + "[$msg]@1";
	messageConnect += messageGetXdiAddress + "/$is()/({$to})\n";
	messageConnect += messageGetXdiAddress + "/$do/({$to}/[+]!:uuid:ca51aeb9-e09e-4305-89d7-87a944a1e1fa)[+]!:uuid:ca51aeb9-e09e-4305-89d7-87a944a1e1fa#community$do\n";
	messageConnect += messageGetXdiAddress + "/$is$do/("+ user.getCloudNumber() +"/{$to})+danubeclouds#forever$do\n";
	messageConnect += messageGetXdiAddress + "$do/$get$is/" + cardXdiAddress + "\n";
	messageConnect += "(" + messageGetXdiAddress + "$do/$get$is)" + user.getCloudNumber() + "/$is$ref/{}\n";
	messageConnect += messageGetXdiAddress + "<#return><$uri>&/&/\"" + cloudCardUri + "\"\n";
	messageConnect += messageGetXdiAddress + "$get<$deref>&/&/true\n";
	
	
	XDIAddress[] messagesXdiAddress = new XDIAddress[]{XDIAddress.create(messageConnectXdiAddress), XDIAddress.create(messageGetXdiAddress)};
	
	Graph signedMessage = XdiUtils.signMessage(messageConnect, messagesXdiAddress, signatureKeys[1]);
	log.debug("signed connect message:\n" + signedMessage.toString("XDI DISPLAY", null));
	addStatement(statements, XDIAddressUtil.concatXDIAddresses(cardXdiAddress, XDI_CARD_CONNECT_BUTTON), Base64.encodeBase64String(signedMessage.toString("XDI/JSON", null).getBytes()));

}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:37,代码来源:CardXdiModelConverter.java


示例8: getDependentData

import xdi2.core.Graph; //导入依赖的package包/类
public static DependentData getDependentData( Statement stmt )
{
	try
	{
		CloudNumber cloudNumber = CloudNumber.create(stmt.getObject().toString());
		XDIDiscoveryResult result = getXDIDiscoveryClient().discoverFromRegistry(cloudNumber.getXDIAddress(), null);
		URL cloudUrl = result.getXdiEndpointUrl();

		Graph tempGraph = MemoryGraphFactory.getInstance().openGraph();
		MessageEnvelope getMessageEnvelope = new MessageEnvelope();
		Message getMessage = getMessageEnvelope.createMessage(cloudNumber.getXDIAddress());
		getMessage.setToPeerRootXDIArc(cloudNumber.getPeerRootXDIArc());
		getMessage.setLinkContract(PublicLinkContract.class);
		getMessage.createGetOperation(XDIStatement.fromRelationComponents(cloudNumber.getXDIAddress(), XDIDictionaryConstants.XDI_ADD_IS_REF, XDIConstants.XDI_ADD_COMMON_VARIABLE));
		MessageResult getMessageResult = new XDIHttpClient(cloudUrl).send(getMessageEnvelope, null);
		for( Statement stmt1 : getMessageResult.getGraph().getRootContextNode().getAllStatements())
		{
			if( XDIDictionaryConstants.XDI_ADD_IS_REF.equals(stmt1.getPredicate()) == false )
			{
				logger.debug("getDependentData() - Ignore " + stmt1);
				continue;
			}
			logger.debug("getDependentData() - Process " + stmt1);
			String cloudName = stmt1.getObject().toString();
			DependentData rtn = new DependentData();
			rtn.setCloudName(cloudName);
			rtn.setCloudNumber(cloudNumber);
			rtn.setCloudUrl(cloudUrl);
			return rtn;
		}
	}
	catch( Exception e )
	{
		logger.error("getDependentData() failed - " + e.getMessage(), e);
	}
	logger.error("getDependentData() - Cannot find dependent cloud " + stmt);
	return null;
}
 
开发者ID:nzatnsr,项目名称:neustar-clouds-proxy,代码行数:39,代码来源:ProxyXdiService.java


示例9: setDependentProxyServer

import xdi2.core.Graph; //导入依赖的package包/类
public static void setDependentProxyServer( DependentData data )
{
	logger.info("setDependentProxyServer - " + data);
	try
	{
		String server = "";
		if( data.getPort() != null )
		{
			server = data.getHostname() + ":" + data.getPort();
		}
		CloudNumber cloudNumber = data.getCloudNumber();
		Graph tempGraph = MemoryGraphFactory.getInstance().openGraph();
		XdiAttribute proxyServerMessage = XdiCommonRoot.findCommonRoot(tempGraph)
			.getXdiEntity(cloudNumber.getXDIAddress(), true)
			.getXdiAttributeSingleton(XDIAddress.create("<#proxy>"), true)
			.getXdiAttributeSingleton(XDIAddress.create("<#server>"), true);
		proxyServerMessage.setLiteralDataString(server);
		logger.info("Setting proxy server as '" + server + "'");
		logger.info(tempGraph.toString("XDI DISPLAY", null));

		MessageEnvelope messageEnvelope = new MessageEnvelope();
		Message message = messageEnvelope.createMessage(cloudNumber.getXDIAddress());
		message.setToPeerRootXDIArc(cloudNumber.getPeerRootXDIArc());
		message.setLinkContract(RootLinkContract.class);
		message.setSecretToken(data.getSecretToken());
		message.createSetOperation(tempGraph);

		new XDIHttpClient(data.getCloudUrl()).send(messageEnvelope, null);
	}
	catch( Exception e )
	{
		logger.error("setDependentProxyServer() failed - " + e.getMessage(), e);
	}
}
 
开发者ID:nzatnsr,项目名称:neustar-clouds-proxy,代码行数:35,代码来源:ProxyXdiService.java


示例10: testAccessRemoval

import xdi2.core.Graph; //导入依赖的package包/类
public static void testAccessRemoval(){
	
	PersonalCloud pc1 = PersonalCloud.open(
			 XDI3Segment.create("=dev.animesh"), "animesh123",
			 PersonalCloud.XRI_S_DEFAULT_LINKCONTRACT, "","");

			ProfileInfo pc1Prof = new ProfileInfo();
			 pc1.removeAccess( null,XDI3Segment.create("=markus"));
			 Graph pc1Graph = pc1.getWholeGraph();		
	
}
 
开发者ID:peacekeeper,项目名称:clouds-client-basic,代码行数:12,代码来源:Test.java


示例11: geAllCollections

import xdi2.core.Graph; //导入依赖的package包/类
public ArrayList<PCAttributeCollection> geAllCollections() {

		Graph g = this.getWholeGraph();
		ContextNode root = g.getRootContextNode();
		ReadOnlyIterator<Literal> allLiterals = root.getAllLiterals();
		while (allLiterals.hasNext()) {
			Literal lit = allLiterals.next();
			String value = lit.getLiteralData().toString();
			String name = lit.getContextNode().toString();
		}
		return null;

	}
 
开发者ID:peacekeeper,项目名称:clouds-client-basic,代码行数:14,代码来源:PersonalCloud.java


示例12: callbackGraph

import xdi2.core.Graph; //导入依赖的package包/类
@Override
protected void callbackGraph(String messagingContainerPath, Graph graph, MyState state) throws Xdi2MessagingException, IOException {

	XDIReader reader = XDIReaderRegistry.getAuto();

	try {

		graph.clear();
		reader.read(graph, System.in);
	} catch (Exception ex) {

		System.err.println("Problem while loading graph " + messagingContainerPath);
		ex.printStackTrace(System.err);
	}
}
 
开发者ID:projectdanube,项目名称:xdi2-tools,代码行数:16,代码来源:CommandLoadGraph.java


示例13: main

import xdi2.core.Graph; //导入依赖的package包/类
public static void main(String[] args) throws Exception {

		// create a simple graph with context nodes, a relation, and a literal

		Graph graph = MemoryGraphFactory.getInstance().openGraph();

		ContextNode root = graph.getRootContextNode();
		ContextNode markus = root.setContextNode(XDIArc.create("=markus"));
		ContextNode animesh = root.setContextNode(XDIArc.create("=animesh"));
		ContextNode name = markus.setContextNode(XDIArc.create("<#name>"));
		Relation relation = markus.setRelation(XDIAddress.create("#friend"), animesh);
		LiteralNode literalNode = name.setLiteralNode("Markus Sabadello");

		// write some statements from our graph

		System.out.println("Statement associated with a context node: " + markus.getStatement());
		System.out.println("Statement associated with a relation: " + relation.getStatement());
		System.out.println("Statement associated with a literal: " + literalNode.getStatement());
		System.out.println();

		// we can also add a whole new statement to the graph

		graph.setStatement(XDIStatement.create("=alice/#friend/=bob"));

		// write the whole graph in different serialization formats

		System.out.println("Serialization in XDI/JSON: \n");
		XDIWriterRegistry.forFormat("XDI/JSON", null).write(graph, System.out);
		System.out.println();
		System.out.println();

		System.out.println("Serialization in XDI statements:\n");
		XDIWriterRegistry.forFormat("XDI DISPLAY", null).write(graph, System.out);

		// close the graph

		graph.close();
	}
 
开发者ID:projectdanube,项目名称:xdi2-example-core,代码行数:39,代码来源:GraphModel.java


示例14: getStringLiteralForSegment

import xdi2.core.Graph; //导入依赖的package包/类
private static String getStringLiteralForSegment(Graph graph, CloudNumber cloudNumber, XDIAddress segment) {

		LiteralNode l = graph.getRootContextNode().getDeepLiteralNode(XDIAddressUtil.concatXDIAddresses(cloudNumber.getXDIAddress(), segment, XDIAddress.create("&")));
		return l != null ? l.getLiteralDataString() : null;
	}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:6,代码来源:XdiModelConverter.java


示例15: convertConnectionToLinkContract

import xdi2.core.Graph; //导入依赖的package包/类
public LinkContract convertConnectionToLinkContract (Connection connection) {
	Assert.notNull(connection);

	if (StringUtils.isEmpty(connection.getRaCloudNumber())) {
		throw new RuntimeException("Invalid Cloud Name.");
	}

	CloudUser user = (CloudUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();

	Graph g = MemoryGraphFactory.getInstance().openGraph();
	LinkContract l = RelationshipLinkContract.findRelationshipLinkContract(g, XDIAddress.create(user.getCloudNumber().toString()), XDIAddress.create(connection.getRaCloudNumber()), null, null, true);

	l = (LinkContract) this.convertAbstractConnectionToLinkContractBase(connection, l);

	PolicyAnd policyAnd = l.getPolicyRoot(true).createAndPolicy(true);
	PolicyUtil.createSenderIsOperator(policyAnd, XDIAddress.create(connection.getRaCloudNumber()));

	if (connection.getRequireSecretToken()) PolicyUtil.createSecretTokenValidOperator(policyAnd);
	if (connection.getRequireSignature()) PolicyUtil.createSignatureValidOperator(policyAnd);

	return l;
}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:23,代码来源:XdiModelConverter.java


示例16: addAccessData

import xdi2.core.Graph; //导入依赖的package包/类
public static void addAccessData( DependentData data, String type, AccessData acc )
{
	try
	{
		CloudNumber cloudNumber = data.getCloudNumber();
		Graph tempGraph = MemoryGraphFactory.getInstance().openGraph();
		XdiAttribute proxyAccessMessage = XdiCommonRoot.findCommonRoot(tempGraph)
			.getXdiEntity(cloudNumber.getXDIAddress(), true)
			.getXdiAttributeSingleton(XDIAddress.create("<#proxy>"), true)
			.getXdiAttributeCollection(XDIAddress.create("[<#" + type + ">]"), true)
			.setXdiMemberUnordered(true, false);
		proxyAccessMessage.setLiteralDataString(AccessData.fromAccessData(acc));

		logger.info(tempGraph.toString("XDI DISPLAY", null));

		MessageEnvelope messageEnvelope = new MessageEnvelope();
		Message message = messageEnvelope.createMessage(cloudNumber.getXDIAddress());
		message.setToPeerRootXDIArc(cloudNumber.getPeerRootXDIArc());
		message.setLinkContract(RootLinkContract.class);
		message.setSecretToken(data.getSecretToken());
		message.createSetOperation(tempGraph);

		MessageResult messageResult = new XDIHttpClient(data.getCloudUrl()).send(messageEnvelope, null);

		logger.info(messageResult.getGraph().toString("XDI DISPLAY", null));

		for( LiteralNode literal : tempGraph.getRootContextNode().getAllLiterals() )
		{
			String uuid = null;
			List<XDIArc> list = literal.getStatement().getSubject().getXDIArcs();
			if( list != null )
			{
				for( XDIArc arc : list )
				{
					String s = arc.getLiteral();
					if( (s != null) && s.startsWith(":uuid:") )
					{
						uuid = s.substring(6);
					}
				}
			}
			if( uuid != null )
			{
				acc.setUuid(uuid);
				return;
			}
		}
		logger.error("addAccessData() failed - uuid not found");
	}
	catch( Exception e )
	{
		logger.error("addAccessData() failed - " + e.getMessage(), e);
	}
	throw new ProxyInternalErrorException("addAccessData() failed");
}
 
开发者ID:nzatnsr,项目名称:neustar-clouds-proxy,代码行数:56,代码来源:ProxyXdiService.java


示例17: openGraph

import xdi2.core.Graph; //导入依赖的package包/类
@Override
public Graph openGraph(String identifier) throws IOException {

	if (identifier == null) identifier = UUID.randomUUID().toString();

	// create graph

	ZephyrGraph graph = new ZephyrGraph(this, identifier, this.getDataApi(), this.getOauthToken(), this.getZephyrCache(), this.getZephyrApi());

	// Zephyr request

	graph.doPut("", null, null);

	// done

	return graph;
}
 
开发者ID:projectdanube,项目名称:xdi2-zephyr,代码行数:18,代码来源:ZephyrGraphFactory.java


示例18: openNewGraph

import xdi2.core.Graph; //导入依赖的package包/类
@Override
protected Graph openNewGraph(String identifier) throws IOException {

	return graphFactory.openGraph(identifier);
}
 
开发者ID:projectdanube,项目名称:xdi2-zephyr,代码行数:6,代码来源:ZephyrGraphTest.java


示例19: openGraph

import xdi2.core.Graph; //导入依赖的package包/类
@Override
protected Graph openGraph(String identifier) throws IOException {

	return graphFactory.openGraph(identifier);
}
 
开发者ID:projectdanube,项目名称:xdi2-mongodb,代码行数:6,代码来源:MongoDBJSONGraphMessagingContainerTest.java


示例20: executeSetOnLiteralStatement

import xdi2.core.Graph; //导入依赖的package包/类
@Override
public ContributorResult executeSetOnLiteralStatement(XDIAddress[] contributorAddresses, XDIAddress contributorsAddress, XDIStatement relativeTargetStatement, SetOperation operation, Graph operationResultGraph, ExecutionContext executionContext) throws Xdi2MessagingException {

	String filename = filename(XDIAddressUtil.concatXDIAddresses(contributorsAddress, relativeTargetStatement.getSubject()));

	// write file

	try {

		BufferedWriter writer = new BufferedWriter(new FileWriter(new File(this.path, filename)));
		writer.write(AbstractLiteralNode.literalDataToString(relativeTargetStatement.getLiteralData()));
		writer.close();
	} catch (IOException ex) {

		throw new Xdi2MessagingException("Error writing file: " + ex.getMessage(), ex, executionContext);
	}

	// done

	return ContributorResult.SKIP_MESSAGING_TARGET;
}
 
开发者ID:projectdanube,项目名称:xdi2-example-advanced-server,代码行数:22,代码来源:FastCollectionContributor.java



注:本文中的xdi2.core.Graph类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Status类代码示例发布时间:2022-05-22
下一篇:
Java GetClusterMetricsResponseProto类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap