org.jboss.seam.social.oauth
Interface OAuthService

All Superinterfaces:
RestService, Serializable
All Known Implementing Classes:
OAuthServiceBase, OAuthServiceJackson

public interface OAuthService
extends RestService

Implementation of this interface is used to manage a generic OAuth Service

Author:
Antoine Sabot-Durand

Method Summary
 OAuthToken getAccessToken()
           
 String getAuthorizationUrl()
          Returns the url to the OAuth service to ask an authorization to access the service.
 OAuthSessionSettings getSession()
           
 OAuthServiceSettings getSettings()
           
 String getVerifier()
          Access to OAuth verifier
 String getVerifierParamName()
           
 void initAccessToken()
          Initialize the OAuth access token after the service gave an authorization with the Verifier
 RestResponse sendSignedRequest(RestVerb verb, String uri)
          Send an OAuth request signed without any parameter
 RestResponse sendSignedRequest(RestVerb verb, String uri, Map<String,Object> params)
          Send an OAuth request signed with a list a parameter
 RestResponse sendSignedRequest(RestVerb verb, String uri, String key, Object value)
          Send an OAuth request signed with a single parameter
 RestResponse sendSignedXmlRequest(RestVerb verb, String uri, String payload)
          Send an OAuth request signed with an XML Paylad as content
 void setAccessToken(OAuthToken token)
          Set the Access Token with for an OAuth access
 void setAccessToken(String token, String secret)
          Initialize and set an OAuth access token from its public and private keys
 void setSession(OAuthSessionSettings session)
          Set the Session settings of the given service
 void setSettings(OAuthServiceSettings settings)
          Initialize OAuth settings
 void setVerifier(String verifierStr)
          Used to initialize verifier code returned by OAuth service
 
Methods inherited from interface org.jboss.seam.social.rest.RestService
getMyProfile, getName, getQualifier, getServiceLogo, getType, isConnected, resetConnection
 

Method Detail

getAccessToken

OAuthToken getAccessToken()
Returns:
the access token for the OAuth service

getAuthorizationUrl

String getAuthorizationUrl()
Returns the url to the OAuth service to ask an authorization to access the service.

Returns:
the REST URL to use request access

getSettings

OAuthServiceSettings getSettings()
Returns:
the settings of the service

getVerifier

String getVerifier()
Access to OAuth verifier

Returns:
the OAUth verifier

initAccessToken

void initAccessToken()
Initialize the OAuth access token after the service gave an authorization with the Verifier


sendSignedRequest

RestResponse sendSignedRequest(RestVerb verb,
                               String uri)
Send an OAuth request signed without any parameter

Parameters:
verb - a REST verb
uri - the REST address of the request
Returns:
an HttpResponse containing the response. It could be in various format (json, xml, string)

sendSignedRequest

RestResponse sendSignedRequest(RestVerb verb,
                               String uri,
                               Map<String,Object> params)
Send an OAuth request signed with a list a parameter

Parameters:
verb - a REST verb
uri - the REST address of the request
params - a Map of key value parameters to send in the header of the request
Returns:
an HttpResponse containing the response. It could be in various format (json, xml, string)

sendSignedRequest

RestResponse sendSignedRequest(RestVerb verb,
                               String uri,
                               String key,
                               Object value)
Send an OAuth request signed with a single parameter

Parameters:
verb - a REST verb
uri - the REST address of the request
key - name of the parameter
value - value of the parameter
Returns:
an HttpResponse containing the response. It could be in various format (json, xml, string)

setSettings

void setSettings(OAuthServiceSettings settings)
Initialize OAuth settings

Parameters:
settings -

setVerifier

void setVerifier(String verifierStr)
Used to initialize verifier code returned by OAuth service

Parameters:
verifierStr -

setAccessToken

void setAccessToken(String token,
                    String secret)
Initialize and set an OAuth access token from its public and private keys

Parameters:
token - public key
secret - secret keys

setAccessToken

void setAccessToken(OAuthToken token)
Set the Access Token with for an OAuth access

Parameters:
token - the token to set

sendSignedXmlRequest

RestResponse sendSignedXmlRequest(RestVerb verb,
                                  String uri,
                                  String payload)
Send an OAuth request signed with an XML Paylad as content

Parameters:
verb - the REST verb of the request
uri - the url of the remote request
payload - the content of the XML payload to send to the service
Returns:
an HttpResponse containing the response. It could be in various format (json, xml, string)

getVerifierParamName

String getVerifierParamName()
Returns:
the name of the URL param name containing verifier code sent bakc by the remote service

setSession

void setSession(OAuthSessionSettings session)
Set the Session settings of the given service

Parameters:
session -

getSession

OAuthSessionSettings getSession()
Returns:
the session settings of the given service


Copyright © 2011 Seam Framework. All Rights Reserved.