public class ServiceBuilder extends Object
OAuthService| Constructor and Description |
|---|
ServiceBuilder() |
| Modifier and Type | Method and Description |
|---|---|
T |
apiKey(String apiKey)
Configures the api key
|
T |
apiSecret(String apiSecret)
Configures the api secret
|
<S extends OAuthService> |
build(BaseApi<S> api)
Returns the fully configured
S |
T |
callback(String callback)
Adds an OAuth callback url
|
void |
checkPreconditions() |
ServiceBuilder |
connectTimeout(Integer connectTimeout) |
protected OAuthConfig |
createConfig() |
T |
debug() |
T |
debugStream(OutputStream stream) |
String |
getApiKey() |
String |
getApiSecret() |
String |
getCallback() |
OutputStream |
getDebugStream() |
String |
getGrantType() |
String |
getResponseType() |
String |
getScope() |
SignatureType |
getSignatureType() |
String |
getState() |
T |
grantType(String grantType) |
ServiceBuilder |
readTimeout(Integer readTimeout) |
T |
responseType(String responseType) |
T |
scope(String scope)
Configures the OAuth scope.
|
T |
signatureType(SignatureType type)
Configures the signature type, choose between header, querystring, etc.
|
T |
state(String state)
Configures the anti forgery session state.
|
public ServiceBuilder connectTimeout(Integer connectTimeout)
public ServiceBuilder readTimeout(Integer readTimeout)
protected OAuthConfig createConfig()
public T callback(String callback)
callback - callback url. Must be a valid url or 'oob' for out of band OAuthServiceBuilder instance for method chainingpublic T apiKey(String apiKey)
apiKey - The api key for your applicationServiceBuilder instance for method chainingpublic T apiSecret(String apiSecret)
apiSecret - The api secret for your applicationServiceBuilder instance for method chainingpublic T scope(String scope)
scope - The OAuth scopeServiceBuilder instance for method chainingpublic T state(String state)
state - The OAuth stateServiceBuilder instance for method chainingpublic T signatureType(SignatureType type)
type - SignatureTypeServiceBuilder instance for method chainingpublic T debugStream(OutputStream stream)
public T grantType(String grantType)
public T responseType(String responseType)
public T debug()
public void checkPreconditions()
public String getCallback()
public String getApiKey()
public String getApiSecret()
public String getScope()
public String getState()
public SignatureType getSignatureType()
public OutputStream getDebugStream()
public String getGrantType()
public String getResponseType()
public <S extends OAuthService> S build(BaseApi<S> api)
SS - OAuthService implementation (OAuth1/OAuth2/any API specific)api - will build Service for this APISCopyright © 2016. All rights reserved.