@Deprecated
  protected LinkedHashMap<RequestKey, Collection<ConfigAttribute>> buildRequestMap() {
    LinkedHashMap<RequestKey, Collection<ConfigAttribute>> requestMap = null;
    requestMap = new LinkedHashMap<RequestKey, Collection<ConfigAttribute>>();

    Map<String, String> resourceMap = this.findResources();

    for (Map.Entry<String, String> entry : resourceMap.entrySet()) {
      RequestKey key = new RequestKey(entry.getKey(), null);
      requestMap.put(key, SecurityConfig.createListFromCommaDelimitedString(entry.getValue()));
    }

    return requestMap;
  }
Example #2
0
  public void execute(
      FilterSecurityInterceptor filterSecurityInterceptor, Map<String, String> resourceMap) {
    Assert.notNull(filterSecurityInterceptor);
    Assert.notNull(resourceMap);

    logger.info("refresh url resource");

    LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = null;
    requestMap = new LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>>();

    for (Map.Entry<String, String> entry : resourceMap.entrySet()) {
      String key = entry.getKey();
      String value = entry.getValue();
      requestMap.put(
          new AntPathRequestMatcher(key), SecurityConfig.createListFromCommaDelimitedString(value));
    }

    FilterInvocationSecurityMetadataSource source =
        new DefaultFilterInvocationSecurityMetadataSource(requestMap);
    filterSecurityInterceptor.setSecurityMetadataSource(source);
  }