Beispiel #1
0
 public static void Init(Configuration conf)
 {
     Security.AddProvider(new SaslPlainServer.SecurityProvider());
     // passing null so factory is populated with all possibilities.  the
     // properties passed when instantiating a server are what really matter
     saslFactory = new SaslRpcServer.FastSaslServerFactory(null);
 }
Beispiel #2
0
            internal FastSaslServerFactory(IDictionary <string, object> props)
            {
                // Sasl.createSaslServer is 100-200X slower than caching the factories!
                Enumeration <SaslServerFactory> factories = Javax.Security.Sasl.Sasl.GetSaslServerFactories
                                                                ();

                while (factories.MoveNext())
                {
                    SaslServerFactory factory = factories.Current;
                    foreach (string mech in factory.GetMechanismNames(props))
                    {
                        if (!factoryCache.Contains(mech))
                        {
                            factoryCache[mech] = new AList <SaslServerFactory>();
                        }
                        factoryCache[mech].AddItem(factory);
                    }
                }
            }