src/java.management.rest/share/classes/com/oracle/jmx/remote/rest/http/JmxRestAdapter.java
equal
deleted
inserted
replaced
29 import java.lang.reflect.Proxy; |
29 import java.lang.reflect.Proxy; |
30 import java.net.HttpURLConnection; |
30 import java.net.HttpURLConnection; |
31 import java.security.AccessControlContext; |
31 import java.security.AccessControlContext; |
32 import java.security.AccessController; |
32 import java.security.AccessController; |
33 import java.security.PrivilegedAction; |
33 import java.security.PrivilegedAction; |
34 import java.util.Arrays; |
34 import java.util.*; |
35 import java.util.LinkedHashMap; |
|
36 import java.util.Map; |
|
37 import java.util.concurrent.ConcurrentHashMap; |
35 import java.util.concurrent.ConcurrentHashMap; |
38 |
36 |
39 /** |
37 /** |
40 * @author harsha |
38 * @author harsha |
41 */ |
39 */ |
163 throw new IllegalArgumentException("Invalid HTTP request Headers"); |
161 throw new IllegalArgumentException("Invalid HTTP request Headers"); |
164 } |
162 } |
165 } |
163 } |
166 |
164 |
167 String path = exchange.getRequestURI().getPath(); |
165 String path = exchange.getRequestURI().getPath(); |
|
166 |
168 // Route request to appropriate resource |
167 // Route request to appropriate resource |
169 if (path.matches("^\\/?jmx\\/servers\\/[a-zA-Z0-9\\\\-\\\\.]+\\/?$")) { |
168 if (path.matches("^/?jmx/servers/[a-zA-Z0-9\\-\\.]+/?$")) { |
170 RestResource.super.handle(exchange); |
169 RestResource.super.handle(exchange); |
171 } else if (path.matches("^\\/?jmx\\/servers\\/[a-zA-Z0-9\\-\\.]+\\/mbeans.*")) { |
170 } else if (path.matches("^/?jmx/servers/[a-zA-Z0-9\\-\\.]+/mbeans.*")) { |
172 mbeansRes.handle(exchange); |
171 mbeansRes.handle(exchange); |
173 // } else if (path.matches("^\\/?jmx\\/servers\\/[a-zA-Z0-9\\-\\.]+\\/mbeans\\/[^\\/]+\\/?$")) { |
|
174 // mbeansRes.handle(exchange); |
|
175 } else { |
172 } else { |
176 HttpUtil.sendResponse(exchange, new HttpResponse(404, "Not found")); |
173 HttpUtil.sendResponse(exchange, new HttpResponse(404, "Not found")); |
177 } |
174 } |
178 } |
175 } |
179 |
176 |