|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gdata.client.authn.oauth.OAuthParameters
public class OAuthParameters
Container for OAuth-related parameters. The parameters are divided into two categories: those used to generate the signature base string, and other parameters. For each parameter, there are 4 different types of methods: a getter, a setter, a check if the parameter exists (that returns a boolean) and a check if the parameter exists (that throws an exception). Refer to the getters/setters for each parameter below to learn more about the parameter.
Nested Class Summary | |
---|---|
static class |
OAuthParameters.OAuthType
Type of OAuth for this parameter set (i.e., two-legged or three-legged OAuth (see "https://sites.google.com/a/google.com/oauth/"). |
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
baseParameters
|
protected java.util.Map<java.lang.String,java.lang.String> |
extraParameters
|
static java.lang.String |
OAUTH_CALLBACK_KEY
|
static java.lang.String |
OAUTH_CONSUMER_KEY
|
static java.lang.String |
OAUTH_CONSUMER_SECRET
|
static java.lang.String |
OAUTH_KEY
|
static java.lang.String |
OAUTH_NONCE_KEY
|
static java.lang.String |
OAUTH_SIGNATURE_KEY
|
static java.lang.String |
OAUTH_SIGNATURE_METHOD_KEY
|
static java.lang.String |
OAUTH_TIMESTAMP_KEY
|
static java.lang.String |
OAUTH_TOKEN_KEY
|
static java.lang.String |
OAUTH_TOKEN_SECRET_KEY
|
static java.lang.String |
OAUTH_VERIFIER_KEY
|
static java.lang.String |
REALM_KEY
|
static java.lang.String |
XOAUTH_REQUESTOR_ID_KEY
|
Constructor Summary | |
---|---|
OAuthParameters()
Creates a new OAuthParameters object. |
Method Summary | |||
---|---|---|---|
void |
addCustomBaseParameter(java.lang.String key,
java.lang.String value)
Adds a parameter to be used when generating the OAuth signature. |
||
void |
addExtraParameter(java.lang.String key,
java.lang.String value)
Sets a parameter related to OAuth (but not used when generating the signature). |
||
protected void |
assertExists(java.lang.String key,
java.util.Map<java.lang.String,java.lang.String> params)
Checks the given key to see if it exists, and throws an exception if it does not. |
||
void |
assertOAuthCallbackExists()
Checks to see if the OAuth callback exists. |
||
void |
assertOAuthConsumerKeyExists()
Checks to see if the OAuth Consumer Key exists. |
||
void |
assertOAuthConsumerSecretExists()
|
||
void |
assertOAuthNonceExists()
Checks to see if the OAuth nonce exists. |
||
void |
assertOAuthSignatureExists()
Checks to see if the OAuth signature exists. |
||
void |
assertOAuthSignatureMethodExists()
Checks to see if the OAuth signature method exists. |
||
void |
assertOAuthTimestampExists()
Checks to see if the OAuth timestamp exists. |
||
void |
assertOAuthTokenExists()
Checks to see if the OAuth token exists. |
||
void |
assertOAuthTokenSecretExists()
Checks to see if the OAuth token secret exists. |
||
void |
assertOAuthVerifierExists()
Checks to see if the OAuth Verifier exists. |
||
void |
assertRealmExists()
Checks to see if the realm exists. |
||
protected boolean |
checkExists(java.lang.String key,
java.util.Map<java.lang.String,java.lang.String> params)
Checks the given key to see if it exists. |
||
boolean |
checkOAuthCallbackExists()
Checks to see if the OAuth callback exists. |
||
boolean |
checkOAuthConsumerKeyExists()
Checks to see if the OAuth Consumer Key exists. |
||
boolean |
checkOAuthConsumerSecretExists()
|
||
boolean |
checkOAuthNonceExists()
Checks to see if the OAuth nonce exists. |
||
boolean |
checkOAuthSignatureExists()
Checks to see if the OAuth signature exists. |
||
boolean |
checkOAuthSignatureMethodExists()
Checks to see if the OAuth signature method exists. |
||
boolean |
checkOAuthTimestampExists()
Checks to see if the OAuth timestamp exists. |
||
boolean |
checkOAuthTokenExists()
Checks to see if the OAuth token exists. |
||
boolean |
checkOAuthTokenSecretExists()
Checks to see if the OAuth token secret exists. |
||
boolean |
checkOAuthVerifierExists()
Checks to see if the OAuth Verifier exists. |
||
boolean |
checkRealmExists()
Checks to see if the realm exists. |
||
protected java.lang.String |
get(java.lang.String key,
java.util.Map<java.lang.String,java.lang.String> params)
Retrieves the value with the given key from the input map. |
||
java.util.Map<java.lang.String,java.lang.String> |
getBaseParameters()
Return the parameters used to calculate the OAuth signature. |
||
java.util.Map<java.lang.String,java.lang.String> |
getExtraParameters()
Returns any other parameters used in the OAuth process, such as the OAuth callback url. |
||
java.lang.String |
getOAuthCallback()
Returns the OAuth callback url. |
||
java.lang.String |
getOAuthConsumerKey()
Returns the OAuth Consumer Key. |
||
java.lang.String |
getOAuthConsumerSecret()
|
||
java.lang.String |
getOAuthNonce()
Returns the OAuth nonce. |
||
java.lang.String |
getOAuthSignature()
Returns the OAuth signature used to sign the current request. |
||
java.lang.String |
getOAuthSignatureMethod()
Returns the OAuth Signature Method. |
||
java.lang.String |
getOAuthTimestamp()
Returns the OAuth timestamp. |
||
java.lang.String |
getOAuthToken()
Returns the OAuth token. |
||
java.lang.String |
getOAuthTokenSecret()
Returns the OAuth Token Secret. |
||
OAuthParameters.OAuthType |
getOAuthType()
Retrieves the OAuth type requested. |
||
java.lang.String |
getOAuthVerifier()
Returns the OAuth Verifier. |
||
java.lang.String |
getRealm()
Returns the Realm parameter to be used in the authorization header, as defined by |
protected void |
put(java.lang.String key,
java.lang.String value,
java.util.Map<java.lang.String,java.lang.String> params)
Adds the key/value pair to the input map. |
protected void |
remove(java.lang.String key,
java.util.Map<java.lang.String,java.lang.String> params)
Removes a key/value pair from the input map. |
||
void |
removeCustomBaseParameter(java.lang.String key)
Removes a parameter from the OAuth signature. |
||
void |
reset()
Resets all transient parameters related to a single request, so that these parameters do not interfere with multiple requests. |
||
void |
setOAuthCallback(java.lang.String oauthCallback)
Sets the OAuth callback url. |
||
void |
setOAuthConsumerKey(java.lang.String consumerKey)
Sets the OAuth Consumer Key. |
||
void |
setOAuthConsumerSecret(java.lang.String consumerSecret)
|
||
void |
setOAuthNonce(java.lang.String oauthNonce)
Sets the OAuth nonce. |
||
void |
setOAuthSignature(java.lang.String signature)
Sets the OAuth signature used to sign the current request. |
||
void |
setOAuthSignatureMethod(java.lang.String signatureMethod)
Sets the OAuth Signature Method. |
||
void |
setOAuthTimestamp(java.lang.String timestamp)
Sets the OAuth timestamp. |
||
void |
setOAuthToken(java.lang.String token)
Sets the OAuth token. |
||
void |
setOAuthTokenSecret(java.lang.String tokenSecret)
Returns the OAuth Token Secret. |
||
void |
setOAuthType(OAuthParameters.OAuthType type)
Sets the value of the OAuth type. |
||
void |
setOAuthVerifier(java.lang.String verifier)
Returns the OAuth Verifier. |
||
void |
setRealm(java.lang.String realm)
Sets the Realm parameter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String OAUTH_CALLBACK_KEY
public static final java.lang.String OAUTH_CONSUMER_KEY
public static final java.lang.String OAUTH_CONSUMER_SECRET
public static final java.lang.String OAUTH_NONCE_KEY
public static final java.lang.String OAUTH_KEY
public static final java.lang.String OAUTH_SIGNATURE_KEY
public static final java.lang.String OAUTH_SIGNATURE_METHOD_KEY
public static final java.lang.String OAUTH_TIMESTAMP_KEY
public static final java.lang.String OAUTH_TOKEN_KEY
public static final java.lang.String OAUTH_TOKEN_SECRET_KEY
public static final java.lang.String OAUTH_VERIFIER_KEY
public static final java.lang.String REALM_KEY
public static final java.lang.String XOAUTH_REQUESTOR_ID_KEY
protected java.util.Map<java.lang.String,java.lang.String> baseParameters
protected java.util.Map<java.lang.String,java.lang.String> extraParameters
Constructor Detail |
---|
public OAuthParameters()
OAuthParameters
object. Initializes parameters
containers.
Method Detail |
---|
public java.util.Map<java.lang.String,java.lang.String> getBaseParameters()
public java.util.Map<java.lang.String,java.lang.String> getExtraParameters()
public void addCustomBaseParameter(java.lang.String key, java.lang.String value)
key
- The key used to reference this parameter. This key will also be
used to reference the value in the request url and in the http
authorization header.value
- the value of the parameterpublic void removeCustomBaseParameter(java.lang.String key)
key
- The key used to reference this parameter.public void addExtraParameter(java.lang.String key, java.lang.String value)
key
- the key used to reference this parametervalue
- the value of the parameterpublic void reset()
public java.lang.String getOAuthConsumerKey()
public void setOAuthConsumerKey(java.lang.String consumerKey)
getOAuthConsumerKey()
to learn
more about this parameter.
public boolean checkOAuthConsumerKeyExists()
getOAuthConsumerKey()
to learn more about this parameter.
public void assertOAuthConsumerKeyExists() throws OAuthException
getOAuthConsumerKey()
to learn more about this
parameter.
OAuthException
- if the OAuth Consumer Key does not existpublic java.lang.String getOAuthConsumerSecret()
public void setOAuthConsumerSecret(java.lang.String consumerSecret)
public boolean checkOAuthConsumerSecretExists()
public void assertOAuthConsumerSecretExists() throws OAuthException
OAuthException
public java.lang.String getOAuthNonce()
OAuthUtil.getNonce()
if it is not provided. This parameter is
included in the OAuth signature base string.
public void setOAuthNonce(java.lang.String oauthNonce)
getOAuthNonce()
to learn more about
this parameter.
public boolean checkOAuthNonceExists()
getOAuthNonce()
to
learn more about this parameter.
public void assertOAuthNonceExists() throws OAuthException
getOAuthNonce()
to learn more about this
parameter.
OAuthException
- if the OAuth nonce does not existpublic java.lang.String getOAuthSignature()
OAuthHelper
if it is
not provided.
public void setOAuthSignature(java.lang.String signature)
getOAuthSignature()
to learn more about this parameter.
public boolean checkOAuthSignatureExists()
getOAuthSignature()
to learn more about this parameter.
public void assertOAuthSignatureExists() throws OAuthException
getOAuthSignature()
to learn more about this
parameter.
OAuthException
- if the OAuth signature does not existpublic java.lang.String getOAuthSignatureMethod()
OAuthSigner
if it is not provided by the user. This
parameter is included in the OAuth signature base string.
public void setOAuthSignatureMethod(java.lang.String signatureMethod)
getOAuthSignatureMethod()
to
learn more about this parameter.
public boolean checkOAuthSignatureMethodExists()
getOAuthSignatureMethod()
to learn more about this parameter.
public void assertOAuthSignatureMethodExists() throws OAuthException
getOAuthSignatureMethod()
to learn more about
this parameter.
OAuthException
- if the OAuth signature method does not existpublic java.lang.String getOAuthTimestamp()
OAuthUtil.getTimestamp()
if it is not provided by
the user. This parameter is included in the OAuth signature base string.
public void setOAuthTimestamp(java.lang.String timestamp)
getOAuthTimestamp()
to learn more
about this parameter.
public boolean checkOAuthTimestampExists()
getOAuthTimestamp()
to learn more about this parameter.
public void assertOAuthTimestampExists() throws OAuthException
getOAuthTimestamp()
to learn more about this
parameter.
OAuthException
- if the OAuth timestamp does not existpublic java.lang.String getOAuthToken()
OAuthHelper
. This parameter is included in the OAuth signature
base string.
public void setOAuthToken(java.lang.String token)
getOAuthToken()
to learn more about
this parameter.
public boolean checkOAuthTokenExists()
getOAuthToken()
to
learn more about this parameter.
public void assertOAuthTokenExists() throws OAuthException
getOAuthToken()
to learn more about this
parameter.
OAuthException
- if the OAuth token does not existpublic java.lang.String getOAuthTokenSecret()
public void setOAuthTokenSecret(java.lang.String tokenSecret)
getOAuthTokenSecret()
to
learn more about this parameter.
public boolean checkOAuthTokenSecretExists()
getOAuthTokenSecret()
to learn more about this parameter.
public void assertOAuthTokenSecretExists() throws OAuthException
getOAuthTokenSecret()
to learn more about this
parameter.
OAuthException
- if the OAuth token secret does not existpublic OAuthParameters.OAuthType getOAuthType()
public void setOAuthType(OAuthParameters.OAuthType type)
public java.lang.String getOAuthVerifier()
public void setOAuthVerifier(java.lang.String verifier)
getOAuthVerifier()
to
learn more about this parameter.
public boolean checkOAuthVerifierExists()
getOAuthTokenSecret()
to learn more about this parameter.
public void assertOAuthVerifierExists() throws OAuthException
getOAuthVerifier()
to learn more about this
parameter.
OAuthException
- if the OAuth token secret does not existpublic java.lang.String getOAuthCallback()
public void setOAuthCallback(java.lang.String oauthCallback)
getOAuthCallback()
to learn more
about this parameter.
public boolean checkOAuthCallbackExists()
getOAuthCallback()
to learn more about this parameter.
public void assertOAuthCallbackExists() throws OAuthException
getOAuthCallback()
to learn more about this
parameter.
OAuthException
- if the OAuth callback does not existpublic java.lang.String getRealm()
public void setRealm(java.lang.String realm)
getRealm()
to learn more about this
parameter.
public boolean checkRealmExists()
getRealm()
to learn more
about this parameter.
public void assertRealmExists() throws OAuthException
getRealm()
to learn more about this parameter.
OAuthException
- if the realm does not existprotected java.lang.String get(java.lang.String key, java.util.Map<java.lang.String,java.lang.String> params)
key
- the key whose value to retrieveparams
- the map from which to retrieve the value from
protected void put(java.lang.String key, java.lang.String value, java.util.Map<java.lang.String,java.lang.String> params)
key
- the key to add to the mapvalue
- the value to add to the mapparams
- the map to add the values toprotected void remove(java.lang.String key, java.util.Map<java.lang.String,java.lang.String> params)
key
- the key to removeparams
- the map to remove the key fromprotected boolean checkExists(java.lang.String key, java.util.Map<java.lang.String,java.lang.String> params)
key
- the key to check for existenceparams
- the map to check for the key
protected void assertExists(java.lang.String key, java.util.Map<java.lang.String,java.lang.String> params) throws OAuthException
checkExists(java.lang.String, java.util.Map)
for more information.
key
- the key to check for existenceparams
- the map to check for the key
OAuthException
- if the value for the given key doesn't exist
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |