Package org.sakaiproject.profile2.logic
Interface ProfileExternalIntegrationLogic
-
public interface ProfileExternalIntegrationLogicAn interface for dealing with external integrations in Profile2- Author:
- Steve Swinsburg (steve.swinsburg@gmail.com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExternalIntegrationInfogetExternalIntegrationInfo(String userUuid)Get the ExternalIntegrationInfo record for a user or an empty record if none.StringgetGoogleAuthenticationUrl()Generate the authentication URL we need to use to present to the userStringgetTwitterName(ExternalIntegrationInfo info)Gets the Twitter name associated with the stored details, if any.Map<String,String>getTwitterOAuthConsumerDetails()Returns a map of the Twitter OAuth consumer 'key' and 'secret'voidsendMessageToTwitter(String userUuid, String message)Send a message to twitter ( runs in a separate thread)booleanupdateExternalIntegrationInfo(ExternalIntegrationInfo info)Update a user's ExternalIntegrationInfobooleanvalidateTwitterCredentials(ExternalIntegrationInfo info)Check if the stored Twitter credentials are valid.
-
-
-
Method Detail
-
getExternalIntegrationInfo
ExternalIntegrationInfo getExternalIntegrationInfo(String userUuid)
Get the ExternalIntegrationInfo record for a user or an empty record if none.- Parameters:
userUuid-- Returns:
-
updateExternalIntegrationInfo
boolean updateExternalIntegrationInfo(ExternalIntegrationInfo info)
Update a user's ExternalIntegrationInfo- Parameters:
info- ExternalIntegrationInfo object for the user- Returns:
-
getTwitterOAuthConsumerDetails
Map<String,String> getTwitterOAuthConsumerDetails()
Returns a map of the Twitter OAuth consumer 'key' and 'secret'- Returns:
-
getTwitterName
String getTwitterName(ExternalIntegrationInfo info)
Gets the Twitter name associated with the stored details, if any.- Parameters:
info- ExternalIntegrationInfo object for the user- Returns:
- name or null if none/error
-
validateTwitterCredentials
boolean validateTwitterCredentials(ExternalIntegrationInfo info)
Check if the stored Twitter credentials are valid.- Parameters:
info- ExternalIntegrationInfo object for the user- Returns:
- true if valid, false if not/error
-
sendMessageToTwitter
void sendMessageToTwitter(String userUuid, String message)
Send a message to twitter ( runs in a separate thread)Will only run if twitter integration is enabled globally (ie via sakai.properties) and if the user has linked their account.
Messages longer than 140 chars will be truncated to 140 chars. This is also validated client side.
- Parameters:
userUuid- uuid of the usermessage- the message
-
getGoogleAuthenticationUrl
String getGoogleAuthenticationUrl()
Generate the authentication URL we need to use to present to the user- Returns:
- url or null if not properly configured
-
-