Package org.scribe.builder
Class ServiceBuilder
java.lang.Object
org.scribe.builder.ServiceBuilder
Implementation of the Builder pattern, with a fluent interface that creates a
OAuthService-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConfigures the api keyConfigures the api secretbuild()Returns the fully configuredOAuthServiceAdds an OAuth callback urldebug()debugStream(OutputStream stream) Configures theApiConfigures theApiOverloaded version.Configures the OAuth scope.signatureType(SignatureType type) Configures the signature type, choose between header, querystring, etc.
-
Constructor Details
-
ServiceBuilder
public ServiceBuilder()Default constructor
-
-
Method Details
-
provider
Configures theApi- Parameters:
apiClass- the class of one of the existentApis on org.scribe.api package- Returns:
- the
ServiceBuilderinstance for method chaining
-
provider
Configures theApiOverloaded version. Let's you use an instance instead of a class.- Parameters:
api- instance ofApis- Returns:
- the
ServiceBuilderinstance for method chaining
-
callback
Adds an OAuth callback url- Parameters:
callback- callback url. Must be a valid url or 'oob' for out of band OAuth- Returns:
- the
ServiceBuilderinstance for method chaining
-
apiKey
Configures the api key- Parameters:
apiKey- The api key for your application- Returns:
- the
ServiceBuilderinstance for method chaining
-
apiSecret
Configures the api secret- Parameters:
apiSecret- The api secret for your application- Returns:
- the
ServiceBuilderinstance for method chaining
-
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
-
signatureType
Configures the signature type, choose between header, querystring, etc. Defaults to Header- Parameters:
scope- The OAuth scope- Returns:
- the
ServiceBuilderinstance for method chaining
-
debugStream
-
debug
-
build
Returns the fully configuredOAuthService- Returns:
- fully configured
OAuthService
-