示例#1
0
 private IApiNode CreateUrlNode(string url)
 {
     IApiNode node = new ApiNode(url);
     mNodes[node.Url] = node;
     ApiNodeAgent nodeAgent = new ApiNodeAgent();
     nodeAgent.Node = node;
     nodeAgent.Url = url;
     mAgents[node.Url] = nodeAgent;
     return node;
 }
        private IApiNode CreateUrlNode(string url)
        {
            IApiNode node = new ApiNode(url);

            mNodes[node.Url] = node;
            ApiNodeAgent nodeAgent = new ApiNodeAgent();

            nodeAgent.Node    = node;
            nodeAgent.Url     = url;
            mAgents[node.Url] = nodeAgent;
            ChangeVersion();
            return(node);
        }
示例#3
0
 public ApiNodeAgent GetAgent(string url)
 {
     IApiNode node = MatchNode(url);
     if (node == null)
         node = DefaultNode;
     if (!mAgents.TryGetValue(node.Url, out ApiNodeAgent agent))
     {
         agent = new ApiNodeAgent();
         agent.Url = node.Url;
         agent.Node = node;
         mAgents[node.Url] = agent;
     }
     return agent;
 }
        public ApiNodeAgent GetAgent(string url)
        {
            IApiNode node = MatchNode(url);

            if (node == null)
            {
                node = DefaultNode;
            }
            if (!mAgents.TryGetValue(node.Url, out ApiNodeAgent agent))
            {
                agent             = new ApiNodeAgent();
                agent.Url         = node.Url;
                agent.Node        = node;
                mAgents[node.Url] = agent;
            }
            agent.Version = this.Version;
            return(agent);
        }
示例#5
0
 public HttpClusterApi SetNode(string url, IApiNode node)
 {
     if (url == "*")
         DefaultNode = node;
     else
         mNodes[url.ToLower()] = node;
     if (mAgents.TryGetValue(url, out ApiNodeAgent agent))
     {
         agent.Node = node;
     }
     else
     {
         agent = new ApiNodeAgent();
         agent.Url = url;
         agent.Node = node;
         mAgents[url] = agent;
     }
     return this;
 }
 public HttpClusterApi SetNode(string url, IApiNode node)
 {
     if (url == "*")
     {
         DefaultNode = node;
     }
     else
     {
         mNodes[url.ToLower()] = node;
     }
     if (mAgents.TryGetValue(url, out ApiNodeAgent agent))
     {
         agent.Node = node;
     }
     else
     {
         agent        = new ApiNodeAgent();
         agent.Url    = url;
         agent.Node   = node;
         mAgents[url] = agent;
     }
     ChangeVersion();
     return(this);
 }