Package com.github.scribejava.core.oauth
Class OAuthService
java.lang.Object
com.github.scribejava.core.oauth.OAuthService
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
OAuth10aService
,OAuth20Service
public abstract class OAuthService
extends java.lang.Object
implements java.io.Closeable
-
Constructor Summary
Constructors Constructor Description OAuthService(java.lang.String apiKey, java.lang.String apiSecret, java.lang.String callback, java.io.OutputStream debugStream, java.lang.String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
-
Method Summary
Modifier and Type Method Description void
close()
Response
execute(OAuthRequest request)
java.util.concurrent.Future<Response>
execute(OAuthRequest request, OAuthAsyncRequestCallback<Response> callback)
<R> java.util.concurrent.Future<R>
execute(OAuthRequest request, OAuthAsyncRequestCallback<R> callback, OAuthRequest.ResponseConverter<R> converter)
java.util.concurrent.Future<Response>
executeAsync(OAuthRequest request)
java.lang.String
getApiKey()
java.lang.String
getApiSecret()
java.lang.String
getCallback()
abstract java.lang.String
getVersion()
Returns the OAuth version of the service.protected boolean
isDebug()
void
log(java.lang.String message)
No need to wrap usages inisDebug()
.void
log(java.lang.String messagePattern, java.lang.Object... params)
Wrap usages inisDebug()
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
OAuthService
public OAuthService(java.lang.String apiKey, java.lang.String apiSecret, java.lang.String callback, java.io.OutputStream debugStream, java.lang.String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
-
-
Method Details
-
close
public void close() throws java.io.IOException- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
getApiKey
public java.lang.String getApiKey() -
getApiSecret
public java.lang.String getApiSecret() -
getCallback
public java.lang.String getCallback() -
getVersion
public abstract java.lang.String getVersion()Returns the OAuth version of the service.- Returns:
- OAuth version as string
-
executeAsync
-
execute
public java.util.concurrent.Future<Response> execute(OAuthRequest request, OAuthAsyncRequestCallback<Response> callback) -
execute
public <R> java.util.concurrent.Future<R> execute(OAuthRequest request, OAuthAsyncRequestCallback<R> callback, OAuthRequest.ResponseConverter<R> converter) -
execute
public Response execute(OAuthRequest request) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.io.IOException- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.io.IOException
-
log
public void log(java.lang.String message)No need to wrap usages inisDebug()
.- Parameters:
message
- message to log
-
log
public void log(java.lang.String messagePattern, java.lang.Object... params)Wrap usages inisDebug()
. It was made for optimization - to not calculate "params" in production mode.- Parameters:
messagePattern
- messagePatternparams
- params
-
isDebug
protected boolean isDebug()
-