1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.impl.wsdl.submit.transports.http.support.methods;
14
15 import com.eviware.soapui.impl.support.AbstractHttpRequest;
16 import com.eviware.soapui.impl.wsdl.submit.transports.http.ExtendedHttpMethod;
17 import com.eviware.soapui.impl.wsdl.submit.transports.http.HttpMethodSupport;
18 import com.eviware.soapui.impl.wsdl.submit.transports.http.SSLInfo;
19 import org.apache.commons.httpclient.HttpConnection;
20 import org.apache.commons.httpclient.HttpException;
21 import org.apache.commons.httpclient.HttpState;
22 import org.apache.commons.httpclient.methods.DeleteMethod;
23 import org.apache.commons.httpclient.methods.RequestEntity;
24
25 import java.io.IOException;
26
27 /***
28 * Extended PostMethod that supports limiting of response size and detailed
29 * timestamps
30 *
31 * @author Ole.Matzura
32 */
33
34 public final class ExtendedDeleteMethod extends DeleteMethod implements ExtendedHttpMethod
35 {
36 private HttpMethodSupport httpMethodSupport;
37
38 public ExtendedDeleteMethod()
39 {
40 httpMethodSupport = new HttpMethodSupport( this );
41 }
42
43 public String getDumpFile()
44 {
45 return httpMethodSupport.getDumpFile();
46 }
47
48 public void setDumpFile(String dumpFile)
49 {
50 httpMethodSupport.setDumpFile(dumpFile);
51 }
52
53 protected void readResponse(HttpState arg0, HttpConnection arg1)
54 throws IOException, HttpException
55 {
56 super.readResponse(arg0, arg1);
57 httpMethodSupport.afterReadResponse(arg0, arg1);
58 }
59
60 public long getMaxSize()
61 {
62 return httpMethodSupport.getMaxSize();
63 }
64
65 public void setMaxSize(long maxSize)
66 {
67 httpMethodSupport.setMaxSize( maxSize );
68 }
69
70 public long getResponseReadTime()
71 {
72 return httpMethodSupport.getResponseReadTime();
73 }
74
75 protected void writeRequest(HttpState arg0, HttpConnection arg1)
76 throws IOException, HttpException
77 {
78 super.writeRequest(arg0, arg1);
79 httpMethodSupport.afterWriteRequest(arg0, arg1);
80 }
81
82 public void initStartTime()
83 {
84 httpMethodSupport.initStartTime();
85 }
86
87 public long getTimeTaken()
88 {
89 return httpMethodSupport.getTimeTaken();
90 }
91
92 public long getStartTime()
93 {
94 return httpMethodSupport.getStartTime();
95 }
96
97 public byte[] getResponseBody() throws IOException
98 {
99 return httpMethodSupport.getResponseBody();
100 }
101
102 public SSLInfo getSSLInfo()
103 {
104 return httpMethodSupport.getSSLInfo();
105 }
106
107 public String getResponseContentType()
108 {
109 return httpMethodSupport.getResponseContentType();
110 }
111
112 public RequestEntity getRequestEntity()
113 {
114
115 return null;
116 }
117
118 public AbstractHttpRequest.RequestMethod getMethod() {
119 return AbstractHttpRequest.RequestMethod.DELETE;
120 }
121
122 }