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

Java Xdi2ClientException类代码示例

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

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



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

示例1: saveCard

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的package包/类
private void saveCard(String jsonCard, MultipartFile file, boolean edit) throws JsonParseException, JsonMappingException, IOException, Xdi2ClientException {
	
	ObjectMapper mapper = new ObjectMapper();
	Card card = mapper.readValue((String) jsonCard, Card.class);
	
	if (file != null) {
		log.debug("file: [" + file.getOriginalFilename() + " : " + file.getSize() + " bytes]");
		String backgroundImage = Base64.encodeBase64String(file.getBytes());
		card.setBackgroundImage(backgroundImage);
	}
	
	if (edit) {
		cardService.editCard(card);
	}
	else {
		cardService.createCard(card);
	}
}
 
开发者ID:projectdanube,项目名称:xdi2-manager,代码行数:19,代码来源:CardController.java


示例2: createCard

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例3: deleteCard

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例4: setDefaultCard

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例5: revokeFacebookConnect

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例6: getFacebookProfile

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例7: getPersonalProfile

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例8: updatePersonalProfile

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例9: getCloudNames

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例10: getCloudNumber

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例11: getDependents

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例12: getConnections

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例13: getConnection

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例14: deleteConnection

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例15: getConnectionTemplates

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例16: getConnectionTemplate

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例17: deleteConnectionTemplate

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例18: generateNewKeyPair

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例19: deleteKeyPair

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的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


示例20: sampleAuthenticateSecretToken

import xdi2.client.exceptions.Xdi2ClientException; //导入依赖的package包/类
public static void sampleAuthenticateSecretToken() throws Xdi2ClientException {

		XDIDiscoveryClient xdiDiscoveryClient = XDIDiscoveryClient.DEFAULT_DISCOVERY_CLIENT;
		XDIDiscoveryResult xdiDiscoveryResult = xdiDiscoveryClient.discoverFromRegistry(XDIAddress.create("=alice"));

		CloudNumber cloudNumber = xdiDiscoveryResult.getCloudNumber();
		URI xdiEndpointUri = xdiDiscoveryResult.getXdiEndpointUri();
		String secretToken = "alice";

		try {

			XDIClientUtil.authenticateSecretToken(cloudNumber, xdiEndpointUri, secretToken);
		} catch (Xdi2ClientException ex) {

			System.err.println("Not authenticated.");
			throw ex;
		}

		System.out.println("Successfully authenticated.");
	}
 
开发者ID:projectdanube,项目名称:xdi2-example-client,代码行数:21,代码来源:RetrievePrivateKey.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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