org.springframework.social.connect
Interface ApiAdapter<A>

Type Parameters:
A - the service provider's API interface
All Known Implementing Classes:
FacebookApiAdapter, GitHubApiAdapter, GowallaApiAdapter, LinkedInApiAdapter, TripItApiAdapter, TwitterApiAdapter

public interface ApiAdapter<A>

An adapter that bridges between the uniform Connection model and a specific provider API model.


Method Summary
 UserProfile fetchUserProfile(A api)
          Implements Connection.fetchUserProfile() for connections to the given API.
 void setConnectionValues(A api, ConnectionValues values)
          Sets values for ConnectionKey.getProviderUserId(), Connection.getDisplayName(), Connection.getProfileUrl(), and Connection.getImageUrl() for connections to the given API.
 boolean test(A api)
          Implements Connection.test() for connections to the given API.
 void updateStatus(A api, java.lang.String message)
          Implements Connection.updateStatus(String) for connections to the given API.
 

Method Detail

test

boolean test(A api)
Implements Connection.test() for connections to the given API.

Parameters:
api - the API binding
Returns:
true if the API is functional, false if not

setConnectionValues

void setConnectionValues(A api,
                         ConnectionValues values)
Sets values for ConnectionKey.getProviderUserId(), Connection.getDisplayName(), Connection.getProfileUrl(), and Connection.getImageUrl() for connections to the given API.

Parameters:
api - the API binding
values - the connection values to set

fetchUserProfile

UserProfile fetchUserProfile(A api)
Implements Connection.fetchUserProfile() for connections to the given API. Should never return null. If the provider's API does not expose user profile data, this method should return UserProfile.EMPTY.

Parameters:
api - the API binding
Returns:
the service provider user profile
See Also:
UserProfileBuilder

updateStatus

void updateStatus(A api,
                  java.lang.String message)
Implements Connection.updateStatus(String) for connections to the given API. If the provider does not have a status concept calling this method should have no effect.

Parameters:
api - the API binding
message - the status message