Class ServiceBuilder
- java.lang.Object
-
- com.github.scribejava.core.builder.ServiceBuilder
-
public class ServiceBuilder extends Object
Implementation of the Builder pattern, with a fluent interface that creates aOAuthService
-
-
Constructor Summary
Constructors Constructor Description ServiceBuilder(String apiKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ServiceBuilder
apiKey(String apiKey)
Configures the api keyServiceBuilder
apiSecret(String apiSecret)
Configures the api secret<S extends OAuthService>
Sbuild(BaseApi<S> api)
OAuth10aService
build(DefaultApi10a api)
OAuth20Service
build(DefaultApi20 api)
ServiceBuilder
callback(String callback)
Adds an OAuth callback urlServiceBuilder
debug()
ServiceBuilder
debugStream(OutputStream debugStream)
ServiceBuilder
httpClient(HttpClient httpClient)
takes precedence over httpClientConfigServiceBuilder
httpClientConfig(HttpClientConfig httpClientConfig)
ServiceBuilder
responseType(String responseType)
ServiceBuilder
scope(String scope)
Configures the OAuth scope.ServiceBuilder
userAgent(String userAgent)
-
-
-
Constructor Detail
-
ServiceBuilder
public ServiceBuilder(String apiKey)
-
-
Method Detail
-
callback
public ServiceBuilder callback(String callback)
Adds an OAuth callback url- Parameters:
callback
- callback url. Must be a valid url or 'oob' (OAuthConstants.OOB
for out of band OAuth- Returns:
- the
ServiceBuilder
instance for method chaining
-
apiKey
public final ServiceBuilder apiKey(String apiKey)
Configures the api key- Parameters:
apiKey
- The api key for your application- Returns:
- the
ServiceBuilder
instance for method chaining
-
apiSecret
public ServiceBuilder apiSecret(String apiSecret)
Configures the api secret- Parameters:
apiSecret
- The api secret for your application- Returns:
- the
ServiceBuilder
instance for method chaining
-
scope
public ServiceBuilder scope(String scope)
Configures the OAuth scope. This is only necessary in some APIs (like Google's).- Parameters:
scope
- The OAuth scope- Returns:
- the
ServiceBuilder
instance for method chaining
-
debugStream
public ServiceBuilder debugStream(OutputStream debugStream)
-
responseType
public ServiceBuilder responseType(String responseType)
-
httpClientConfig
public ServiceBuilder httpClientConfig(HttpClientConfig httpClientConfig)
-
httpClient
public ServiceBuilder httpClient(HttpClient httpClient)
takes precedence over httpClientConfig- Parameters:
httpClient
- externally created HTTP client- Returns:
- the
ServiceBuilder
instance for method chaining
-
userAgent
public ServiceBuilder userAgent(String userAgent)
-
debug
public ServiceBuilder debug()
-
build
@Deprecated public <S extends OAuthService> S build(BaseApi<S> api)
Deprecated.Returns the fully configuredOAuthService
- Type Parameters:
S
- OAuthService implementation (OAuth1/OAuth2/any API specific)- Parameters:
api
- will build Service for this API- Returns:
- fully configured
OAuthService
-
build
public OAuth10aService build(DefaultApi10a api)
-
build
public OAuth20Service build(DefaultApi20 api)
-
-