org.sakaiproject.profile2.logic
Interface ProfileExternalIntegrationLogic


public interface ProfileExternalIntegrationLogic

An interface for dealing with external integrations in Profile2

Author:
Steve Swinsburg (steve.swinsburg@gmail.com)

Method Summary
 ExternalIntegrationInfo getExternalIntegrationInfo(String userUuid)
          Get the ExternalIntegrationInfo record for a user or an empty record if none.
 String getGoogleAuthenticationUrl()
          Generate the authentication URL we need to use to present to the user
 String getTwitterName(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'
 void sendMessageToTwitter(String userUuid, String message)
          Send a message to twitter ( runs in a separate thread)
 boolean updateExternalIntegrationInfo(ExternalIntegrationInfo info)
          Update a user's ExternalIntegrationInfo
 boolean validateTwitterCredentials(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 user
message - 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


Copyright © 2008-2013 The Sakai Foundation. All Rights Reserved.