org.springframework.social.twitter.connect
Class TwitterApiAdapter

java.lang.Object
  extended by org.springframework.social.twitter.connect.TwitterApiAdapter
All Implemented Interfaces:
ApiAdapter<TwitterApi>

public class TwitterApiAdapter
extends java.lang.Object
implements ApiAdapter<TwitterApi>

Twitter ApiAdapter implementation.


Constructor Summary
TwitterApiAdapter()
           
 
Method Summary
 UserProfile fetchUserProfile(TwitterApi api)
          Implements Connection.fetchUserProfile() for connections to the given API.
 void setConnectionValues(TwitterApi api, ConnectionValues values)
          Sets values for ConnectionKey.getProviderUserId(), Connection.getDisplayName(), Connection.getProfileUrl(), and Connection.getImageUrl() for connections to the given API.
 boolean test(TwitterApi api)
          Implements Connection.test() for connections to the given API.
 void updateStatus(TwitterApi 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

TwitterApiAdapter

public TwitterApiAdapter()
Method Detail

test

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

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

setConnectionValues

public void setConnectionValues(TwitterApi 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<TwitterApi>
Parameters:
api - the API binding
values - the connection values to set

fetchUserProfile

public UserProfile fetchUserProfile(TwitterApi 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<TwitterApi>
Parameters:
api - the API binding
Returns:
the service provider user profile
See Also:
UserProfileBuilder

updateStatus

public void updateStatus(TwitterApi 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<TwitterApi>
Parameters:
api - the API binding
message - the status message