コード例 #1
0
ファイル: HorseMq.cs プロジェクト: erkantaylan/horse-mq
        /// <summary>
        /// Removes Client authenticator
        /// </summary>
        public void RemoveClientAuthenticator(IClientAuthenticator handler)
        {
            List <IClientAuthenticator> list = _authenticators.ToList();

            list.Remove(handler);
            _authenticators = list.ToArray();
        }
コード例 #2
0
ファイル: HorseMq.cs プロジェクト: erkantaylan/horse-mq
        /// <summary>
        /// Adds Client authenticator
        /// </summary>
        public void AddClientAuthenticator(IClientAuthenticator handler)
        {
            List <IClientAuthenticator> list = _authenticators.ToList();

            list.Add(handler);
            _authenticators = list.ToArray();
        }
コード例 #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();
        }
コード例 #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));
 }
コード例 #6
0
ファイル: ServerBuilder.cs プロジェクト: Akrotiri/twino
        /// <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;
        }
コード例 #7
0
ファイル: ServerBuilder.cs プロジェクト: Akrotiri/twino
 /// <summary>
 /// Adds client authenticator implementation to builder
 /// </summary>
 public void AddAuthenticator <T>() where T : class, IClientAuthenticator, new()
 {
     _clientAuthenticator = new T();
 }
コード例 #8
0
ファイル: ServerBuilder.cs プロジェクト: Akrotiri/twino
 /// <summary>
 /// Adds client authenticator implementation to builder
 /// </summary>
 public void AddAuthenticator(IClientAuthenticator authenticator)
 {
     _clientAuthenticator = authenticator;
 }
コード例 #9
0
 /// <summary>
 /// Creates new Messaging Queue Server
 /// </summary>
 public MqServer(IClientAuthenticator authenticator = null, IClientAuthorization authorization = null)
     : this(null, authenticator, authorization)
 {
 }
コード例 #10
0
ファイル: MqExtensions.cs プロジェクト: erkantaylan/horse-mq
 /// <summary>
 /// Uses client authentication
 /// </summary>
 public static HorseMqBuilder AddClientAuthenticator(this HorseMqBuilder builder, IClientAuthenticator authenticator)
 {
     builder.Server.AddClientAuthenticator(authenticator);
     return(builder);
 }