- Timestamp:
- 07/29/14 10:29:27 (10 years ago)
- Location:
- trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/HTTPLogParser.java
r1599 r1622 19 19 import java.io.FileInputStream; 20 20 import java.io.FileNotFoundException; 21 import java.io.IOException; 21 22 import java.io.InputStream; 22 23 import java.util.Collection; 23 24 import java.util.LinkedList; 24 25 import java.util.List; 26 import java.util.Properties; 25 27 import java.util.logging.Level; 26 28 … … 69 71 */ 70 72 private MessageFactory soapMessageFactory; 73 74 /** 75 * <p> 76 * properties used to map the path of a service to its logical name 77 * </p> 78 */ 79 private Properties urlNameMap = null; 80 81 /** 82 * <p> 83 * Constructor. Creates a new HTTPLogParser without a urlNameMap. 84 * </p> 85 */ 86 public HTTPLogParser() { 87 88 } 89 90 /** 91 * <p> 92 * Constructor. Creates a new HTTPLogParser with a urlNameMap 93 * </p> 94 * 95 * @param urlNameMapFile properties file with the path to logical name map 96 * @throws IOException 97 * @throws 98 */ 99 public HTTPLogParser(File urlNameMapFile) throws IOException { 100 super(); 101 urlNameMap = new Properties(); 102 urlNameMap.load(new FileInputStream(urlNameMapFile)); 103 } 71 104 72 105 /** … … 171 204 172 205 if (soapRequest != null) { 173 return new SOAPEventType(exchange, soapRequest, soapResponse );206 return new SOAPEventType(exchange, soapRequest, soapResponse, urlNameMap); 174 207 } 175 208 else { -
trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/eventcore/SOAPEventType.java
r1600 r1622 17 17 import java.net.MalformedURLException; 18 18 import java.net.URL; 19 import java.util.Properties; 19 20 import java.util.logging.Level; 20 21 … … 64 65 /** 65 66 * <p> 67 * the name of the service; this is either the path or, if a path map is available 68 */ 69 private String serviceName; 70 71 /** 72 * <p> 66 73 * the human readable name of this event type 67 74 * </p> … … 78 85 * @param soapRequest the already extracted SOAP request 79 86 * @param soapResponse the already extracted SOAP response 80 */ 81 public SOAPEventType(HttpExchange exchange, SOAPMessage soapRequest, SOAPMessage soapResponse) { 87 * @param urlNameMap used to map paths of servives to logical names 88 */ 89 public SOAPEventType(HttpExchange exchange, SOAPMessage soapRequest, SOAPMessage soapResponse, Properties urlNameMap) { 82 90 super(exchange); 83 91 this.soapRequest = soapRequest; … … 102 110 if (path != null) { 103 111 nameBuffer.append("("); 104 nameBuffer.append(path); 105 somethingAdded = true; 112 if( urlNameMap==null ) { 113 serviceName = path; 114 } else { 115 String value = urlNameMap.getProperty(path); 116 if( value!=null ) { 117 serviceName = value; 118 } else { 119 serviceName = path; 120 } 121 } 122 nameBuffer.append(serviceName); 123 somethingAdded = true; 124 } else { 125 serviceName = "NA"; 106 126 } 107 127 … … 149 169 public String getCalledMethod() { 150 170 return calledMethod; 171 } 172 173 /** 174 * <p> 175 * the name of the service called in this request 176 * </p> 177 * 178 * @return the name of the service called in this request 179 */ 180 public String getServiceName() { 181 return serviceName; 151 182 } 152 183
Note: See TracChangeset
for help on using the changeset viewer.