本文整理了Java中javax.security.sasl.Sasl.getSaslServerFactories()
方法的一些代码示例,展示了Sasl.getSaslServerFactories()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Sasl.getSaslServerFactories()
方法的具体详情如下:
包路径:javax.security.sasl.Sasl
类名称:Sasl
方法名:getSaslServerFactories
暂无
代码示例来源:origin: org.apache.hadoop/hadoop-common
FastSaslServerFactory(Map<String,?> props) {
final Enumeration<SaslServerFactory> factories =
Sasl.getSaslServerFactories();
while (factories.hasMoreElements()) {
SaslServerFactory factory = factories.nextElement();
for (String mech : factory.getMechanismNames(props)) {
if (!factoryCache.containsKey(mech)) {
factoryCache.put(mech, new ArrayList<SaslServerFactory>());
}
factoryCache.get(mech).add(factory);
}
}
}
代码示例来源:origin: igniterealtime/Openfire
/**
* Returns a collection of mechanism names for which the JVM has an implementation available.
* <p/>
* Note that this need not (and likely will not) correspond with the list of mechanisms that is offered to XMPP
* peer entities, which is provided by #getSupportedMechanisms.
*
* @return a collection of SASL mechanism names (never null, possibly empty)
*/
public static Set<String> getImplementedMechanisms()
{
final Set<String> result = new HashSet<>();
final Enumeration<SaslServerFactory> saslServerFactories = Sasl.getSaslServerFactories();
while ( saslServerFactories.hasMoreElements() )
{
final SaslServerFactory saslServerFactory = saslServerFactories.nextElement();
Collections.addAll( result, saslServerFactory.getMechanismNames( null ) );
}
return result;
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
FastSaslServerFactory(Map<String,?> props) {
final Enumeration<SaslServerFactory> factories =
Sasl.getSaslServerFactories();
while (factories.hasMoreElements()) {
SaslServerFactory factory = factories.nextElement();
for (String mech : factory.getMechanismNames(props)) {
if (!factoryCache.containsKey(mech)) {
factoryCache.put(mech, new ArrayList<SaslServerFactory>());
}
factoryCache.get(mech).add(factory);
}
}
}
代码示例来源:origin: io.hops/hadoop-common
FastSaslServerFactory(Map<String,?> props) {
final Enumeration<SaslServerFactory> factories =
Sasl.getSaslServerFactories();
while (factories.hasMoreElements()) {
SaslServerFactory factory = factories.nextElement();
for (String mech : factory.getMechanismNames(props)) {
if (!factoryCache.containsKey(mech)) {
factoryCache.put(mech, new ArrayList<SaslServerFactory>());
}
factoryCache.get(mech).add(factory);
}
}
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
FastSaslServerFactory(Map<String,?> props) {
final Enumeration<SaslServerFactory> factories =
Sasl.getSaslServerFactories();
while (factories.hasMoreElements()) {
SaslServerFactory factory = factories.nextElement();
for (String mech : factory.getMechanismNames(props)) {
if (!factoryCache.containsKey(mech)) {
factoryCache.put(mech, new ArrayList<SaslServerFactory>());
}
factoryCache.get(mech).add(factory);
}
}
}
代码示例来源:origin: io.prestosql.hadoop/hadoop-apache
FastSaslServerFactory(Map<String,?> props) {
final Enumeration<SaslServerFactory> factories =
Sasl.getSaslServerFactories();
while (factories.hasMoreElements()) {
SaslServerFactory factory = factories.nextElement();
for (String mech : factory.getMechanismNames(props)) {
if (!factoryCache.containsKey(mech)) {
factoryCache.put(mech, new ArrayList<SaslServerFactory>());
}
factoryCache.get(mech).add(factory);
}
}
}
代码示例来源:origin: org.igniterealtime.openfire/xmppserver
/**
* Returns a collection of mechanism names for which the JVM has an implementation available.
* <p/>
* Note that this need not (and likely will not) correspond with the list of mechanisms that is offered to XMPP
* peer entities, which is provided by #getSupportedMechanisms.
*
* @return a collection of SASL mechanism names (never null, possibly empty)
*/
public static Set<String> getImplementedMechanisms()
{
final Set<String> result = new HashSet<>();
final Enumeration<SaslServerFactory> saslServerFactories = Sasl.getSaslServerFactories();
while ( saslServerFactories.hasMoreElements() )
{
final SaslServerFactory saslServerFactory = saslServerFactories.nextElement();
Collections.addAll( result, saslServerFactory.getMechanismNames( null ) );
}
return result;
}
代码示例来源:origin: org.apache.drill.exec/drill-java-exec
private void refresh() {
final Enumeration<SaslServerFactory> factories = Sasl.getSaslServerFactories();
final Map<String, List<SaslServerFactory>> map = Maps.newHashMap();
while (factories.hasMoreElements()) {
final SaslServerFactory factory = factories.nextElement();
// Passing null so factory is populated with all possibilities. Properties passed when
// instantiating a server are what really matter. See createSaslServer.
for (final String mechanismName : factory.getMechanismNames(null)) {
if (!map.containsKey(mechanismName)) {
map.put(mechanismName, new ArrayList<SaslServerFactory>());
}
map.get(mechanismName).add(factory);
}
}
serverFactories = ImmutableMap.copyOf(map);
if (logger.isDebugEnabled()) {
logger.debug("Registered sasl server factories: {}", serverFactories.keySet());
}
}
代码示例来源:origin: kontalk/tigase-server
@Override
public Element[] supStreamFeatures(final XMPPResourceConnection session) {
if ((session == null) || session.isAuthorized()) {
return null;
} else {
Collection<String> auth_mechs = mechanismSelector.filterMechanisms(Sasl
.getSaslServerFactories(), session);
Element[] mechs = new Element[auth_mechs.size()];
int idx = 0;
session.putSessionData(ALLOWED_SASL_MECHANISMS_KEY, auth_mechs);
for (String mech : auth_mechs) {
mechs[idx++] = new Element("mechanism", mech);
}
return new Element[] { new Element("mechanisms", mechs, new String[] { "xmlns" },
new String[] { _XMLNS }) };
}
}
代码示例来源:origin: kontalk/tigase-server
StringBuilder response = new StringBuilder("<username/>");
final Collection<String> auth_mechs = mechanismSelector.filterMechanisms(Sasl
.getSaslServerFactories(), session);
代码示例来源:origin: kontalk/tigase-server
allowedMechanisms = mechanismSelector.filterMechanisms(Sasl.getSaslServerFactories(), session);
内容来源于网络,如有侵权,请联系作者删除!