Spring Social的核心API
package org.springframework.social.connect;
/**
* A link to a service provider user.
* Allows the client application to access or update user information using the provider's API.
* Exposes a set of operations that are common across all service providers, including
* the ability to {@link #fetchUserProfile() access user profile information} and {@link #updateStatus(String) update user status}.
* @author Keith Donald
* @param <A> a strongly-typed binding to the service provider's API
*/
public interface Connection<A> {
/**
* The key identifying this connection.
* A composite key that consists of the "providerId" plus "providerUserId"; for example, "facebook" and "125660".
*/
ConnectionKey getKey();
/**
* A display name or label for this connection.
* Should be suitable for display on a UI and distinguish this connection from others with the same provider.
* Generally the full name or screen name of the connected provider user e.g. "Keith Donald" or "@kdonald".
* May be null if this information is not public or not provided.
* The value of this property may change if the user updates his or her profile.
* @see #sync()
*/
String getDisplayName();
/**
* The public URL of the connected user's profile at the provider's site.
* A client application may use this value along with the displayName to generate a link to the user's profile on the provider's system.
* May be null if this information is not public or not provided.
* The value of this property may change if the user updates his or her profile.
* @see #sync()
*/
String getProfileUrl();
/**
* A link to a image that visualizes this connection.
* Should visually distinguish this connection from others with the same provider.
* Generally the small/thumbnail version of the connected provider user's profile picture.
* May be null if this information is not public or not provided.
* The value of this property may change if the user updates his or her profile.
* @see #sync()
*/
String getImageUrl();
/**
* Sync's this connection object with the current state of the external user's profile.
* Triggers locally cached profile fields to update if they have changed on the provider's system.
*/
void sync();
/**
* Test this connection.
* If false, indicates calls to the {@link #getApi() api} will fail.
* Used to proactively test authorization credentials such as an API access token before invoking the service API.
*/
boolean test();
/**
* Returns true if this connection has expired.
* An expired connection cannot be used; calls to {@link #test()} return false, and any service API invocations fail.
* If expired, you may call {@link #refresh()} to renew the connection.
* Not supported by all Connection implementations; always returns false if not supported.
*/
boolean hasExpired();
/**
* Refresh this connection.
* Used to renew an expired connection.
* If the refresh operation is successful, {@link #hasExpired()} returns false.
* Not supported by all connection implementations; if not supported, this method is a no-op.
*/
void refresh();
/**
* Fetch a normalized model of the user's profile on the provider system.
* Capable of exposing the user's name, email, and username.
* What is actually exposed depends on the provider and scope of this connection.
*/
UserProfile fetchUserProfile();
/**
* Update the user's status on the provider's system.
* This method is a no-op if a status concept is not supported by the service provider.
* @param message the status message
*/
void updateStatus(String message);
/**
* A Java binding to the service provider's native API.
*/
A getApi();
/**
* Creates a data transfer object that can be used to persist the state of this connection.
* Used to support the transfer of connection state between layers of the application, such as to the database layer.
*/
ConnectionData createData();
}
分享到:
相关推荐
本教程是全网最细致地讲解Spring Security、Spring Social 、Spring Security OAuth三种技术开发安全的REST服务,彻底掌握一线互联网公司主流的身份认证和授权方式。 Spring Security是一个能够为基于Spring的企业...
### 探索OAuth与Spring Social #### 认证与授权概念 在深入研究OAuth协议以及Spring Social之前,我们首先需要了解认证(Authentication)与授权(Authorization)的基本概念。 **认证**是确认用户身份的过程,即...
Spring Social 是一个强大的Java框架,专门用于构建与各种社交网络服务集成的应用程序。它扩展了Spring框架的功能,允许开发者轻松地连接到如Facebook、Twitter等社交媒体平台,实现数据的读取、写入以及用户授权等...
《Spring Social Google:开源项目构建Google API集成》 在当今的互联网时代,API的集成已经成为开发者构建应用程序不可或缺的一部分。Spring Social Google是Spring框架的一个扩展,它为开发者提供了一个优雅的...
教程视频:spring提供的安全权限框架,Spring Security、Spring Social 、Spring Security OAuth
Spring社交扩展框架 Spring Social ,Spring Social 是 Spring 框架的扩展,用来方便开发Web社交应用程序,可通过该项...
在Spring Social中,每个社交网络都有一个提供者实现,例如Spring Social Facebook和Spring Social LinkedIn,它们封装了与对应社交网络的API交互的复杂性。 Spring Social LinkedIn是Spring Social的一个扩展,专...
Spring Social 是一个 Java 开发框架,它允许应用与各种社交网络进行集成,如QQ、微博等。这个"spring-social-base"项目是Spring Social的核心基础,为开发者提供了与各种社交服务进行交互的通用API和工具。在Spring...
主要介绍了利用Spring Social轻松搞定微信授权登录的方法示例,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
Github社交联合登录 步骤 1. 创建开发者应用 登录GitHub,【Settings】--> 【Developer settings】-->【OAuth Apps】-->【New Oauth App】,然后填写应用...spring.social.github.app-secret=YOUR_APP_SECRET
Spring Social Mockbin Spring Social Mockbin 基于构建,为提供 Java API 客户端。 Mockbin 由创建,“允许您生成自定义端点来测试、模拟和跟踪库、套接字和 API 之间的 HTTP 请求和响应”。 该项目遵循 Spring ...
《Spring Social Renren API 授权与接口封装详解》 在当今的互联网开发中,社交网络平台的API集成已经成为一个不可或缺的部分。人人网作为中国早期的大型社交网络平台,提供了丰富的API供开发者使用,以实现与用户...
Spring Social Ecobee 欢迎使用 Spring Social Ecobee,该库可让您与 Ecobee 的智能恒温器对话。参见上面的 CI 和与 gitter 聊天。 笔记Spring Social Ecobee 是一个社区项目,不受 Spring Social 团队的官方支持。 ...
spring-social-slideshare Spring Social 提供程序模块。项目状态目前只实现了SlideshowTemplate (幻灯片相关操作)。 如果您需要其他操作(用户、线索、活动等)或 Spring Social 的服务提供者连接框架的实现...
在本文中,我们将深入探讨"spring-social-kakao"项目,这是一个专门针对Kakao API集成的Spring Social扩展,目前仍处于测试阶段。 首先,Spring Social的核心概念是“连接提供者”(ProviderConnect),它为不同的...
7. Spring Social 8. Spring Security 9. Spring Mobile 10. Spring with other Web Frameworks 11. Data Access 12. Spring Transaction Management 13. Spring Batch 14. Spring NoSQL and Big Data 15. Spring ...
适用于Spring Boot的Spring Social Google Starter 通过该入门工具,您可以轻松集成Google的Spring Social扩展。 依存关系 该启动程序需要Spring Boot 1.3.0.M5和Java 8。