org.springframework.social.facebook.connect
Class FacebookApiAdapter

java.lang.Object
  extended by org.springframework.social.facebook.connect.FacebookApiAdapter
All Implemented Interfaces:
ApiAdapter<FacebookApi>

public class FacebookApiAdapter
extends java.lang.Object
implements ApiAdapter<FacebookApi>

Facebook API adapter implementation.


Constructor Summary
FacebookApiAdapter()
           
 
Method Summary
 UserProfile fetchUserProfile(FacebookApi api)
          Implements Connection.fetchUserProfile() for connections to the given API.
 void setConnectionValues(FacebookApi api, ConnectionValues values)
          Sets values for ConnectionKey.getProviderUserId(), Connection.getDisplayName(), Connection.getProfileUrl(), and Connection.getImageUrl() for connections to the given API.
 boolean test(FacebookApi api)
          Implements Connection.test() for connections to the given API.
 void updateStatus(FacebookApi api, java.lang.String message)
          Implements Connection.updateStatus(String) for connections to the given API.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FacebookApiAdapter

public FacebookApiAdapter()
Method Detail

test

public boolean test(FacebookApi api)
Description copied from interface: ApiAdapter
Implements Connection.test() for connections to the given API.

Specified by:
test in interface ApiAdapter<FacebookApi>
Parameters:
api - the API binding
Returns:
true if the API is functional, false if not

setConnectionValues

public void setConnectionValues(FacebookApi api,
                                ConnectionValues values)
Description copied from interface: ApiAdapter
Sets values for ConnectionKey.getProviderUserId(), Connection.getDisplayName(), Connection.getProfileUrl(), and Connection.getImageUrl() for connections to the given API.

Specified by:
setConnectionValues in interface ApiAdapter<FacebookApi>
Parameters:
api - the API binding
values - the connection values to set

fetchUserProfile

public UserProfile fetchUserProfile(FacebookApi api)
Description copied from interface: ApiAdapter
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.

Specified by:
fetchUserProfile in interface ApiAdapter<FacebookApi>
Parameters:
api - the API binding
Returns:
the service provider user profile
See Also:
UserProfileBuilder

updateStatus

public void updateStatus(FacebookApi api,
                         java.lang.String message)
Description copied from interface: ApiAdapter
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.

Specified by:
updateStatus in interface ApiAdapter<FacebookApi>
Parameters:
api - the API binding
message - the status message