当前位置: 首页>>代码示例>>Java>>正文


Java ConnectionValues类代码示例

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


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

示例1: testSetConnectionValues

import org.springframework.social.connect.ConnectionValues; //导入依赖的package包/类
@Test
public void testSetConnectionValues() {
	Evernote evernote = mock(Evernote.class);
	UserStoreOperations userStoreOperations = mock(UserStoreOperations.class);
	User user = new User();
	user.setId(100);
	user.setUsername("foo");

	when(evernote.userStoreOperations()).thenReturn(userStoreOperations);
	when(userStoreOperations.getUser()).thenReturn(user);

	EvernoteAdapter adapter = new EvernoteAdapter();
	ConnectionValues values = mock(ConnectionValues.class);
	adapter.setConnectionValues(evernote, values);

	verify(values).setProviderUserId("100");
	verify(values).setDisplayName("foo");
	verify(values).setImageUrl(null);
	verify(values).setProfileUrl(null);
}
 
开发者ID:ttddyy,项目名称:spring-social-evernote,代码行数:21,代码来源:EvernoteAdapterTest.java

示例2: setConnectionValues

import org.springframework.social.connect.ConnectionValues; //导入依赖的package包/类
@Override
public void setConnectionValues(Twitter twitter, ConnectionValues values) {
    TwitterProfile profile = twitter.userOperations().getUserProfile();
    values.setProviderUserId(Long.toString(profile.getId()));
    values.setDisplayName("@" + profile.getScreenName());
    values.setProfileUrl(profile.getProfileUrl());
    values.setImageUrl(profile.getProfileImageUrl());
}
 
开发者ID:xm-online,项目名称:xm-uaa,代码行数:9,代码来源:TwitterAdapter.java

示例3: setConnectionValues

import org.springframework.social.connect.ConnectionValues; //导入依赖的package包/类
@Override
public void setConnectionValues(Discord api, ConnectionValues values) {
    DiscordUser profile = api.userOperations().getUser();
    values.setProviderUserId(String.valueOf(profile.getId()));
    values.setDisplayName(profile.getUsername());
    values.setProfileUrl("https://discordapp.com/channels/@me");
    values.setImageUrl(api.userOperations().getAvatarUrl());
}
 
开发者ID:quanticc,项目名称:sentry,代码行数:9,代码来源:DiscordAdapter.java

示例4: setConnectionValues

import org.springframework.social.connect.ConnectionValues; //导入依赖的package包/类
@Override
public void setConnectionValues(GitlabAPI gitlab, ConnectionValues values) {

    try {
        GitlabUser gitlabUser = gitlab.getUser();
        values.setProviderUserId(Long.toString(gitlabUser.getId()));
        values.setDisplayName(gitlabUser.getUsername());
        values.setImageUrl(gitlabUser.getAvatarUrl());
    } catch (IOException e) {
        throw new ApiException("gitlab?", "Could not fetch current user.", e);
    }
}
 
开发者ID:burning-duck,项目名称:spring-social-gitlab,代码行数:13,代码来源:GitlabAdapter.java

示例5: setConnectionValues

import org.springframework.social.connect.ConnectionValues; //导入依赖的package包/类
@Override
public void setConnectionValues(Kakao kakao, ConnectionValues values) {
    KakaoProfile profile = fetchPrimaryProfile(kakao);
    if (profile != null) {
        values.setProviderUserId(profile.getId());
        values.setDisplayName(profile.getUsername());
        values.setProfileUrl(profile.getProfileUrl());
        values.setImageUrl(profile.getImageUrl());
    }
}
 
开发者ID:Hongchae,项目名称:spring-social-kakao,代码行数:11,代码来源:KakaoAdaptor.java

示例6: setConnectionValues

import org.springframework.social.connect.ConnectionValues; //导入依赖的package包/类
@Override
public void setConnectionValues(KeyRock keyRock, ConnectionValues values) {
	User profile = keyRock.userOperations().getUserProfile();
	values.setProviderUserId(profile.getId());
	values.setDisplayName(profile.getDisplayName());
	//TODO: implement setImageUrl, setProfileUrl
}
 
开发者ID:TribalyteTechnologies,项目名称:spring-social-fiware-lab,代码行数:8,代码来源:KeyRockAdapter.java

示例7: setConnectionValues

import org.springframework.social.connect.ConnectionValues; //导入依赖的package包/类
public void setConnectionValues(final Naver naver, final ConnectionValues values) {
	final UserOperation userOperation = naver.userOperation();
	values.setProviderUserId(userOperation.getId());
	values.setProfileUrl("");
	values.setDisplayName(userOperation.getNickname());
	values.setImageUrl(userOperation.getProfile_image());
}
 
开发者ID:mornya,项目名称:spring-social-naver,代码行数:8,代码来源:NaverAdapter.java

示例8: setConnectionValues

import org.springframework.social.connect.ConnectionValues; //导入依赖的package包/类
public void setConnectionValues(AlfrescoLinkedIn linkedin, ConnectionValues values) {
    LinkedInProfile profile = linkedin.getUserProfile();
    values.setProviderUserId(profile.getId());
    values.setDisplayName(profile.getFirstName() + " " + profile.getLastName());
    values.setProfileUrl(profile.getPublicProfileUrl());
    values.setImageUrl(profile.getProfilePictureUrl());
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:8,代码来源:LinkedInAdapter.java

示例9: setConnectionValues

import org.springframework.social.connect.ConnectionValues; //导入依赖的package包/类
@Override
public void setConnectionValues(Weibo api, ConnectionValues values) {
	try {
		String uid = api.accountOperations().getUid().getString("uid");
		User user = api.usersOperations().showUserById(uid);
		values.setProviderUserId(user.getId() + "");
		values.setDisplayName(user.getScreenName());
		values.setProfileUrl(user.getUrl());
		values.setImageUrl(user.getAvatarLarge());
	} catch (Exception e) {
		LOG.error("error setConnectionValues", e);
	}
}
 
开发者ID:xfcjscn,项目名称:spring-social-weibo,代码行数:14,代码来源:WeiboAdapter.java

示例10: setConnectionValues

import org.springframework.social.connect.ConnectionValues; //导入依赖的package包/类
public void setConnectionValues(TencentWeibo tencentWeibo, ConnectionValues values) {
//        FacebookProfile profile = facebook.userOperations().getUserProfile();
//        values.setProviderUserId(profile.getId());
//        values.setDisplayName(profile.getUsername());
//        values.setProfileUrl("http://facebook.com/profile.php?id=" + profile.getId());
//        values.setImageUrl("http://graph.facebook.com/" + profile.getId() + "/picture");
    }
 
开发者ID:avidoggy,项目名称:spring-social-tencent-weibo,代码行数:8,代码来源:TencentWeiboAdapter.java

示例11: setConnectionValues

import org.springframework.social.connect.ConnectionValues; //导入依赖的package包/类
@Override
public void setConnectionValues(Battlenet api, ConnectionValues values) {
    final long accountId = api.accountOperations().getAccountId();
    final String battleTag = api.accountOperations().getBattleTag();
    values.setProviderUserId(String.valueOf(accountId));
    values.setDisplayName(battleTag);
}
 
开发者ID:saladinkzn,项目名称:spring-social-battlenet,代码行数:8,代码来源:BattlenetAdapter.java

示例12: setConnectionValues

import org.springframework.social.connect.ConnectionValues; //导入依赖的package包/类
@Override
public void setConnectionValues(Reddit reddit, ConnectionValues values) {
    RedditProfile profile = reddit.userOperations().getUserProfile();
    values.setProfileUrl(
            new StringBuilder(RedditPaths.USER_BASE_URL).append(profile.getUsername()).toString());
    values.setProviderUserId(profile.getUsername());
    values.setDisplayName(profile.getUsername());
}
 
开发者ID:alyahmed,项目名称:spring-social-reddit,代码行数:9,代码来源:RedditAdapter.java

示例13: setConnectionValues

import org.springframework.social.connect.ConnectionValues; //导入依赖的package包/类
@Override
public void setConnectionValues(Meetup meetup, ConnectionValues connValues) {

	Member self = meetup.memberOperations().getDetails();
	connValues.setDisplayName(self.getName());
	connValues.setImageUrl(self.getPhoto_url());
	connValues.setProviderUserId(self.getId());
}
 
开发者ID:yarli4u,项目名称:spring-social-meetup,代码行数:9,代码来源:MeetupAdapter.java

示例14: setConnectionValues

import org.springframework.social.connect.ConnectionValues; //导入依赖的package包/类
@Override
public void setConnectionValues(Box api, ConnectionValues connectionValues) {
    BoxProfile userProfile = api.userOperations().getUserProfile();

    connectionValues.setProviderUserId(userProfile.getId());
    connectionValues.setDisplayName(userProfile.getName());
}
 
开发者ID:eSignLive,项目名称:spring-social-box,代码行数:8,代码来源:BoxAdapter.java

示例15: setConnectionValues

import org.springframework.social.connect.ConnectionValues; //导入依赖的package包/类
public void setConnectionValues(Plus api, ConnectionValues values) {
    Person person = api.getPeopleOperations().get("me");
    values.setProviderUserId(person.getId());
    values.setDisplayName(person.getName().getFormatted());
    values.setProfileUrl(person.getUrl());
    values.setImageUrl(person.getImage().getUrl());
}
 
开发者ID:Glamdring,项目名称:google-plus-java-api,代码行数:8,代码来源:GooglePlusAdapter.java


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