Interface ServiceBuilderCommon
- All Known Subinterfaces:
ServiceBuilderOAuth10a,ServiceBuilderOAuth20
- All Known Implementing Classes:
ServiceBuilder
public interface ServiceBuilderCommon
Implementation of the Builder pattern, with a fluent interface that creates a
OAuthService-
Method Summary
Modifier and Type Method Description ServiceBuilderCommonapiKey(java.lang.String apiKey)Configures the api keyServiceBuilderCommonapiSecret(java.lang.String apiSecret)Configures the api secretServiceBuilderCommonapiSecretIsEmptyStringUnsafe()Configures the api secret as "" (empty string).ServiceBuilderCommoncallback(java.lang.String callback)Adds an OAuth callback urlServiceBuilderCommondebug()ServiceBuilderCommondebugStream(java.io.OutputStream debugStream)ServiceBuilderCommonhttpClient(HttpClient httpClient)takes precedence over httpClientConfigServiceBuilderCommonhttpClientConfig(HttpClientConfig httpClientConfig)ServiceBuilderCommonuserAgent(java.lang.String userAgent)
-
Method Details
-
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
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
-
apiSecretIsEmptyStringUnsafe
ServiceBuilderCommon apiSecretIsEmptyStringUnsafe()Configures the api secret as "" (empty string). Used usually for a test environments or another strange cases. Not all providers support empty string as api key and will throw an Exception in such cases.- Returns:
- the
ServiceBuilderinstance for method chaining
-
httpClientConfig
-
httpClient
takes precedence over httpClientConfig- Parameters:
httpClient- externally created HTTP client- Returns:
- the
ServiceBuilderinstance for method chaining
-
userAgent
-
debugStream
-
debug
ServiceBuilderCommon debug()
-