|
||||||||||
| 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 RestServicepublic OAuthSessionSettings getSession()
getSession in interface OAuthServicepublic void setSession(OAuthSessionSettings session)
OAuthService
setSession in interface OAuthServicepublic String getStatus()
getStatus in interface HasStatuspublic void setStatus(String status)
HasStatus
setStatus in interface HasStatuspublic String getName()
getName in interface RestServicepublic OAuthServiceSettings getSettings()
getSettings in interface OAuthServicepublic void setSettings(OAuthServiceSettings settings)
OAuthService
setSettings in interface OAuthServicepublic String getAuthorizationUrl()
OAuthService
getAuthorizationUrl in interface OAuthServiceprotected OAuthToken getRequestToken()
public void initAccessToken()
OAuthService
initAccessToken in interface OAuthServiceprotected abstract void initMyProfile()
public void resetConnection()
RestService
resetConnection in interface RestServiceprotected RestResponse sendSignedRequest(OAuthRequest request)
public RestResponse sendSignedRequest(RestVerb verb,
String uri)
OAuthService
sendSignedRequest in interface OAuthServiceverb - a REST verburi - the REST address of the request
public RestResponse sendSignedRequest(RestVerb verb,
String uri,
String key,
Object value)
OAuthService
sendSignedRequest in interface OAuthServiceverb - 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 OAuthServiceverb - 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 OAuthServiceverb - 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 OAuthServicepublic String getVerifier()
OAuthService
getVerifier in interface OAuthServicepublic OAuthToken getAccessToken()
getAccessToken in interface OAuthServicepublic boolean isConnected()
RestService
isConnected in interface RestServiceprotected void requireAuthorization()
public void setAccessToken(String token,
String secret)
OAuthService
setAccessToken in interface OAuthServicetoken - public keysecret - secret keyspublic void setAccessToken(OAuthToken token)
OAuthService
setAccessToken in interface OAuthServicetoken - the token to setpublic String toString()
toString in class Objectpublic String getVerifierParamName()
getVerifierParamName in interface OAuthServicepublic UserProfile getMyProfile()
getMyProfile in interface RestServicepublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic Annotation getQualifier()
RestService
getQualifier in interface RestService
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||