|
8 | 8 | /** |
9 | 9 | * Default implementation of the OAuth protocol, version 1.0a |
10 | 10 | * |
11 | | - * This class is meant to be extended by concrete implementations of the API. |
| 11 | + * This class is meant to be extended by concrete implementations of the API, |
| 12 | + * providing the endpoints and endpoint-http-verbs. |
| 13 | + * |
12 | 14 | * If your Api adheres to the 1.0a protocol correctly, you just need to extend |
13 | 15 | * this class and define the getters for your endpoints. |
14 | 16 | * |
| 17 | + * If your Api does something a bit different, you can override the different |
| 18 | + * extractors or services, in order to fine-tune the process. Please read the |
| 19 | + * javadocs of the interfaces to get an idea of what to do. |
| 20 | + * |
15 | 21 | * @author Pablo Fernandez |
16 | 22 | * |
17 | 23 | */ |
18 | 24 | public abstract class DefaultApi10a implements Api |
19 | 25 | { |
20 | | - |
| 26 | + /** |
| 27 | + * Returns the access token extractor. |
| 28 | + * |
| 29 | + * @return access token extractor |
| 30 | + */ |
21 | 31 | public AccessTokenExtractor getAccessTokenExtractor() |
22 | 32 | { |
23 | 33 | return new TokenExtractorImpl(); |
24 | 34 | } |
25 | 35 |
|
| 36 | + /** |
| 37 | + * Returns the base string extractor. |
| 38 | + * |
| 39 | + * @return base string extractor |
| 40 | + */ |
26 | 41 | public BaseStringExtractor getBaseStringExtractor() |
27 | 42 | { |
28 | 43 | return new BaseStringExtractorImpl(); |
29 | 44 | } |
30 | 45 |
|
| 46 | + /** |
| 47 | + * Returns the header extractor. |
| 48 | + * |
| 49 | + * @return header extractor |
| 50 | + */ |
31 | 51 | public HeaderExtractor getHeaderExtractor() |
32 | 52 | { |
33 | 53 | return new HeaderExtractorImpl(); |
34 | 54 | } |
35 | 55 |
|
| 56 | + /** |
| 57 | + * Returns the request token extractor. |
| 58 | + * |
| 59 | + * @return request token extractor |
| 60 | + */ |
36 | 61 | public RequestTokenExtractor getRequestTokenExtractor() |
37 | 62 | { |
38 | 63 | return new TokenExtractorImpl(); |
39 | 64 | } |
40 | 65 |
|
| 66 | + /** |
| 67 | + * Returns the signature service. |
| 68 | + * |
| 69 | + * @return signature service |
| 70 | + */ |
41 | 71 | public SignatureService getSignatureService() |
42 | 72 | { |
43 | 73 | return new HMACSha1SignatureService(); |
44 | 74 | } |
45 | 75 |
|
| 76 | + /** |
| 77 | + * Returns the timestamp service. |
| 78 | + * |
| 79 | + * @return timestamp service |
| 80 | + */ |
46 | 81 | public TimestampService getTimestampService() |
47 | 82 | { |
48 | 83 | return new TimestampServiceImpl(); |
49 | 84 | } |
50 | 85 |
|
| 86 | + /** |
| 87 | + * Returns the verb for the access token endpoint (defaults to POST) |
| 88 | + * |
| 89 | + * @return access token endpoint verb |
| 90 | + */ |
51 | 91 | public Verb getAccessTokenVerb() |
52 | 92 | { |
53 | 93 | return Verb.POST; |
54 | 94 | } |
55 | 95 |
|
| 96 | + /** |
| 97 | + * Returns the verb for the request token endpoint (defaults to POST) |
| 98 | + * |
| 99 | + * @return request token endpoint verb |
| 100 | + */ |
56 | 101 | public Verb getRequestTokenVerb() |
57 | 102 | { |
58 | 103 | return Verb.POST; |
|
0 commit comments