View Javadoc
1   /* 
2    * Licensed under the Apache License, Version 2.0 (the "License");
3    * you may not use this file except in compliance with the License.
4    * You may obtain a copy of the License at
5    *
6    * http://www.apache.org/licenses/LICENSE-2.0
7    *
8    * Unless required by applicable law or agreed to in writing, software
9    * distributed under the License is distributed on an "AS IS" BASIS,
10   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11   * See the License for the specific language governing permissions and
12   * limitations under the License.
13   *
14   */
15  
16  package org.esigate;
17  
18  import java.util.Properties;
19  
20  import org.apache.http.client.methods.CloseableHttpResponse;
21  import org.esigate.events.EventManager;
22  import org.esigate.http.ContentTypeHelper;
23  import org.esigate.http.OutgoingRequest;
24  import org.esigate.impl.DriverRequest;
25  
26  public interface RequestExecutor {
27  
28      OutgoingRequest createOutgoingRequest(DriverRequest request, String url, boolean b);
29  
30      CloseableHttpResponse execute(OutgoingRequest outgoingRequest) throws HttpErrorPage;
31  
32      interface RequestExecutorBuilder {
33  
34          RequestExecutorBuilder setEventManager(EventManager eventManager);
35  
36          RequestExecutorBuilder setDriver(Driver driver);
37  
38          RequestExecutorBuilder setProperties(Properties properties);
39  
40          RequestExecutorBuilder setContentTypeHelper(ContentTypeHelper contentTypeHelper);
41  
42          RequestExecutor build();
43  
44      }
45  
46  }