public class PropertyOAuthAppSettingsBuilder extends SimpleOAuthAppSettingsBuilder
OAuthAppSettings
from a ResourceBundle
The bundle name is "agorava" ("agorava.properties" filename) by default but can be customized through (String)
keys in the file must be :
prefix(String)
. By default the prefix is emptyModifier and Type | Field and Description |
---|---|
static String |
BUNDLE_NAME
Global constant to give type safe name for the bundleName property when used in
.application.OAuthApplication |
static String |
PREFIX
Global constant to give type safe name for the prefix property when used in
.application.OAuthApplication |
API_KEY, API_SECRET, CALLBACK, NAME, SCOPE
Constructor and Description |
---|
PropertyOAuthAppSettingsBuilder() |
Modifier and Type | Method and Description |
---|---|
OAuthAppSettings |
build()
Builds the
OAuthAppSettings |
PropertyOAuthAppSettingsBuilder |
bundleName(String bundleName)
Set the bundle name to read settings from.
|
PropertyOAuthAppSettingsBuilder |
prefix(String prefix)
Set the prefix for the keys in the bundle
If it's not used, default prefix will be empty
|
apiKey, apiSecret, callback, name, params, qualifier, readFromSettings, scope
public static final String BUNDLE_NAME
.application.OAuthApplication
public static final String PREFIX
.application.OAuthApplication
public PropertyOAuthAppSettingsBuilder bundleName(String bundleName)
bundleName
- name of the bundlepublic PropertyOAuthAppSettingsBuilder prefix(String prefix)
prefix
- to add to keyspublic OAuthAppSettings build()
OAuthAppSettings
This implementation will build the OAuthAppSettings
from a ResourceBundle
It'll first try to load all binding (mandatory) fields from the bundle by looking for the key prefix.fieldName (or
fieldName if prefix is empty)
In a second time it'll check if optional fields are present in the bundle (with the same key construction) and load
them if they are.
If they are not present it'll try to load them without prefixbuild
in interface OAuthAppSettingsBuilder
build
in class SimpleOAuthAppSettingsBuilder
MissingResourceException
- if the bundle can't be openAgoravaException
- if a binding field is missing in the bundleCopyright © 2012-2013. All Rights Reserved.