Package com.github.scribejava.core.oauth
Class OAuthService
- java.lang.Object
-
- com.github.scribejava.core.oauth.OAuthService
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
OAuth10aService,OAuth20Service
public abstract class OAuthService extends Object implements Closeable
-
-
Constructor Summary
Constructors Constructor Description OAuthService(String apiKey, String apiSecret, String callback, OutputStream debugStream, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
-
Method Summary
Modifier and Type Method Description voidclose()Responseexecute(OAuthRequest request)Future<Response>execute(OAuthRequest request, OAuthAsyncRequestCallback<Response> callback)<R> Future<R>execute(OAuthRequest request, OAuthAsyncRequestCallback<R> callback, OAuthRequest.ResponseConverter<R> converter)Future<Response>executeAsync(OAuthRequest request)StringgetApiKey()StringgetApiSecret()StringgetCallback()abstract StringgetVersion()Returns the OAuth version of the service.protected booleanisDebug()voidlog(String message)No need to wrap usages inisDebug().voidlog(String messagePattern, Object... params)Wrap usages inisDebug().
-
-
-
Constructor Detail
-
OAuthService
public OAuthService(String apiKey, String apiSecret, String callback, OutputStream debugStream, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getApiKey
public String getApiKey()
-
getApiSecret
public String getApiSecret()
-
getCallback
public String getCallback()
-
getVersion
public abstract String getVersion()
Returns the OAuth version of the service.- Returns:
- OAuth version as string
-
executeAsync
public Future<Response> executeAsync(OAuthRequest request)
-
execute
public Future<Response> execute(OAuthRequest request, OAuthAsyncRequestCallback<Response> callback)
-
execute
public <R> Future<R> execute(OAuthRequest request, OAuthAsyncRequestCallback<R> callback, OAuthRequest.ResponseConverter<R> converter)
-
execute
public Response execute(OAuthRequest request) throws InterruptedException, ExecutionException, IOException
-
log
public void log(String message)
No need to wrap usages inisDebug().- Parameters:
message- message to log
-
log
public void log(String messagePattern, 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()
-
-