A
- the service provider's API interfacepublic interface ApiAdapter<A>
Connection
model and a specific provider API model.Modifier and Type | Method and Description |
---|---|
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,
String message)
Implements
Connection.updateStatus(String) for connections to the given API. |
boolean test(A api)
Connection.test()
for connections to the given API.api
- the API bindingvoid setConnectionValues(A api, ConnectionValues values)
ConnectionKey.getProviderUserId()
, Connection.getDisplayName()
,
Connection.getProfileUrl()
, and Connection.getImageUrl()
for connections to the given API.api
- the API bindingvalues
- the connection values to setApiException
- if there is a problem fetching connection information from the provider.UserProfile fetchUserProfile(A api)
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
.api
- the API bindingApiException
- if there is a problem fetching a user profile from the provider.UserProfileBuilder
void updateStatus(A api, String message)
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.api
- the API bindingmessage
- the status messageApiException
- if there is a problem updating the user's status on the provider.