|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.seam.social.OAuthServiceBase
public abstract class OAuthServiceBase
This Abstract implementation of OAuthService
uses an OAuthProvider
to deal with remote OAuth Services
Field Summary | |
---|---|
protected InjectionPoint |
ip
|
protected UserProfile |
myProfile
|
protected OAuthSessionSettings |
sessionSettings
|
protected SeamSocialExtension |
socialConfig
|
Constructor Summary | |
---|---|
OAuthServiceBase()
|
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
OAuthToken |
getAccessToken()
|
String |
getAuthorizationUrl()
Returns the url to the OAuth service to ask an authorization to access the service. |
UserProfile |
getMyProfile()
|
String |
getName()
|
Annotation |
getQualifier()
Returns the Qualifier used for this social network |
protected OAuthToken |
getRequestToken()
|
OAuthSessionSettings |
getSession()
|
OAuthServiceSettings |
getSettings()
|
String |
getStatus()
|
String |
getType()
Returns the name/type of the Social Network we're connected to |
String |
getVerifier()
Access to OAuth verifier |
String |
getVerifierParamName()
|
int |
hashCode()
|
protected void |
init()
This method tries to find a configuration for the current service. |
void |
initAccessToken()
Initialize the OAuth access token after the service gave an authorization with the Verifier |
protected abstract void |
initMyProfile()
|
boolean |
isConnected()
Returns the status of this ServiceHndler |
protected void |
requireAuthorization()
|
void |
resetConnection()
Close connexion if needed |
protected RestResponse |
sendSignedRequest(OAuthRequest request)
|
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 |
setStatus(String status)
Set the status to update |
void |
setVerifier(String verifierStr)
Used to initialize verifier code returned by OAuth service |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jboss.seam.social.rest.RestService |
---|
getServiceLogo |
Methods inherited from interface org.jboss.seam.social.HasStatus |
---|
updateStatus, updateStatus |
Field Detail |
---|
@Inject protected OAuthSessionSettings sessionSettings
@Inject protected InjectionPoint ip
@Inject protected SeamSocialExtension socialConfig
protected UserProfile myProfile
Constructor Detail |
---|
public OAuthServiceBase()
Method Detail |
---|
protected void init()
OAuthConfiguration
annotation to get value in it and build an OAuthServiceSettings
from
theseOAuthServiceSettings
bean with the same service qualifier (having the ServiceRelated
meta
annotation)
public String getType()
RestService
getType
in interface RestService
public OAuthSessionSettings getSession()
getSession
in interface OAuthService
public void setSession(OAuthSessionSettings session)
OAuthService
setSession
in interface OAuthService
public String getStatus()
getStatus
in interface HasStatus
public void setStatus(String status)
HasStatus
setStatus
in interface HasStatus
public String getName()
getName
in interface RestService
public OAuthServiceSettings getSettings()
getSettings
in interface OAuthService
public void setSettings(OAuthServiceSettings settings)
OAuthService
setSettings
in interface OAuthService
public String getAuthorizationUrl()
OAuthService
getAuthorizationUrl
in interface OAuthService
protected OAuthToken getRequestToken()
public void initAccessToken()
OAuthService
initAccessToken
in interface OAuthService
protected abstract void initMyProfile()
public void resetConnection()
RestService
resetConnection
in interface RestService
protected RestResponse sendSignedRequest(OAuthRequest request)
public RestResponse sendSignedRequest(RestVerb verb, String uri)
OAuthService
sendSignedRequest
in interface OAuthService
verb
- a REST verburi
- the REST address of the request
public RestResponse sendSignedRequest(RestVerb verb, String uri, String key, Object value)
OAuthService
sendSignedRequest
in interface OAuthService
verb
- a REST verburi
- the REST address of the requestkey
- name of the parametervalue
- value of the parameter
public RestResponse sendSignedXmlRequest(RestVerb verb, String uri, String payload)
OAuthService
sendSignedXmlRequest
in interface OAuthService
verb
- the REST verb of the requesturi
- the url of the remote requestpayload
- the content of the XML payload to send to the service
public RestResponse sendSignedRequest(RestVerb verb, String uri, Map<String,Object> params)
OAuthService
sendSignedRequest
in interface OAuthService
verb
- a REST verburi
- the REST address of the requestparams
- a Map of key value parameters to send in the header of the request
public void setVerifier(String verifierStr)
OAuthService
setVerifier
in interface OAuthService
public String getVerifier()
OAuthService
getVerifier
in interface OAuthService
public OAuthToken getAccessToken()
getAccessToken
in interface OAuthService
public boolean isConnected()
RestService
isConnected
in interface RestService
protected void requireAuthorization()
public void setAccessToken(String token, String secret)
OAuthService
setAccessToken
in interface OAuthService
token
- public keysecret
- secret keyspublic void setAccessToken(OAuthToken token)
OAuthService
setAccessToken
in interface OAuthService
token
- the token to setpublic String toString()
toString
in class Object
public String getVerifierParamName()
getVerifierParamName
in interface OAuthService
public UserProfile getMyProfile()
getMyProfile
in interface RestService
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public Annotation getQualifier()
RestService
getQualifier
in interface RestService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |