Class ServiceBuilder
- java.lang.Object
-
- com.github.scribejava.core.builder.ServiceBuilder
-
public class ServiceBuilder extends java.lang.ObjectImplementation of the Builder pattern, with a fluent interface that creates aOAuthService
-
-
Constructor Summary
Constructors Constructor Description ServiceBuilder(java.lang.String apiKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ServiceBuilderapiKey(java.lang.String apiKey)Configures the api keyServiceBuilderapiSecret(java.lang.String apiSecret)Configures the api secret<S extends OAuthService>
Sbuild(BaseApi<S> api)Returns the fully configuredOAuthServiceServiceBuildercallback(java.lang.String callback)Adds an OAuth callback urlServiceBuilderdebug()ServiceBuilderdebugStream(java.io.OutputStream debugStream)ServiceBuilderhttpClient(HttpClient httpClient)takes precedence over httpClientConfigServiceBuilderhttpClientConfig(HttpClientConfig httpClientConfig)ServiceBuilderresponseType(java.lang.String responseType)ServiceBuilderscope(java.lang.String scope)Configures the OAuth scope.ServiceBuilderstate(java.lang.String state)Deprecated.use one of getAuthorizationUrl method inOAuth20ServiceServiceBuilderuserAgent(java.lang.String userAgent)
-
-
-
Method Detail
-
callback
public ServiceBuilder callback(java.lang.String callback)
Adds an OAuth callback url- Parameters:
callback- callback url. Must be a valid url or 'oob' (OAuthConstants.OOBfor out of band OAuth- Returns:
- the
ServiceBuilderinstance for method chaining
-
apiKey
public final ServiceBuilder apiKey(java.lang.String apiKey)
Configures the api key- Parameters:
apiKey- The api key for your application- Returns:
- the
ServiceBuilderinstance for method chaining
-
apiSecret
public ServiceBuilder apiSecret(java.lang.String apiSecret)
Configures the api secret- Parameters:
apiSecret- The api secret for your application- Returns:
- the
ServiceBuilderinstance for method chaining
-
scope
public ServiceBuilder scope(java.lang.String scope)
Configures the OAuth scope. This is only necessary in some APIs (like Google's).- Parameters:
scope- The OAuth scope- Returns:
- the
ServiceBuilderinstance for method chaining
-
state
@Deprecated public ServiceBuilder state(java.lang.String state)
Deprecated.use one of getAuthorizationUrl method inOAuth20Service/** Configures the anti forgery session state. This is available in some APIs (like Google's).- Parameters:
state- The OAuth state- Returns:
- the
ServiceBuilderinstance for method chaining
-
debugStream
public ServiceBuilder debugStream(java.io.OutputStream debugStream)
-
responseType
public ServiceBuilder responseType(java.lang.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
ServiceBuilderinstance for method chaining
-
userAgent
public ServiceBuilder userAgent(java.lang.String userAgent)
-
debug
public ServiceBuilder debug()
-
build
public <S extends OAuthService> S build(BaseApi<S> api)
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
-
-