1 16 17 package org.springframework.web.context.support; 18 19 28 public class ServletRequestHandledEvent extends RequestHandledEvent { 29 30 31 private final String requestUrl; 32 33 34 private final String clientAddress; 35 36 37 private final String method; 38 39 40 private final String servletName; 41 42 43 55 public ServletRequestHandledEvent(Object source, String requestUrl, 56 String clientAddress, String method, String servletName, 57 String sessionId, String userName, long processingTimeMillis) { 58 59 super(source, sessionId, userName, processingTimeMillis); 60 this.requestUrl = requestUrl; 61 this.clientAddress = clientAddress; 62 this.method = method; 63 this.servletName = servletName; 64 } 65 66 79 public ServletRequestHandledEvent(Object source, String requestUrl, 80 String clientAddress, String method, String servletName, String sessionId, 81 String userName, long processingTimeMillis, Throwable failureCause) { 82 83 super(source, sessionId, userName, processingTimeMillis, failureCause); 84 this.requestUrl = requestUrl; 85 this.clientAddress = clientAddress; 86 this.method = method; 87 this.servletName = servletName; 88 } 89 90 91 94 public String getRequestUrl() { 95 return requestUrl; 96 } 97 98 101 public String getClientAddress() { 102 return clientAddress; 103 } 104 105 108 public String getMethod() { 109 return method; 110 } 111 112 115 public String getServletName() { 116 return servletName; 117 } 118 119 120 public String getShortDescription() { 121 StringBuffer sb = new StringBuffer (); 122 sb.append("url=[").append(getRequestUrl()).append("]; "); 123 sb.append("client=[").append(getClientAddress()).append("]; "); 124 sb.append(super.getShortDescription()); 125 return sb.toString(); 126 } 127 128 public String getDescription() { 129 StringBuffer sb = new StringBuffer (); 130 sb.append("url=[").append(getRequestUrl()).append("]; "); 131 sb.append("client=[").append(getClientAddress()).append("]; "); 132 sb.append("method=[").append(getMethod()).append("]; "); 133 sb.append("servlet=[").append(getServletName()).append("]; "); 134 sb.append(super.getDescription()); 135 return sb.toString(); 136 } 137 138 public String toString() { 139 return ("ServletRequestHandledEvent: " + getDescription()); 140 } 141 142 } 143 | Popular Tags |