source: josm/trunk/src/oauth/signpost/OAuthProviderListener.java@ 4231

Last change on this file since 4231 was 4231, checked in by stoecker, 13 years ago

add signpost and metadata extractor code to repository directly

File size: 1.5 KB
Line 
1package oauth.signpost;
2
3import oauth.signpost.http.HttpRequest;
4import oauth.signpost.http.HttpResponse;
5
6/**
7 * Provides hooks into the token request handling procedure executed by
8 * {@link OAuthProvider}.
9 *
10 * @author Matthias Kaeppler
11 */
12public interface OAuthProviderListener {
13
14 /**
15 * Called after the request has been created and default headers added, but
16 * before the request has been signed.
17 *
18 * @param request
19 * the request to be sent
20 * @throws Exception
21 */
22 void prepareRequest(HttpRequest request) throws Exception;
23
24 /**
25 * Called after the request has been signed, but before it's being sent.
26 *
27 * @param request
28 * the request to be sent
29 * @throws Exception
30 */
31 void prepareSubmission(HttpRequest request) throws Exception;
32
33 /**
34 * Called when the server response has been received. You can implement this
35 * to manually handle the response data.
36 *
37 * @param request
38 * the request that was sent
39 * @param response
40 * the response that was received
41 * @return returning true means you have handled the response, and the
42 * provider will return immediately. Return false to let the event
43 * propagate and let the provider execute its default response
44 * handling.
45 * @throws Exception
46 */
47 boolean onResponseReceived(HttpRequest request, HttpResponse response) throws Exception;
48}
Note: See TracBrowser for help on using the repository browser.