本文整理汇总了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);
}
示例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());
}
示例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());
}
示例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);
}
}
示例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());
}
}
示例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
}
示例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());
}
示例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());
}
示例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);
}
}
示例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");
}
示例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);
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}