예제 #1
0
 /// <summary>
 ///    更新网络缓存信息
 /// </summary>
 /// <param name="level">应用等级</param>
 /// <param name="cache">远程目标终结点信息列表</param>
 /// <param name="protocol">通信协议</param>
 /// <param name="protocolTypes">协议类型</param>
 public static void UpdateCache(Protocols protocol, ProtocolTypes protocolTypes, ApplicationLevel level, List <string> cache)
 {
     if (protocolTypes == ProtocolTypes.Metadata)
     {
         _metadataCluster.UpdateCache(protocol, level, cache);
     }
     else if (protocolTypes == ProtocolTypes.Intellegence)
     {
         _clsuter.UpdateCache(protocol, level, cache);
     }
 }
        private bool GetMissedRemoteAddresses(string appName, string version, Protocols protocol, ApplicationLevel level)
        {
            if (CheckProtect(appName, version, protocol, level, _cluster.ProtocolType))
            {
                return(false);
            }
            if (_hostProxy == null)
            {
                return(false);
            }
            IList <string> addresses = _hostProxy.GetRemoteAddresses(appName, version, _appUniqueId, protocol, _cluster.ProtocolType, level);

            if (addresses == null || addresses.Count == 0)
            {
                return(false);
            }
            _cluster.UpdateCache(protocol, level, addresses);
            return(true);
        }