private LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> buildRequestMap313() { LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>>(); ResourceMapping resourceMapping = new ResourceMapping(getDataSource(), resourceQuery); for (Resource resource : (List<Resource>) resourceMapping.execute()) { String url = resource.getUrl(); String role = resource.getRole(); RequestMatcher key = resource.getMatchType().equalsIgnoreCase("ant") ? new AntPathRequestMatcher(url) : new RegexRequestMatcher(url, null); if (requestMap.containsKey(key)) { requestMap.get(key).add(new SecurityConfig(role.trim())); } else { requestMap.put(key, SecurityConfig.createList(role)); } } System.out.println("SecurityMetadataSource resourceQuery : " + resourceQuery); System.out.println("SecurityMetadataSource resourceMapping : " + resourceMapping); return requestMap; }
@Deprecated protected Map<String, String> findResources() { ResourceMapping resourceMapping = new ResourceMapping(getDataSource(), resourceQuery); Map<String, String> resourceMap = new LinkedHashMap<String, String>(); for (Resource resource : (List<Resource>) resourceMapping.execute()) { String url = resource.getUrl(); String role = resource.getRole(); if (resourceMap.containsKey(url)) { String value = resourceMap.get(url); resourceMap.put(url, value + "," + role); } else { resourceMap.put(url, role); } } return resourceMap; }
@Deprecated private LinkedHashMap<RequestKey, Collection<ConfigAttribute>> buildRequestMap301() { LinkedHashMap<RequestKey, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<RequestKey, Collection<ConfigAttribute>>(); ResourceMapping resourceMapping = new ResourceMapping(getDataSource(), resourceQuery); for (Resource resource : (List<Resource>) resourceMapping.execute()) { String url = resource.getUrl(); String role = resource.getRole(); RequestKey key = new RequestKey(url, null); if (requestMap.containsKey(key)) { requestMap.get(key).add(new SecurityConfig(role.trim())); } else { requestMap.put(new RequestKey(url, null), SecurityConfig.createList(role)); } } return requestMap; }