Changeset 1906 for trunk/autoquest-plugin-http/src/main/java/de
- Timestamp:
- 03/11/15 13:56:46 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/eventcore/SOAPEventType.java
r1884 r1906 65 65 /** 66 66 * <p> 67 * the name of the service; this is either the path or, if a path map is available 67 * the name of the client; this is either the host/ip and port of the sender or, if a path 68 * map is available, a human readable name that may be based also on the receiver 69 * </p> 70 */ 71 private final String clientName; 72 73 /** 74 * <p> 75 * the name of the service; this is either the path or, if a path map is available, a human 76 * readable name that is mapped to the path 68 77 * </p> 69 78 */ … … 107 116 StringBuffer nameBuffer = new StringBuffer("SOAPEvent"); 108 117 109 boolean somethingAdded = false; 110 118 // determine the client name 119 if (urlNameMap == null) { 120 clientName = exchange.getSender().getHost() + ":" + exchange.getSender().getPort(); 121 } 122 else { 123 // check for a mapping of the sender host 124 String key = "clientName.sender." + exchange.getSender().getHost(); 125 String value = urlNameMap.getProperty(key); 126 127 if (value == null) { 128 key += ":" + exchange.getSender().getPort(); 129 value = urlNameMap.getProperty(key); 130 } 131 132 if (value == null) { 133 key = "clientName.receiver." + exchange.getReceiver().getHost(); 134 value = urlNameMap.getProperty(key); 135 } 136 137 if (value == null) { 138 key += ":" + exchange.getReceiver().getPort(); 139 value = urlNameMap.getProperty(key); 140 } 141 142 if (value != null) { 143 clientName = value; 144 } 145 else { 146 clientName = exchange.getSender().getHost() + ":" + exchange.getSender().getPort(); 147 } 148 } 149 150 nameBuffer.append(clientName); 151 152 // determine the service name 111 153 if (path != null) { 112 nameBuffer.append(" (");113 if ( urlNameMap==null) {154 nameBuffer.append(", "); 155 if (urlNameMap == null) { 114 156 serviceName = path; 115 } else { 116 String value = urlNameMap.getProperty(path); 117 if( value!=null ) { 157 } 158 else { 159 String value = urlNameMap.getProperty("serviceName.path." + path); 160 if (value != null) { 118 161 serviceName = value; 119 } else { 162 } 163 else { 120 164 serviceName = path; 121 165 } 122 166 } 123 167 nameBuffer.append(serviceName); 124 somethingAdded = true;125 }else {168 } 169 else { 126 170 serviceName = "NA"; 127 171 } 128 172 129 173 if (calledMethod != null) { 130 nameBuffer.append( somethingAdded ? ", " : "(");174 nameBuffer.append(", "); 131 175 nameBuffer.append(calledMethod); 132 somethingAdded = true;133 176 } 134 177 … … 137 180 138 181 if ((senderStr != null) && (receiverStr != null)) { 139 nameBuffer.append( somethingAdded ? ", " : "(");182 nameBuffer.append(", "); 140 183 nameBuffer.append(senderStr); 141 184 nameBuffer.append(" --> "); 142 185 nameBuffer.append(receiverStr); 143 somethingAdded = true;144 186 } 145 187 else if (senderStr != null) { 146 nameBuffer.append( somethingAdded ? ", " : "(");188 nameBuffer.append(", "); 147 189 nameBuffer.append(senderStr); 148 somethingAdded = true;149 190 } 150 191 else if (receiverStr != null) { 151 nameBuffer.append( somethingAdded ? ", " : "(");192 nameBuffer.append(", "); 152 193 nameBuffer.append(receiverStr); 153 somethingAdded = true; 154 } 155 156 if (somethingAdded) { 157 nameBuffer.append(")"); 158 } 194 } 195 196 nameBuffer.append(")"); 159 197 160 198 this.name = nameBuffer.toString(); … … 170 208 public String getCalledMethod() { 171 209 return calledMethod; 210 } 211 212 /** 213 * <p> 214 * the name of the client calling in this request 215 * </p> 216 * 217 * @return the name of the client calling in this request 218 */ 219 public String getClientName() { 220 return clientName; 172 221 } 173 222 … … 229 278 super.equals(obj) && 230 279 HTTPUtils.equals(calledMethod, ((SOAPEventType) obj).calledMethod) && 231 HTTPUtils.equals(serviceName, ((SOAPEventType) obj).serviceName); 280 HTTPUtils.equals(serviceName, ((SOAPEventType) obj).serviceName) && 281 HTTPUtils.equals(clientName, ((SOAPEventType) obj).clientName); 232 282 } 233 283 else { … … 247 297 if( serviceName != null ) { 248 298 hashCode += serviceName.hashCode(); 299 } 300 if( clientName != null ) { 301 hashCode += clientName.hashCode(); 249 302 } 250 303 return hashCode;
Note: See TracChangeset
for help on using the changeset viewer.