|
| 1 | +/* |
| 2 | + Android Asynchronous Http Client |
| 3 | + Copyright (c) 2011 James Smith <[email protected]> |
| 4 | + http://loopj.com |
| 5 | +
|
| 6 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | + you may not use this file except in compliance with the License. |
| 8 | + You may obtain a copy of the License at |
| 9 | +
|
| 10 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +
|
| 12 | + Unless required by applicable law or agreed to in writing, software |
| 13 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + See the License for the specific language governing permissions and |
| 16 | + limitations under the License. |
| 17 | +*/ |
| 18 | + |
| 19 | +package com.loopj.android.http; |
| 20 | + |
| 21 | +import org.apache.http.HttpRequest; |
| 22 | +import org.apache.http.HttpResponse; |
| 23 | + |
| 24 | +/** |
| 25 | + * This interface is used to define pre- and post-processing handlers for every |
| 26 | + * request, and response, passing through the library. |
| 27 | + * |
| 28 | + * @author Noor Dawod <[email protected]> |
| 29 | + */ |
| 30 | +public interface PreProcessingInterface { |
| 31 | + |
| 32 | + /** |
| 33 | + * This method is called right before the passed request is processed by |
| 34 | + * the executor service. This is only called once regardless if the request is |
| 35 | + * successful or not. |
| 36 | + * |
| 37 | + * @param request The request that's about to be processed by the executor |
| 38 | + */ |
| 39 | + void onPreProcessRequest(final HttpRequest request); |
| 40 | + |
| 41 | + /** |
| 42 | + * This method is called right before {@link ResponseHandlerInterface} methods |
| 43 | + * are called in order to process success or failure requests. This is only |
| 44 | + * called once for processing. |
| 45 | + * |
| 46 | + * @param response The response that's about to be processed by {@link ResponseHandlerInterface} handler |
| 47 | + */ |
| 48 | + void onPreProcessResponse(final HttpResponse response); |
| 49 | +} |
0 commit comments