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

Java MessageEnvelope类代码示例

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

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



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

示例1: createCard

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
@Secured("IS_AUTHENTICATED")
public void createCard(Card card) throws Xdi2ClientException {
	Assert.notNull(card);
	CloudUser user = (CloudUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();

	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
	Message message = messageCollection.createMessage();
	message = user.prepareMessageToCloud(message);

	message.createSetOperation(cardXdiModelConverter.convertCardToXdi(card).iterator());

	log.debug("createCard message:\n" + messageEnvelope.getGraph().toString("XDI DISPLAY", null));

	user.getXdiClient().send(messageEnvelope);
}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:17,代码来源:CardService.java


示例2: deleteCard

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
@Secured("IS_AUTHENTICATED")
public void deleteCard(XDIAddress cardXdiAddress) throws Xdi2ClientException {
	Assert.notNull(cardXdiAddress);

	CloudUser user = (CloudUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	Card card = getCard(cardXdiAddress, false);

	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
	Message message = messageCollection.createMessage();
	message = user.prepareMessageToCloud(message);

	// Delete card
	message.createDelOperation(XDIAddress.create(card.getXdiAddress()));

	// Delete card in Public LC
	message.createDelOperation(cardXdiModelConverter.getCardInPublicLCStatement(XDIAddress.create(card.getXdiAddress()), card).iterator());

	// Delete card shortcut
	message.createDelOperation(cardXdiModelConverter.getCardShortcutAddress(card));

	log.debug("deleteCard message:\n" + messageEnvelope.getGraph().toString("XDI DISPLAY", null));

	user.getXdiClient().send(messageEnvelope);
}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:26,代码来源:CardService.java


示例3: setDefaultCard

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
@Secured("IS_AUTHENTICATED")
public void setDefaultCard(XDIAddress cardXdiAddress) throws Xdi2ClientException {
	Assert.notNull(cardXdiAddress);

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

	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);

	long messageIndex = 0;

	// if there is a default card, we must delete it first
	Message message = messageCollection.createMessage(messageIndex++);
	message = user.prepareMessageToCloud(message);
	message.createDelOperation(XDIStatement.create(user.getCloudNumber() + "$card/$ref/{}"));

	// create a new $ref
	message = messageCollection.createMessage(messageIndex);
	message = user.prepareMessageToCloud(message);

	message.createSetOperation(XDIStatement.create(user.getCloudNumber() + "$card/$ref/" + cardXdiAddress));

	log.debug("setDefaultCard message:\n" + messageEnvelope.getGraph().toString("XDI DISPLAY", null));

	user.getXdiClient().send(messageEnvelope);
}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:27,代码来源:CardService.java


示例4: revokeFacebookConnect

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
public void revokeFacebookConnect() throws Xdi2ClientException, IOException, JSONException {
	CloudUser user = (CloudUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	FacebookConnect facebookConnect = getFacebookConnectStatus();
	
	if (facebookConnect.getAccessToken() != null) {
		facebookApi.revokeAccessToken(facebookConnect.getAccessToken());
		
		XDIAddress facebookAccessTokenXdiAddress = XDIAddress.create("" + FacebookMapping.XDI_ADD_FACEBOOK_CONTEXT + facebookConnect.getUserId() + XDISecurityConstants.XDI_ADD_OAUTH_TOKEN);
		XDIAddress facebookUserIdXdiAddress = XDIAddress.create("" + FacebookMapping.XDI_ADD_FACEBOOK_CONTEXT + user.getCloudNumber());

		MessageEnvelope messageEnvelope = new MessageEnvelope();
		MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
		Message message = messageCollection.createMessage();
		message = user.prepareMessageToCloud(message);
		message.createDelOperation(facebookAccessTokenXdiAddress);
		message.createDelOperation(facebookUserIdXdiAddress);

		user.getXdiClient().send(messageEnvelope);
		
	}
}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:22,代码来源:FacebookService.java


示例5: getFacebookProfile

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
public FacebookProfile getFacebookProfile() throws Xdi2ClientException, IOException {
	CloudUser user = (CloudUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	FacebookConnect facebookConnect = getFacebookConnectStatus();

	FacebookProfile profile = new FacebookProfile();
	
	XDIAddress facebookContext = XDIAddress.create("" + FacebookMapping.XDI_ADD_FACEBOOK_CONTEXT + facebookConnect.getUserId());
	
	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
	Message message = messageCollection.createMessage();
	message = user.prepareMessageToCloud(message);
	
	for (XDIAddress fieldXdiAddress : XDI_FACEBOOK_PROFILE.values()) {
		message.createGetOperation(XDIAddressUtil.concatXDIAddresses(facebookContext, fieldXdiAddress));
	}

	MessagingResponse messagingResponse = user.getXdiClient().send(messageEnvelope);
	
	for (String field : XDI_FACEBOOK_PROFILE.keySet()) {
		profile.putField(field, generateFacebookField(XDIAddressUtil.concatXDIAddresses(facebookContext, XDI_FACEBOOK_PROFILE.get(field)), messagingResponse.getResultGraph()));
	}
	
	return profile;
}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:26,代码来源:FacebookService.java


示例6: getPersonalProfile

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
@Secured("IS_AUTHENTICATED")
public PersonalProfile getPersonalProfile() throws Xdi2ClientException {
	CloudUser user = (CloudUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();

	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
	Message message = messageCollection.createMessage();
	message = user.prepareMessageToCloud(message);
	xdiModelConverter.prepareMessageForPersonalProfile(message);

	long start = System.currentTimeMillis();
	MessagingResponse messagingResponse = user.getXdiClient().send(messageEnvelope);
	log.debug("network time: " + (System.currentTimeMillis() - start));		

	PersonalProfile profile = xdiModelConverter.convertToPersonalProfile(messagingResponse.getResultGraph());

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


示例7: updatePersonalProfile

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
@Secured("IS_AUTHENTICATED")
public void updatePersonalProfile(PersonalProfile profile) throws Xdi2ClientException {
	Assert.notNull(profile);

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

	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
	Message message = messageCollection.createMessage();
	message = user.prepareMessageToCloud(message);

	List<XDIStatement> statements = xdiModelConverter.convertPersonalProfileToStatements(profile);
	message.createSetOperation(statements.iterator());

	user.getXdiClient().send(messageEnvelope);

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


示例8: getCloudNames

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
@Secured("IS_AUTHENTICATED")
public List<String> getCloudNames()  throws Xdi2ClientException {
	CloudUser user = (CloudUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	
	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
	Message message = messageCollection.createMessage();
	message = user.prepareMessageToCloud(message);
	
	message.createGetOperation(XDIStatement.create(user.getCloudNumber() + "/$is$ref/{}"));
	
	MessagingResponse messagingResponse = user.getXdiClient().send(messageEnvelope);

	ReadOnlyIterator<Relation> relations = messagingResponse.getResultGraph().getDeepRelations(user.getCloudNumber().getXDIAddress(), XDIAddress.create("$is$ref"));

	List<String> cloudNames = new ArrayList<String>();
	while (relations.hasNext()) {
		Relation r = relations.next();
		cloudNames.add(r.getTargetXDIAddress().toString());
	}

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


示例9: getCloudNumber

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
@Secured("IS_AUTHENTICATED")
public String getCloudNumber()  throws Xdi2ClientException {
	CloudUser user = (CloudUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	
	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
	Message message = messageCollection.createMessage();
	message = user.prepareMessageToCloud(message);
	
	message.createGetOperation(XDIStatement.create(user.getCloudNumber() + "/$is$ref/{}"));
	
	MessagingResponse messagingResponse = user.getXdiClient().send(messageEnvelope);

	ContextNode contextNode = messagingResponse.getResultGraph().getDeepContextNode(user.getCloudNumber().getXDIAddress());
	return contextNode.toString();
}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:17,代码来源:CloudService.java


示例10: getDependents

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
@Secured("IS_AUTHENTICATED")
public List<String> getDependents()  throws Xdi2ClientException {
	CloudUser user = (CloudUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	
	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
	Message message = messageCollection.createMessage();
	message = user.prepareMessageToCloud(message);
	
	message.createGetOperation(XDIStatement.create(user.getCloudNumber() + "/$is#guardian/{}"));
	
	MessagingResponse messagingResponse = user.getXdiClient().send(messageEnvelope);

	ReadOnlyIterator<Relation> relations = messagingResponse.getResultGraph().getDeepRelations(user.getCloudNumber().getXDIAddress(), XDIAddress.create("$is#guardian"));

	List<String> dependents = new ArrayList<String>();
	while (relations.hasNext()) {
		Relation r = relations.next();
		
		String dependentCloudNumber = r.getTargetXDIAddress().toString();
		dependents.add(reverseNameResolutionService.getCloudName(dependentCloudNumber));
	}

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


示例11: getConnections

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
@Secured("IS_AUTHENTICATED")
public List<Connection> getConnections() throws Xdi2ClientException {
	CloudUser user = (CloudUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();

	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
	Message message = messageCollection.createMessage();
	message = user.prepareMessageToCloud(message);
	message.createGetOperation(user.getCloudNumber().getXDIAddress());

	MessagingResponse messagingResponse = user.getXdiClient().send(messageEnvelope);

	Iterator<LinkContract> linkContracts = LinkContracts.getAllLinkContracts(messagingResponse.getResultGraph());

	List<Connection> connections = new ArrayList<>();
	while (linkContracts.hasNext()) {
		LinkContract linkContract = linkContracts.next();
		connections.add(xdiModelConverter.convertLinkContractToConnection(linkContract));
	}

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


示例12: getConnection

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
@Secured("IS_AUTHENTICATED")
public Connection getConnection(final String id) throws Xdi2ClientException {
	Assert.hasLength(id);

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

	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
	Message message = messageCollection.createMessage();
	message = user.prepareMessageToCloud(message);

	String xdiAddress = Connection.convertIdToXdiAddress(id);
	message.createGetOperation(XDIAddress.create(xdiAddress));

	MessagingResponse messagingResponse = user.getXdiClient().send(messageEnvelope);

	Iterator<LinkContract> linkContracts = LinkContracts.getAllLinkContracts(messagingResponse.getResultGraph());		
	if (linkContracts.hasNext() == false) {
		return null;
	}

	return xdiModelConverter.convertLinkContractToConnection(linkContracts.next());
}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:24,代码来源:CloudService.java


示例13: deleteConnection

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
@Secured("IS_AUTHENTICATED")
public void deleteConnection(String id) throws Xdi2ClientException {
	Assert.hasLength(id);

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

	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
	Message message = messageCollection.createMessage();
	message = user.prepareMessageToCloud(message);

	String xdiAddress = Connection.convertIdToXdiAddress(id);
	message.createDelOperation(XDIAddress.create(xdiAddress));

	user.getXdiClient().send(messageEnvelope);

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


示例14: getConnectionTemplates

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
@Secured("IS_AUTHENTICATED")
public List<ConnectionTemplate> getConnectionTemplates() throws Xdi2ClientException {
	CloudUser user = (CloudUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();

	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
	Message message = messageCollection.createMessage();
	message = user.prepareMessageToCloud(message);
	message.createGetOperation(user.getCloudNumber().getXDIAddress());

	MessagingResponse messagingResponse = user.getXdiClient().send(messageEnvelope);

	Iterator<LinkContractTemplate> linkContracts = LinkContractTemplates.getAllLinkContractTemplates(messagingResponse.getResultGraph());

	List<ConnectionTemplate> connections = new ArrayList<>();
	while (linkContracts.hasNext()) {
		LinkContractTemplate linkContractTemplate = linkContracts.next();
		connections.add(xdiModelConverter.convertLinkContractTemplateToConnectionTemplate(linkContractTemplate));
	}

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


示例15: getConnectionTemplate

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
@Secured("IS_AUTHENTICATED")
public ConnectionTemplate getConnectionTemplate(final String id) throws Xdi2ClientException {
	Assert.hasLength(id);

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

	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
	Message message = messageCollection.createMessage();
	message = user.prepareMessageToCloud(message);

	String xdiAddress = Connection.convertIdToXdiAddress(id);
	message.createGetOperation(XDIAddress.create(xdiAddress));

	MessagingResponse messagingResponse = user.getXdiClient().send(messageEnvelope);

	Iterator<LinkContractTemplate> linkContractTemplate = LinkContractTemplates.getAllLinkContractTemplates(messagingResponse.getResultGraph());		
	if (linkContractTemplate.hasNext() == false) {
		return null;
	}

	return xdiModelConverter.convertLinkContractTemplateToConnectionTemplate(linkContractTemplate.next());
}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:24,代码来源:CloudService.java


示例16: deleteConnectionTemplate

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
@Secured("IS_AUTHENTICATED")
public void deleteConnectionTemplate(String id) throws Xdi2ClientException {
	Assert.hasLength(id);

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

	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
	Message message = messageCollection.createMessage();
	message = user.prepareMessageToCloud(message);

	String xdiAddress = Connection.convertIdToXdiAddress(id);
	message.createDelOperation(XDIAddress.create(xdiAddress));

	user.getXdiClient().send(messageEnvelope);

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


示例17: generateNewKeyPair

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
private void generateNewKeyPair(String keyType) throws Xdi2ClientException {
	CloudUser user = (CloudUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();

	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
	Message message = messageCollection.createMessage();
	message = user.prepareMessageToCloud(message);

	if ("ENCRYPT".equals(keyType)) {
		message.createOperation(GenerateKeyContributor.XDI_ADD_DO_KEYPAIR, XDIStatement.fromComponents(XDIAddressUtil.concatXDIAddresses(user.getCloudNumber().getXDIAddress(), XDISecurityConstants.XDI_ADD_MSG_ENCRYPT_KEYPAIR), XDIDictionaryConstants.XDI_ADD_IS_TYPE, XDIAddress.create("$rsa$2048")));
	}
	else {
		message.createOperation(GenerateKeyContributor.XDI_ADD_DO_KEYPAIR, XDIStatement.fromComponents(XDIAddressUtil.concatXDIAddresses(user.getCloudNumber().getXDIAddress(), XDISecurityConstants.XDI_ADD_MSG_SIG_KEYPAIR), XDIDictionaryConstants.XDI_ADD_IS_TYPE, XDIAddress.create("$rsa$2048")));
	}

	user.getXdiClient().send(messageEnvelope);	
}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:18,代码来源:CloudService.java


示例18: deleteKeyPair

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
private void deleteKeyPair(String keyType) throws Xdi2ClientException {
	CloudUser user = (CloudUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();

	MessageEnvelope messageEnvelope = new MessageEnvelope();
	MessageCollection messageCollection = messageEnvelope.getMessageCollection(user.getCloudNumber().getXDIAddress(), true);
	Message message = messageCollection.createMessage();
	message = user.prepareMessageToCloud(message);

	if ("ENCRYPT".equals(keyType)) {
		message.createDelOperation(XDIAddressUtil.concatXDIAddresses(user.getCloudNumber().getXDIAddress(), XDISecurityConstants.XDI_ADD_MSG_ENCRYPT_KEYPAIR));			
	}
	else {			
		message.createDelOperation(XDIAddressUtil.concatXDIAddresses(user.getCloudNumber().getXDIAddress(), XDISecurityConstants.XDI_ADD_MSG_SIG_KEYPAIR));
	}

	user.getXdiClient().send(messageEnvelope);	
}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:18,代码来源:CloudService.java


示例19: deleteAccessData

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
public static void deleteAccessData( DependentData data, String type, String uuid )
{
	try
	{
		CloudNumber cloudNumber = data.getCloudNumber();

		MessageEnvelope messageEnvelope = new MessageEnvelope();
		Message message = messageEnvelope.createMessage(cloudNumber.getXDIAddress());
		message.setToPeerRootXDIArc(cloudNumber.getPeerRootXDIArc());
		message.setLinkContract(RootLinkContract.class);
		message.setSecretToken(data.getSecretToken());
		message.createDelOperation(XDIAddressUtil.concatXDIAddresses(cloudNumber.getXDIAddress(), XDIAddress.create("<#proxy>"), XDIAddress.create("[<#" + type + ">]"), XDIAddress.create("<!:uuid:" + uuid + ">")));
		MessageResult messageResult = new XDIHttpClient(data.getCloudUrl()).send(messageEnvelope, null);

		logger.info(messageResult.getGraph().toString("XDI DISPLAY", null));
	}
	catch( Exception e )
	{
		logger.error("addAccessData() failed - " + e.getMessage(), e);
		throw new ProxyInternalErrorException("deleteAccessData() failed");
	}
}
 
开发者ID:nzatnsr,项目名称:neustar-clouds-proxy,代码行数:23,代码来源:ProxyXdiService.java


示例20: registerCloudXdiUrl

import xdi2.messaging.MessageEnvelope; //导入依赖的package包/类
public static boolean registerCloudXdiUrl(CSP csp,
		XDI3Segment cloudNumberPeerRootXri, String cloudXdiEndpoint)
		throws Exception {

	MessageEnvelope messageEnvelope = new MessageEnvelope();

	Message message = messageEnvelope.getMessage(csp.getCSPCloudNumber(),
			true);
	message.setToAuthority(XDI3Segment.fromComponent(XdiPeerRoot
			.createPeerRootArcXri(RESPECT_NETWORK_CLOUD_NUMBER)));
	message.setLinkContractXri(XDI3Segment.create("+registrar$do"));
	
	message.getContextNode().setDeepLiteral(XDI3Segment.create("" + XDIAuthenticationConstants.XRI_S_SECRET_TOKEN + XDIConstants.XRI_S_VALUE), csp.getCSPSecretToken());
	XDI3Statement targetStatement = XDI3Statement
			.fromLiteralComponents(
					XDI3Segment.create("" + cloudNumberPeerRootXri
							+ "$xdi<$uri>&"), cloudXdiEndpoint);

	message.createSetOperation(targetStatement);

	xdiClientRespectNetworkRegistrar.send(messageEnvelope, null);

	System.out.println("Cloud XDI URL registered - " + cloudXdiEndpoint);

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java OnDisabled类代码示例发布时间:2022-05-22
下一篇:
Java AvaticaUtils类代码示例发布时间: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