• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2007 Netflix, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package net.oauth;
18 
19 import java.io.Serializable;
20 import java.util.HashMap;
21 import java.util.Map;
22 import net.oauth.http.HttpMessage;
23 
24 /**
25  * Properties of an OAuth Consumer. Properties may be added freely, e.g. to
26  * support extensions.
27  *
28  * @author John Kristian
29  * @hide
30  */
31 public class OAuthConsumer implements Serializable {
32 
33     private static final long serialVersionUID = -2258581186977818580L;
34 
35     public final String callbackURL;
36     public final String consumerKey;
37     public final String consumerSecret;
38     public final OAuthServiceProvider serviceProvider;
39 
OAuthConsumer(String callbackURL, String consumerKey, String consumerSecret, OAuthServiceProvider serviceProvider)40     public OAuthConsumer(String callbackURL, String consumerKey,
41             String consumerSecret, OAuthServiceProvider serviceProvider) {
42         this.callbackURL = callbackURL;
43         this.consumerKey = consumerKey;
44         this.consumerSecret = consumerSecret;
45         this.serviceProvider = serviceProvider;
46     }
47 
48     private final Map<String, Object> properties = new HashMap<String, Object>();
49 
getProperty(String name)50     public Object getProperty(String name) {
51         return properties.get(name);
52     }
53 
setProperty(String name, Object value)54     public void setProperty(String name, Object value) {
55         properties.put(name, value);
56     }
57 
58     /**
59      * The name of the property whose value is the Accept-Encoding header in
60      * HTTP requests.
61      */
62     public static final String ACCEPT_ENCODING = "HTTP.header." + HttpMessage.ACCEPT_ENCODING;
63 
64     /**
65      * The name of the property whose value is the <a
66      * href="http://oauth.pbwiki.com/AccessorSecret">Accessor Secret</a>.
67      */
68     public static final String ACCESSOR_SECRET = "oauth_accessor_secret";
69 
70 }
71