Class FacebookConnector
- java.lang.Object
-
- lumis.socialnetworkintegration.connector.FacebookConnector
-
- All Implemented Interfaces:
ISocialNetworkConnector
public class FacebookConnector extends java.lang.Object implements ISocialNetworkConnector
Facebook implementation.- Since:
- 6.1.0
- Version:
- $Revision: 17594 $ $Date: 2015-07-17 11:22:41 -0300 (Fri, 17 Jul 2015) $
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NETWORK_NAME
-
Constructor Summary
Constructors Constructor Description FacebookConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
buildAuthenticationURL(java.lang.String callbackURL, SocialNetworkApplication application, java.util.Map<java.lang.String,java.lang.Object> stored)
Builds the Authentication URL for the social network.void
callback(java.lang.String returnedValue, SocialNetworkAccount account, java.util.Map<java.lang.String,java.lang.Object> stored)
Executes the callback after application/account authorization.com.restfb.Connection<com.restfb.types.Account>
getProfileAccounts(SocialNetworkAccount account)
Get all available accounts for the currently logged in user.java.lang.String
publish(SocialNetworkMessage message)
Calls the social network's publish method (varies according to network).void
remove(SocialNetworkMessage message)
Calls the social network's remove method (varies according to network) if there is one.java.lang.String
update(SocialNetworkMessage message)
Calls the social network's update method (varies according to network) if there is one.
-
-
-
Field Detail
-
NETWORK_NAME
public static final java.lang.String NETWORK_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
publish
public java.lang.String publish(SocialNetworkMessage message) throws PortalException
Description copied from interface:ISocialNetworkConnector
Calls the social network's publish method (varies according to network).- Specified by:
publish
in interfaceISocialNetworkConnector
- Parameters:
message
- the message to be published.- Returns:
- the remote message id.
- Throws:
PortalException
-
remove
public void remove(SocialNetworkMessage message) throws PortalException
Description copied from interface:ISocialNetworkConnector
Calls the social network's remove method (varies according to network) if there is one.- Specified by:
remove
in interfaceISocialNetworkConnector
- Parameters:
message
- the message to be removed.- Throws:
PortalException
-
update
public java.lang.String update(SocialNetworkMessage message) throws PortalException
Description copied from interface:ISocialNetworkConnector
Calls the social network's update method (varies according to network) if there is one.- Specified by:
update
in interfaceISocialNetworkConnector
- Parameters:
message
- the message to be updated.- Returns:
- the remote message id.
- Throws:
PortalException
-
buildAuthenticationURL
public java.lang.String buildAuthenticationURL(java.lang.String callbackURL, SocialNetworkApplication application, java.util.Map<java.lang.String,java.lang.Object> stored) throws PortalException
Description copied from interface:ISocialNetworkConnector
Builds the Authentication URL for the social network. Will store any needed values to be used in call back in thestored
object.- Specified by:
buildAuthenticationURL
in interfaceISocialNetworkConnector
- Parameters:
callbackURL
- String representing the url that should be called after the first step of authentication is taken.application
- SocialNetworkApplication contaning configuration specific values.stored
- Map to store object created by this method and that will be used in theISocialNetworkConnector.callback(String, SocialNetworkAccount, Map)
method.- Returns:
- String to where the portal should redirect user to.
- Throws:
PortalException
-
callback
public void callback(java.lang.String returnedValue, SocialNetworkAccount account, java.util.Map<java.lang.String,java.lang.Object> stored) throws PortalException
Description copied from interface:ISocialNetworkConnector
Executes the callback after application/account authorization. ResponseAuthentication will be put in account.- Specified by:
callback
in interfaceISocialNetworkConnector
- Parameters:
returnedValue
- value returned by original call/redirect from social network authorization.account
- Social network account to which the validation will occur.stored
- Map that has the objects created inISocialNetworkConnector.buildAuthenticationURL(String, SocialNetworkApplication, Map)
to be used in callback.- Throws:
PortalException
-
getProfileAccounts
public com.restfb.Connection<com.restfb.types.Account> getProfileAccounts(SocialNetworkAccount account) throws PortalException
Get all available accounts for the currently logged in user.- Parameters:
account
- theSocialNetworkAccount
for the user.- Returns:
- a
Connection
<Account
> with all available accounts. - Throws:
PortalException
- Since:
- 8.1.0
-
-