1 package com.eviware.soapui.model.support;
2
3 import com.eviware.soapui.model.iface.Attachment;
4 import com.eviware.soapui.model.iface.Request;
5 import com.eviware.soapui.model.iface.Response;
6 import com.eviware.soapui.support.types.StringToStringMap;
7 import com.eviware.soapui.support.types.StringToStringsMap;
8
9 public abstract class AbstractResponse<T extends Request> implements Response
10 {
11 private StringToStringMap properties = new StringToStringMap();
12 private final T request;
13
14 public AbstractResponse( T request )
15 {
16 this.request = request;
17 }
18
19 public Attachment[] getAttachments()
20 {
21 return null;
22 }
23
24 public Attachment[] getAttachmentsForPart( String partName )
25 {
26 return null;
27 }
28
29 public long getContentLength()
30 {
31 return getContentAsString().length();
32 }
33
34 public String getProperty( String name )
35 {
36 return properties.get( name );
37 }
38
39 public String[] getPropertyNames()
40 {
41 return properties.getKeys();
42 }
43
44 public byte[] getRawRequestData()
45 {
46 return null;
47 }
48
49 public byte[] getRawResponseData()
50 {
51 return null;
52 }
53
54 public T getRequest()
55 {
56 return request;
57 }
58
59 public String getContentAsXml()
60 {
61 return getContentAsString();
62 }
63
64 public StringToStringsMap getRequestHeaders()
65 {
66 return null;
67 }
68
69 public StringToStringsMap getResponseHeaders()
70 {
71 return null;
72 }
73
74 public void setProperty( String name, String value )
75 {
76 properties.put( name, value );
77 }
78 }