Beispiel #1
0
        /// <summary>
        /// Removes Client authenticator
        /// </summary>
        public void RemoveClientAuthenticator(IClientAuthenticator handler)
        {
            List <IClientAuthenticator> list = _authenticators.ToList();

            list.Remove(handler);
            _authenticators = list.ToArray();
        }
Beispiel #2
0
        /// <summary>
        /// Adds Client authenticator
        /// </summary>
        public void AddClientAuthenticator(IClientAuthenticator handler)
        {
            List <IClientAuthenticator> list = _authenticators.ToList();

            list.Add(handler);
            _authenticators = list.ToArray();
        }
Beispiel #3
0
        /// <summary>
        /// Creates new Messaging Queue Server
        /// </summary>
        public MqServer(MqServerOptions options,
                        IClientAuthenticator authenticator = null,
                        IClientAuthorization authorization = null)
        {
            Options       = options ?? new MqServerOptions();
            Authenticator = authenticator;
            Authorization = authorization;

            _channels = new SafeList <Channel>(256);
            _clients  = new SafeList <MqClient>(2048);

            InitInstances();
        }
Beispiel #4
0
        /// <summary>
        /// Creates new Messaging Queue Server
        /// </summary>
        public MqServer(MqServerOptions options,
                        IClientAuthenticator authenticator = null,
                        IClientAuthorization authorization = null)
        {
            Options       = options ?? new MqServerOptions();
            Authenticator = authenticator;
            Authorization = authorization;

            _channels = new SafeList <Channel>(256);
            _clients  = new SafeList <MqClient>(2048);

            NodeServer = new NodeServer(this);

            NodeServer.Initialize();
        }
 public SiteConnector(HttpClient client,
                      IClientAuthenticator clientAuthenticator,
                      ISiteConnectorSettings settings,
                      List <IHttpStatusCodeStrategy> handlers,
                      ILog logger)
 {
     _client = client ?? throw new ArgumentNullException(TheHttpClientMayNotBeNull);
     _clientAuthenticator = clientAuthenticator ?? throw new ArgumentNullException(nameof(clientAuthenticator));
     _settings            = settings ?? throw new ArgumentNullException(nameof(settings));
     if (!handlers.Any())
     {
         throw new ArgumentException(nameof(handlers));
     }
     _handlers = handlers;
     _logger   = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Beispiel #6
0
        /// <summary>
        /// Adds client authenticator implementation to builder
        /// </summary>
        public void AddAuthenticator <T>(params object[] ctorArgs) where T : class, IClientAuthenticator, new()
        {
            IClientAuthenticator authenticator = Activator.CreateInstance(typeof(T), ctorArgs) as IClientAuthenticator;

            _clientAuthenticator = authenticator;
        }
Beispiel #7
0
 /// <summary>
 /// Adds client authenticator implementation to builder
 /// </summary>
 public void AddAuthenticator <T>() where T : class, IClientAuthenticator, new()
 {
     _clientAuthenticator = new T();
 }
Beispiel #8
0
 /// <summary>
 /// Adds client authenticator implementation to builder
 /// </summary>
 public void AddAuthenticator(IClientAuthenticator authenticator)
 {
     _clientAuthenticator = authenticator;
 }
Beispiel #9
0
 /// <summary>
 /// Creates new Messaging Queue Server
 /// </summary>
 public MqServer(IClientAuthenticator authenticator = null, IClientAuthorization authorization = null)
     : this(null, authenticator, authorization)
 {
 }
Beispiel #10
0
 /// <summary>
 /// Uses client authentication
 /// </summary>
 public static HorseMqBuilder AddClientAuthenticator(this HorseMqBuilder builder, IClientAuthenticator authenticator)
 {
     builder.Server.AddClientAuthenticator(authenticator);
     return(builder);
 }