javax.security.sasl.Sasl.getSaslClientFactories()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(135)

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

Sasl.getSaslClientFactories介绍

暂无

代码示例

代码示例来源:origin: org.tmatesoft.svnkit/svnkit

private static SaslClientFactory getSaslClientFactory(String mechName, Map props) {
  if (mechName == null) {
    return null;
  }
  if ("ANONYMOUS".equals(mechName)) {
    mechName = "PLAIN";
  }
  for(Enumeration factories = Sasl.getSaslClientFactories(); factories.hasMoreElements();) {
    SaslClientFactory factory = (SaslClientFactory) factories.nextElement();
    String[] mechs = factory.getMechanismNames(props);
    for (int i = 0; mechs != null && i < mechs.length; i++) {
      if (mechName.endsWith(mechs[i])) {
        return factory; 
      }
    }
  }
  return null;
}

代码示例来源:origin: org.jvnet.hudson.svnkit/svnkit

private static SaslClientFactory getSaslClientFactory(String mechName, Map props) {
  if (mechName == null) {
    return null;
  }
  if ("ANONYMOUS".equals(mechName)) {
    mechName = "PLAIN";
  }
  for(Enumeration factories = Sasl.getSaslClientFactories(); factories.hasMoreElements();) {
    SaslClientFactory factory = (SaslClientFactory) factories.nextElement();
    String[] mechs = factory.getMechanismNames(props);
    for (int i = 0; mechs != null && i < mechs.length; i++) {
      if (mechName.endsWith(mechs[i])) {
        return factory; 
      }
    }
  }
  return null;
}

代码示例来源:origin: com.svnkit/com.springsource.org.tigris.subversion.javahl

private static SaslClientFactory getSaslClientFactory(String mechName, Map props) {
  if (mechName == null) {
    return null;
  }
  if ("ANONYMOUS".equals(mechName)) {
    mechName = "PLAIN";
  }
  for(Enumeration factories = Sasl.getSaslClientFactories(); factories.hasMoreElements();) {
    SaslClientFactory factory = (SaslClientFactory) factories.nextElement();
    String[] mechs = factory.getMechanismNames(props);
    for (int i = 0; mechs != null && i < mechs.length; i++) {
      if (mechName.endsWith(mechs[i])) {
        return factory; 
      }
    }
  }
  return null;
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-svnkit

private static SaslClientFactory getSaslClientFactory(String mechName, Map props) {
  if (mechName == null) {
    return null;
  }
  if ("ANONYMOUS".equals(mechName)) {
    mechName = "PLAIN";
  }
  for(Enumeration factories = Sasl.getSaslClientFactories(); factories.hasMoreElements();) {
    SaslClientFactory factory = (SaslClientFactory) factories.nextElement();
    String[] mechs = factory.getMechanismNames(props);
    for (int i = 0; mechs != null && i < mechs.length; i++) {
      if (mechName.endsWith(mechs[i])) {
        return factory; 
      }
    }
  }
  return null;
}

代码示例来源:origin: org.apache.drill.exec/drill-java-exec

private void refresh() {
 final Enumeration<SaslClientFactory> factories = Sasl.getSaslClientFactories();
 final Map<String, List<SaslClientFactory>> map = Maps.newHashMap();
 while (factories.hasMoreElements()) {
  final SaslClientFactory factory = factories.nextElement();
  // Passing null so factory is populated with all possibilities.  Properties passed when
  // instantiating a client are what really matter. See createSaslClient.
  for (final String mechanismName : factory.getMechanismNames(null)) {
   if (!map.containsKey(mechanismName)) {
    map.put(mechanismName, new ArrayList<SaslClientFactory>());
   }
   map.get(mechanismName).add(factory);
  }
 }
 clientFactories = ImmutableMap.copyOf(map);
 if (logger.isDebugEnabled()) {
  logger.debug("Registered sasl client factories: {}", clientFactories.keySet());
 }
}

相关文章