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)
OAuthService(String apiKey, String apiSecret, String callback, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
-
Method Summary
Modifier and Type Method Description void
close()
Response
execute(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)
String
getApiKey()
String
getApiSecret()
String
getCallback()
abstract String
getVersion()
Returns the OAuth version of the service.protected boolean
isDebug()
void
log(String message)
No need to wrap usages inisDebug()
.void
log(String messagePattern, Object... params)
Wrap usages inisDebug()
.
-
-
-
Constructor Detail
-
OAuthService
@Deprecated public OAuthService(String apiKey, String apiSecret, String callback, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
- Parameters:
apiKey
- apiKeyapiSecret
- apiSecretcallback
- callbackuserAgent
- userAgenthttpClientConfig
- httpClientConfighttpClient
- httpClient
-
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:
close
in interfaceAutoCloseable
- Specified by:
close
in 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()
-
-