org.apache.hadoop.http.HttpServer.defineFilter()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(11.1k)|赞(0)|评价(0)|浏览(181)

本文整理了Java中org.apache.hadoop.http.HttpServer.defineFilter()方法的一些代码示例,展示了HttpServer.defineFilter()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpServer.defineFilter()方法的具体详情如下:
包路径:org.apache.hadoop.http.HttpServer
类名称:HttpServer
方法名:defineFilter

HttpServer.defineFilter介绍

[英]Define a filter for a context and set up default url mappings.
[中]为上下文定义筛选器并设置默认url映射。

代码示例

代码示例来源:origin: io.hops/hadoop-common

@Override
public void addGlobalFilter(String name, String classname,
  Map<String, String> parameters) {
 final String[] ALL_URLS = { "/*" };
 defineFilter(webAppContext, name, classname, parameters, ALL_URLS);
 for (Context ctx : defaultContexts.keySet()) {
  defineFilter(ctx, name, classname, parameters, ALL_URLS);
 }
 LOG.info("Added global filter '" + name + "' (class=" + classname + ")");
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

@SuppressWarnings("unchecked")
private void addNoCacheFilter(WebAppContext ctxt) {
 defineFilter(ctxt, NO_CACHE_FILTER,
  NoCacheFilter.class.getName(), Collections.EMPTY_MAP, new String[] { "/*"});
}

代码示例来源:origin: io.hops/hadoop-common

@SuppressWarnings("unchecked")
private void addNoCacheFilter(WebAppContext ctxt) {
 defineFilter(ctxt, NO_CACHE_FILTER,
  NoCacheFilter.class.getName(), Collections.EMPTY_MAP, new String[] { "/*"});
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

@SuppressWarnings("unchecked")
private void addNoCacheFilter(WebAppContext ctxt) {
 defineFilter(ctxt, NO_CACHE_FILTER,
  NoCacheFilter.class.getName(), Collections.EMPTY_MAP, new String[] { "/*"});
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

@Override
public void addGlobalFilter(String name, String classname,
  Map<String, String> parameters) {
 final String[] ALL_URLS = { "/*" };
 defineFilter(webAppContext, name, classname, parameters, ALL_URLS);
 for (Context ctx : defaultContexts.keySet()) {
  defineFilter(ctx, name, classname, parameters, ALL_URLS);
 }
 LOG.info("Added global filter '" + name + "' (class=" + classname + ")");
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

@Override
public void addGlobalFilter(String name, String classname,
  Map<String, String> parameters) {
 final String[] ALL_URLS = { "/*" };
 defineFilter(webAppContext, name, classname, parameters, ALL_URLS);
 for (Context ctx : defaultContexts.keySet()) {
  defineFilter(ctx, name, classname, parameters, ALL_URLS);
 }
 LOG.info("Added global filter '" + name + "' (class=" + classname + ")");
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

/** {@inheritDoc} */
public void addGlobalFilter(String name, String classname,
  Map<String, String> parameters) {
 final String[] ALL_URLS = { "/*" };
 defineFilter(webAppContext, name, classname, parameters, ALL_URLS);
 for (Context ctx : defaultContexts.keySet()) {
  defineFilter(ctx, name, classname, parameters, ALL_URLS);
 }
 LOG.info("Added global filter" + name + " (class=" + classname + ")");
}

代码示例来源:origin: io.fabric8/fabric-hadoop

/** {@inheritDoc} */
public void addGlobalFilter(String name, String classname,
  Map<String, String> parameters) {
 final String[] ALL_URLS = { "/*" };
 defineFilter(webAppContext, name, classname, parameters, ALL_URLS);
 for (Context ctx : defaultContexts.keySet()) {
  defineFilter(ctx, name, classname, parameters, ALL_URLS);
 }
 LOG.info("Added global filter" + name + " (class=" + classname + ")");
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

@SuppressWarnings("unchecked")
private void addNoCacheFilter(WebAppContext ctxt) {
 defineFilter(ctxt, NO_CACHE_FILTER,
  NoCacheFilter.class.getName(), Collections.EMPTY_MAP, new String[] { "/*"});
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

@Override
public void addGlobalFilter(String name, String classname,
  Map<String, String> parameters) {
 final String[] ALL_URLS = { "/*" };
 defineFilter(webAppContext, name, classname, parameters, ALL_URLS);
 for (Context ctx : defaultContexts.keySet()) {
  defineFilter(ctx, name, classname, parameters, ALL_URLS);
 }
 LOG.info("Added global filter '" + name + "' (class=" + classname + ")");
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

/** {@inheritDoc} */
public void addFilter(String name, String classname,
  Map<String, String> parameters) {
 final String[] USER_FACING_URLS = { "*.html", "*.jsp" };
 defineFilter(webAppContext, name, classname, parameters, USER_FACING_URLS);
 final String[] ALL_URLS = { "/*" };
 for (Map.Entry<Context, Boolean> e : defaultContexts.entrySet()) {
  if (e.getValue()) {
   Context ctx = e.getKey();
   defineFilter(ctx, name, classname, parameters, ALL_URLS);
   LOG.info("Added filter " + name + " (class=" + classname
     + ") to context " + ctx.getDisplayName());
  }
 }
 filterNames.add(name);
}

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

/** {@inheritDoc} */
public void addFilter(String name, String classname,
  Map<String, String> parameters) {
 final String[] USER_FACING_URLS = {"*.html", "*.jsp"};
 defineFilter(webAppContext, name, classname, parameters, USER_FACING_URLS);
 final String[] ALL_URLS = { "/*" };
 for (Map.Entry<WebApplicationContext, Boolean> e : defaultContexts
   .entrySet()) {
  if (e.getValue()) {
   WebApplicationContext ctx = e.getKey();
   defineFilter(ctx, name, classname, parameters, ALL_URLS);
   LOG.info("Added filter " + name + " (class=" + classname
     + ") to context " + ctx.getName());
  }
 }
 filterNames.add(name);
}

代码示例来源:origin: io.hops/hadoop-common

protected void initSpnego(Configuration conf,
  String usernameConfKey, String keytabConfKey) throws IOException {
 Map<String, String> params = new HashMap<String, String>();
 String principalInConf = conf.get(usernameConfKey);
 if (principalInConf != null && !principalInConf.isEmpty()) {
  params.put("kerberos.principal",
        SecurityUtil.getServerPrincipal(principalInConf, listener.getHost()));
 }
 String httpKeytab = conf.get(keytabConfKey);
 if (httpKeytab != null && !httpKeytab.isEmpty()) {
  params.put("kerberos.keytab", httpKeytab);
 }
 params.put(AuthenticationFilter.AUTH_TYPE, "kerberos");

 defineFilter(webAppContext, SPNEGO_FILTER,
        AuthenticationFilter.class.getName(), params, null);
}

代码示例来源:origin: io.hops/hadoop-common

@Override
public void addFilter(String name, String classname,
  Map<String, String> parameters) {
 final String[] USER_FACING_URLS = { "*.html", "*.jsp" };
 defineFilter(webAppContext, name, classname, parameters, USER_FACING_URLS);
 LOG.info("Added filter " + name + " (class=" + classname
   + ") to context " + webAppContext.getDisplayName());
 final String[] ALL_URLS = { "/*" };
 for (Map.Entry<Context, Boolean> e : defaultContexts.entrySet()) {
  if (e.getValue()) {
   Context ctx = e.getKey();
   defineFilter(ctx, name, classname, parameters, ALL_URLS);
   LOG.info("Added filter " + name + " (class=" + classname
     + ") to context " + ctx.getDisplayName());
  }
 }
 filterNames.add(name);
}

代码示例来源:origin: io.fabric8/fabric-hadoop

/** {@inheritDoc} */
public void addFilter(String name, String classname,
  Map<String, String> parameters) {
 final String[] USER_FACING_URLS = { "*.html", "*.jsp" };
 defineFilter(webAppContext, name, classname, parameters, USER_FACING_URLS);
 LOG.info("Added filter " + name + " (class=" + classname
   + ") to context " + webAppContext.getDisplayName());
 final String[] ALL_URLS = { "/*" };
 for (Map.Entry<Context, Boolean> e : defaultContexts.entrySet()) {
  if (e.getValue()) {
   Context ctx = e.getKey();
   defineFilter(ctx, name, classname, parameters, ALL_URLS);
   LOG.info("Added filter " + name + " (class=" + classname
     + ") to context " + ctx.getDisplayName());
  }
 }
 filterNames.add(name);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

@Override
public void addFilter(String name, String classname,
  Map<String, String> parameters) {
 final String[] USER_FACING_URLS = { "*.html", "*.jsp" };
 defineFilter(webAppContext, name, classname, parameters, USER_FACING_URLS);
 LOG.info("Added filter " + name + " (class=" + classname
   + ") to context " + webAppContext.getDisplayName());
 final String[] ALL_URLS = { "/*" };
 for (Map.Entry<Context, Boolean> e : defaultContexts.entrySet()) {
  if (e.getValue()) {
   Context ctx = e.getKey();
   defineFilter(ctx, name, classname, parameters, ALL_URLS);
   LOG.info("Added filter " + name + " (class=" + classname
     + ") to context " + ctx.getDisplayName());
  }
 }
 filterNames.add(name);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

protected void initSpnego(Configuration conf,
  String usernameConfKey, String keytabConfKey) throws IOException {
 Map<String, String> params = new HashMap<String, String>();
 String principalInConf = conf.get(usernameConfKey);
 if (principalInConf != null && !principalInConf.isEmpty()) {
  params.put("kerberos.principal",
        SecurityUtil.getServerPrincipal(principalInConf, listener.getHost()));
 }
 String httpKeytab = conf.get(keytabConfKey);
 if (httpKeytab != null && !httpKeytab.isEmpty()) {
  params.put("kerberos.keytab", httpKeytab);
 }
 params.put(AuthenticationFilter.AUTH_TYPE, "kerberos");

 defineFilter(webAppContext, SPNEGO_FILTER,
        AuthenticationFilter.class.getName(), params, null);
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

protected void initSpnego(Configuration conf,
  String usernameConfKey, String keytabConfKey) throws IOException {
 Map<String, String> params = new HashMap<String, String>();
 String principalInConf = conf.get(usernameConfKey);
 if (principalInConf != null && !principalInConf.isEmpty()) {
  params.put("kerberos.principal",
        SecurityUtil.getServerPrincipal(principalInConf, listener.getHost()));
 }
 String httpKeytab = conf.get(keytabConfKey);
 if (httpKeytab != null && !httpKeytab.isEmpty()) {
  params.put("kerberos.keytab", httpKeytab);
 }
 params.put(AuthenticationFilter.AUTH_TYPE, "kerberos");

 defineFilter(webAppContext, SPNEGO_FILTER,
        AuthenticationFilter.class.getName(), params, null);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

protected void initSpnego(Configuration conf,
  String usernameConfKey, String keytabConfKey) throws IOException {
 Map<String, String> params = new HashMap<String, String>();
 String principalInConf = conf.get(usernameConfKey);
 if (principalInConf != null && !principalInConf.isEmpty()) {
  params.put("kerberos.principal",
        SecurityUtil.getServerPrincipal(principalInConf, listener.getHost()));
 }
 String httpKeytab = conf.get(keytabConfKey);
 if (httpKeytab != null && !httpKeytab.isEmpty()) {
  params.put("kerberos.keytab", httpKeytab);
 }
 params.put(AuthenticationFilter.AUTH_TYPE, "kerberos");

 defineFilter(webAppContext, SPNEGO_FILTER,
        AuthenticationFilter.class.getName(), params, null);
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

@Override
public void addFilter(String name, String classname,
  Map<String, String> parameters) {
 final String[] USER_FACING_URLS = { "*.html", "*.jsp" };
 defineFilter(webAppContext, name, classname, parameters, USER_FACING_URLS);
 LOG.info("Added filter " + name + " (class=" + classname
   + ") to context " + webAppContext.getDisplayName());
 final String[] ALL_URLS = { "/*" };
 for (Map.Entry<Context, Boolean> e : defaultContexts.entrySet()) {
  if (e.getValue()) {
   Context ctx = e.getKey();
   defineFilter(ctx, name, classname, parameters, ALL_URLS);
   LOG.info("Added filter " + name + " (class=" + classname
     + ") to context " + ctx.getDisplayName());
  }
 }
 filterNames.add(name);
}

相关文章