public String[] getMechanismNames(final Map<String, ?> props) { return delegate.getMechanismNames(props); }
@Override public String[] getMechanismNames(final Map<String, ?> props) { final LinkedHashSet<String> names = new LinkedHashSet<String>(); for (SaslServerFactory factory : factories) { if (factory != null) { Collections.addAll(names, factory.getMechanismNames(props)); } } return names.toArray(new String[names.size()]); } }
Collection<String> getAllSupportedMechNames() { final String[] names = saslServerFactory.getMechanismNames(Collections.singletonMap(WildFlySasl.MECHANISM_QUERY_ALL, "true")); // todo: filter down based on SASL selection criteria if (names == null || names.length == 0) { return Collections.emptyList(); } else if (names.length == 1) { return Collections.singletonList(names[0]); } else { return Arrays.asList(names); } }
public String[] getMechanismNames(final Map<String, ?> props) { final String[] names = delegate.getMechanismNames(props); final ArrayList<String> list = new ArrayList<>(names.length); for (String name : names) { if (predicate.test(name)) { list.add(name); } } return list.toArray(new String[list.size()]); } }
public static SaslServerFactory getSaslServerFactory(String mech, Map<String, ?> props) { Iterator<SaslServerFactory> saslFactories = SaslUtils.getSaslServerFactories(SaslUtils.class.getClassLoader(), true); while (saslFactories.hasNext()) { SaslServerFactory saslFactory = saslFactories.next(); for (String supportedMech : saslFactory.getMechanismNames(props)) { if (supportedMech.equals(mech)) { return saslFactory; } } } throw new IllegalArgumentException("No SASL server factory for mech " + mech); }
@Override public String[] getMechanismNames(Map<String, ?> props) { return delegate.getMechanismNames(combine(props, properties)); }
public String[] getMechanismNames(final Map<String, ?> props) { synchronized (loader){ final Set<String> set = new LinkedHashSet<>(); final Iterator<SaslServerFactory> iterator = loader.iterator(); SaslServerFactory serverFactory; for (; ; ) try { // Service loader iterators can blow up in various ways; that's why the loop is structured this way if (!iterator.hasNext()) { break; } serverFactory = iterator.next(); // let SaslException bubble up Collections.addAll(set, serverFactory.getMechanismNames(props)); } catch (ServiceConfigurationError ignored) { } return set.toArray(new String[set.size()]); } } }
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); } } }
/** * 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; }
@Override public String[] getMechanismNames(final Map<String, ?> props) { final BiPredicate<String, Provider> mechFilter = SaslFactories.getProviderFilterPredicate(props); final Set<String> names = new LinkedHashSet<>(); for (Provider currentProvider : providerSupplier.get()) { Set<Service> services = currentProvider.getServices(); if (services != null) { for (Service service : services) { if (SERVICE_TYPE.equals(service.getType())) { try { final String[] mechanismNames = ((SaslServerFactory) service.newInstance(null)).getMechanismNames(props); Collections.addAll(names, SaslFactories.filterMechanismsByProvider(mechanismNames, 0, 0, currentProvider, mechFilter)); } catch (NoSuchAlgorithmException | ClassCastException | InvalidParameterException e) { log.debug("Unable to create instance", e); } } } } } if (names.size() == 0 && log.isTraceEnabled()) { log.tracef("No %s provided by provider supplier in %s: %s", SERVICE_TYPE, getClass().getSimpleName(), Arrays.toString(providerSupplier.get())); } return names.toArray(new String[names.size()]); } }
@Override public String[] getMechanismNames(final Map<String, ?> props) { final LinkedHashSet<String> names = new LinkedHashSet<String>(); for (SaslServerFactory factory : factories) { if (factory != null) { Collections.addAll(names, factory.getMechanismNames(props)); } } return names.toArray(new String[names.size()]); } }
protected Collection<String> getAllSupportedMechNames() { final String[] names = saslServerFactory.getMechanismNames(Collections.singletonMap(WildFlySasl.MECHANISM_QUERY_ALL, "true")); // todo: filter down based on SASL selection criteria if (names == null || names.length == 0) { return Collections.emptyList(); } else if (names.length == 1) { return Collections.singletonList(names[0]); } else { return Arrays.asList(names); } }
Collection<String> getAllSupportedMechNames() { final String[] names = saslServerFactory.getMechanismNames(Collections.singletonMap(WildFlySasl.MECHANISM_QUERY_ALL, "true")); // todo: filter down based on SASL selection criteria if (names == null || names.length == 0) { return Collections.emptyList(); } else if (names.length == 1) { return Collections.singletonList(names[0]); } else { return Arrays.asList(names); } }
public String[] getMechanismNames(final Map<String, ?> props) { final String[] names = delegate.getMechanismNames(props); final ArrayList<String> list = new ArrayList<>(names.length); for (String name : names) { if (predicate.test(name)) { list.add(name); } } return list.toArray(new String[list.size()]); } }
public String[] getMechanismNames(final Map<String, ?> props) { final String[] names = delegate.getMechanismNames(props); final ArrayList<String> list = new ArrayList<>(names.length); for (String name : names) { if (predicate.test(name)) { list.add(name); } } return list.toArray(new String[list.size()]); } }
public String[] getMechanismNames(final Map<String, ?> props) { final String[] names = delegate.getMechanismNames(props); final ArrayList<String> list = new ArrayList<>(names.length); for (String name : names) { if (predicate.test(name)) { list.add(name); } } return list.toArray(new String[list.size()]); } }
public static SaslServerFactory getSaslServerFactory(String mech, Map<String, ?> props) { Iterator<SaslServerFactory> saslFactories = SaslUtils.getSaslServerFactories(SaslUtils.class.getClassLoader(), true); while (saslFactories.hasNext()) { SaslServerFactory saslFactory = saslFactories.next(); for (String supportedMech : saslFactory.getMechanismNames(props)) { if (supportedMech.equals(mech)) { return saslFactory; } } } throw new IllegalArgumentException("No SASL server factory for mech " + mech); }
public static SaslServerFactory getSaslServerFactory(String mech, Map<String, ?> props) { Iterator<SaslServerFactory> saslFactories = SaslUtils.getSaslServerFactories(SaslUtils.class.getClassLoader(), true); while (saslFactories.hasNext()) { SaslServerFactory saslFactory = saslFactories.next(); for (String supportedMech : saslFactory.getMechanismNames(props)) { if (supportedMech.equals(mech)) { return saslFactory; } } } throw new IllegalArgumentException("No SASL server factory for mech " + mech); }
public static SaslServerFactory getSaslServerFactory(String mech, Map<String, ?> props) { Iterator<SaslServerFactory> saslFactories = SaslUtils.getSaslServerFactories(SaslUtils.class.getClassLoader(), true); while (saslFactories.hasNext()) { SaslServerFactory saslFactory = saslFactories.next(); for (String supportedMech : saslFactory.getMechanismNames(props)) { if (supportedMech.equals(mech)) { return saslFactory; } } } throw new IllegalArgumentException("No SASL server factory for mech " + mech); }
private static String[] getSaslServerAvailableMechanisms(OperationContext context) { RuntimeCapability<Void> runtimeCapability = SASL_SERVER_FACTORY_RUNTIME_CAPABILITY.fromBaseCapability(context.getCurrentAddressValue()); ServiceName saslServerFactoryName = runtimeCapability.getCapabilityServiceName(SaslServerFactory.class); ServiceController<SaslServerFactory> serviceContainer = getRequiredService(context.getServiceRegistry(false), saslServerFactoryName, SaslServerFactory.class); if (serviceContainer.getState() != State.UP) { return null; } return serviceContainer.getValue().getMechanismNames(Collections.emptyMap()); }