org.springframework.social.github.connect
Class GitHubApiAdapter

java.lang.Object
  extended by org.springframework.social.github.connect.GitHubApiAdapter
All Implemented Interfaces:
ApiAdapter<GitHubApi>

public class GitHubApiAdapter
extends java.lang.Object
implements ApiAdapter<GitHubApi>

Github ApiAdapter implementation.


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

GitHubApiAdapter

public GitHubApiAdapter()
Method Detail

test

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

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

setConnectionValues

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

fetchUserProfile

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

updateStatus

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