Codota Logo
FilterChainManager
Code IndexAdd Codota to your IDE (free)

How to use
FilterChainManager
in
org.apache.shiro.web.filter.mgt

Best Java code snippets using org.apache.shiro.web.filter.mgt.FilterChainManager (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: apache/shiro

public FilterChain getChain(ServletRequest request, ServletResponse response, FilterChain originalChain) {
  FilterChainManager filterChainManager = getFilterChainManager();
  if (!filterChainManager.hasChains()) {
    return null;
  }
  String requestURI = getPathWithinApplication(request);
  //the 'chain names' in this implementation are actually path patterns defined by the user.  We just use them
  //as the chain name for the FilterChainManager's requirements
  for (String pathPattern : filterChainManager.getChainNames()) {
    // If the path does match, then pass on to the subclass implementation for specific checks:
    if (pathMatches(pathPattern, requestURI)) {
      if (log.isTraceEnabled()) {
        log.trace("Matched path pattern [" + pathPattern + "] for requestURI [" + requestURI + "].  " +
            "Utilizing corresponding filter chain...");
      }
      return filterChainManager.proxy(originalChain, pathPattern);
    }
  }
  return null;
}
origin: apache/shiro

protected void registerFilters(Map<String, Filter> filters, FilterChainManager manager) {
  if (!CollectionUtils.isEmpty(filters)) {
    boolean init = getFilterConfig() != null; //only call filter.init if there is a FilterConfig available
    for (Map.Entry<String, Filter> entry : filters.entrySet()) {
      String name = entry.getKey();
      Filter filter = entry.getValue();
      manager.addFilter(name, filter, init);
    }
  }
}
origin: apache/shiro

  protected void createChains(Map<String, String> urls, FilterChainManager manager) {
    if (CollectionUtils.isEmpty(urls)) {
      if (log.isDebugEnabled()) {
        log.debug("No urls to process.");
      }
      return;
    }

    if (log.isTraceEnabled()) {
      log.trace("Before url processing.");
    }

    for (Map.Entry<String, String> entry : urls.entrySet()) {
      String path = entry.getKey();
      String value = entry.getValue();
      manager.createChain(path, value);
    }
  }
}
origin: theonedev/onedev

@Inject
public OneFilterChainResolver(
    Set<FilterChainConfigurator> filterChainConfigurators, 
    BasicAuthenticationFilter basicAuthenticationFilter) {
  
  super();
  
  FilterChainManager filterChainManager = getFilterChainManager();
  
  filterChainManager.addFilter("authcBasic", basicAuthenticationFilter);
  
  for (FilterChainConfigurator configurator: filterChainConfigurators) {
    configurator.configure(filterChainManager);
  }
  
  filterChainManager.createChain("/**", "authcBasic");
}

origin: apache/shiro

protected void buildChains(FilterChainManager manager, Ini ini) {
  //filters section:
  Ini.Section section = ini.getSection(FILTERS);
  if (!CollectionUtils.isEmpty(section)) {
    String msg = "The [{}] section has been deprecated and will be removed in a future release!  Please " +
        "move all object configuration (filters and all other objects) to the [{}] section.";
    log.warn(msg, FILTERS, IniSecurityManagerFactory.MAIN_SECTION_NAME);
  }
  Map<String, Object> defaults = new LinkedHashMap<String, Object>();
  Map<String, Filter> defaultFilters = manager.getFilters();
  //now let's see if there are any object defaults in addition to the filters
  //these can be used to configure the filters:
  //create a Map of objects to use as the defaults:
  if (!CollectionUtils.isEmpty(defaultFilters)) {
    defaults.putAll(defaultFilters);
  }
  //User-provided objects must come _after_ the default filters - to allow the user-provided
  //ones to override the default filters if necessary.
  Map<String, ?> defaultBeans = getDefaults();
  if (!CollectionUtils.isEmpty(defaultBeans)) {
    defaults.putAll(defaultBeans);
  }
  Map<String, Filter> filters = getFilters(section, defaults);
  //add the filters to the manager:
  registerFilters(filters, manager);
  //urls section:
  section = ini.getSection(URLS);
  createChains(section, manager);
}
origin: be.c4j.ee.security.octopus/octopus-core

  public FilterChain getChain(ServletRequest request, ServletResponse response, FilterChain originalChain) {
    FilterChainManager filterChainManager = getFilterChainManager();
    if (!filterChainManager.hasChains()) {
      return null;
    }

    String requestURI = getPathWithinApplication(request);

    //the 'chain names' in this implementation are actually path patterns defined by the user.  We just use them
    //as the chain name for the FilterChainManager's requirements
    for (String pathPattern : filterChainManager.getChainNames()) {

      // If the path does match, then pass on to the subclass implementation for specific checks:
      if (pathMatches(pathPattern, requestURI)) {
        if (log.isTraceEnabled()) {
          log.trace("Matched path pattern [" + pathPattern + "] for requestURI [" + requestURI + "].  " +
              "Utilizing corresponding filter chain...");
        }

        // This is the only change we have made in this method.
        request.setAttribute(OCTOPUS_CHAIN_NAME, pathPattern);
        return filterChainManager.proxy(originalChain, pathPattern);
      }
    }

    return null;
  }
}
origin: tomsun28/bootshiro

@Override
public FilterChain getChain(ServletRequest request, ServletResponse response, FilterChain originalChain) {
  FilterChainManager filterChainManager = this.getFilterChainManager();
  if (!filterChainManager.hasChains()) {
    return null;
  } else {
    String requestURI = this.getPathWithinApplication(request);
    Iterator var6 = filterChainManager.getChainNames().iterator();
    return filterChainManager.proxy(originalChain, pathPattern);
org.apache.shiro.web.filter.mgtFilterChainManager

Javadoc

A FilterChainManager manages the creation and modification of Filter chains from an available pool of Filter instances.

Most used methods

  • getChainNames
  • hasChains
  • proxy
  • addFilter
    Adds a filter to the 'pool' of available filters that can be used when #addToChain(String,String,Str
  • createChain
    Creates a filter chain for the given chainName with the specified chainDefinitionString.CONVENTIONAL
  • getFilters
    Returns the pool of available Filters managed by this manager, keyed by name.

Popular in Java

  • Making http post requests using okhttp
  • getExternalFilesDir (Context)
  • orElseThrow (Optional)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Join (org.hibernate.mapping)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now