コード例 #1
0
 internal SecuritySettings(DestinationSettings destinationSettings)
 {
     this._objLock             = new object();
     this._destinationSettings = destinationSettings;
     this._securityConstraints = new Hashtable();
     this._loginCommands       = new LoginCommandCollection();
 }
コード例 #2
0
 internal SecuritySettings(DestinationSettings destinationSettings, XmlNode securityNode)
 {
     this._objLock             = new object();
     this._destinationSettings = destinationSettings;
     this._securityConstraints = new Hashtable();
     this._loginCommands       = new LoginCommandCollection();
     foreach (XmlNode node in securityNode.SelectNodes("*"))
     {
         if (node.Name == "security-constraint")
         {
             if (node.Attributes["ref"] != null)
             {
                 this._securityConstraintRef = new FluorineFx.Messaging.Config.SecurityConstraintRef(node.Attributes["ref"].Value);
                 continue;
             }
             string id = null;
             if (node.Attributes["id"] != null)
             {
                 id = node.Attributes["id"].Value;
             }
             else
             {
                 id = Guid.NewGuid().ToString("N");
             }
             string   authMethod = "Custom";
             string[] roles      = null;
             foreach (XmlNode node2 in node.SelectNodes("*"))
             {
                 if (node2.Name == "auth-method")
                 {
                     authMethod = node2.InnerXml;
                 }
                 if (node2.Name == "roles")
                 {
                     ArrayList list = new ArrayList();
                     foreach (XmlNode node3 in node2.SelectNodes("*"))
                     {
                         if (node3.Name == "role")
                         {
                             list.Add(node3.InnerXml);
                         }
                     }
                     roles = list.ToArray(typeof(string)) as string[];
                 }
             }
             this.CreateSecurityConstraint(id, authMethod, roles);
         }
         if (node.Name == "login-command")
         {
             LoginCommandSettings item = new LoginCommandSettings {
                 Server = node.Attributes["server"].Value,
                 Type   = node.Attributes["class"].Value
             };
             this._loginCommands.Add(item);
         }
     }
 }
コード例 #3
0
 internal void SetDestinationSettings(FluorineFx.Messaging.Config.DestinationSettings value)
 {
     this._destinationSettings = value;
 }
コード例 #4
0
 public void Insert(int index, DestinationSettings value)
 {
     this._destinationDictionary[value.Id] = value;
     base.List.Insert(index, value);
 }
コード例 #5
0
 public void Remove(DestinationSettings value)
 {
     this._destinationDictionary.Remove(value.Id);
     base.List.Remove(value);
 }
コード例 #6
0
 public int IndexOf(DestinationSettings value)
 {
     return(base.List.IndexOf(value));
 }
コード例 #7
0
 public bool Contains(DestinationSettings value)
 {
     return(base.List.Contains(value));
 }
コード例 #8
0
 public int Add(DestinationSettings value)
 {
     this._destinationDictionary[value.Id] = value;
     return(base.List.Add(value));
 }
コード例 #9
0
 internal Destination(IService service, FluorineFx.Messaging.Config.DestinationSettings settings)
 {
     this._service  = service;
     this._settings = settings;
 }
コード例 #10
0
        public static ServiceConfigSettings Load(string configPath, string configFileName)
        {
            ChannelSettings settings2;

            FluorineFx.Messaging.Config.ServiceSettings settings4;
            AdapterSettings settings5;

            FluorineFx.Messaging.Config.SecuritySettings settings6;
            string path = Path.Combine(configPath, configFileName);
            ServiceConfigSettings serviceConfigSettings = new ServiceConfigSettings();

            if (File.Exists(path))
            {
                log.Debug(__Res.GetString("MessageServer_LoadingConfig", new object[] { path }));
                XmlDocument document = new XmlDocument();
                document.Load(path);
                XmlNodeList list = document.SelectNodes("/services-config/channels/channel-definition");
                foreach (XmlNode node in list)
                {
                    XmlNode node2 = node.SelectSingleNode("endpoint");
                    string  str2  = node2.Attributes["class"].Value;
                    string  str3  = node2.Attributes["uri"].Value;
                    settings2 = new ChannelSettings(node);
                    serviceConfigSettings.ChannelsSettings.Add(settings2);
                }
                XmlNodeList list2 = document.SelectNodes("/services-config/factories/factory");
                foreach (XmlNode node3 in list2)
                {
                    string          str4      = node3.Attributes["id"].Value;
                    string          str5      = node3.Attributes["class"].Value;
                    FactorySettings settings3 = new FactorySettings(node3);
                    serviceConfigSettings.FactoriesSettings.Add(settings3);
                }
                XmlNodeList list3 = document.SelectNodes("/services-config/services/service-include");
                foreach (XmlNode node4 in list3)
                {
                    string str6 = node4.Attributes["file-path"].Value;
                    str6 = Path.Combine(configPath, str6);
                    log.Debug(__Res.GetString("MessageServer_LoadingServiceConfig", new object[] { str6 }));
                    settings4 = new FluorineFx.Messaging.Config.ServiceSettings(serviceConfigSettings);
                    settings4.Init(str6);
                    if ((settings4.Id == "remoting-service") && (settings4.DefaultAdapter == null))
                    {
                        settings5 = new AdapterSettings("dotnet", typeof(RemotingAdapter).FullName, false);
                        settings4.AdapterSettings.Add(settings5);
                    }
                    serviceConfigSettings.ServiceSettings.Add(settings4);
                }
                XmlNodeList list4 = document.SelectNodes("/services-config/services/service");
                foreach (XmlNode node5 in list4)
                {
                    settings4 = new FluorineFx.Messaging.Config.ServiceSettings(serviceConfigSettings);
                    settings4.Init(node5);
                    if ((settings4.Id == "remoting-service") && (settings4.DefaultAdapter == null))
                    {
                        settings5 = new AdapterSettings("dotnet", typeof(RemotingAdapter).FullName, false);
                        settings4.AdapterSettings.Add(settings5);
                    }
                    serviceConfigSettings.ServiceSettings.Add(settings4);
                }
                XmlNode securityNode = document.SelectSingleNode("/services-config/security");
                if (securityNode != null)
                {
                    settings6 = new FluorineFx.Messaging.Config.SecuritySettings(null, securityNode);
                    serviceConfigSettings._securitySettings = settings6;
                }
                XmlNode flexClientNode = document.SelectSingleNode("/services-config/flex-client");
                if (flexClientNode != null)
                {
                    FluorineFx.Messaging.Config.FlexClientSettings settings7 = new FluorineFx.Messaging.Config.FlexClientSettings(flexClientNode);
                    serviceConfigSettings._flexClientSettings = settings7;
                    return(serviceConfigSettings);
                }
                serviceConfigSettings._flexClientSettings = new FluorineFx.Messaging.Config.FlexClientSettings();
                return(serviceConfigSettings);
            }
            log.Debug(__Res.GetString("MessageServer_LoadingConfigDefault", new object[] { path }));
            LoginCommandCollection loginCommands = FluorineConfiguration.Instance.LoginCommands;

            if (loginCommands != null)
            {
                settings6 = new FluorineFx.Messaging.Config.SecuritySettings(null);
                LoginCommandSettings item = new LoginCommandSettings {
                    Server = "asp.net",
                    Type   = loginCommands.GetLoginCommand("asp.net")
                };
                settings6.LoginCommands.Add(item);
                serviceConfigSettings._securitySettings = settings6;
            }
            settings2 = new ChannelSettings("my-amf", "flex.messaging.endpoints.AMFEndpoint", "http://{server.name}:{server.port}/{context.root}/Gateway.aspx");
            serviceConfigSettings.ChannelsSettings.Add(settings2);
            settings4 = new FluorineFx.Messaging.Config.ServiceSettings(serviceConfigSettings, "remoting-service", typeof(RemotingService).FullName);
            string customClass = "flex.messaging.messages.RemotingMessage";
            string type        = FluorineConfiguration.Instance.ClassMappings.GetType(customClass);

            settings4.SupportedMessageTypes[customClass] = type;
            serviceConfigSettings.ServiceSettings.Add(settings4);
            settings5 = new AdapterSettings("dotnet", typeof(RemotingAdapter).FullName, true);
            settings4.DefaultAdapter = settings5;
            DestinationSettings settings9 = new DestinationSettings(settings4, "fluorine", settings5, "*");

            settings4.DestinationSettings.Add(settings9);
            serviceConfigSettings._flexClientSettings = new FluorineFx.Messaging.Config.FlexClientSettings();
            return(serviceConfigSettings);
        }