Changeset 9665 for trunk/sources/HeuristicLab.Clients.Hive
- Timestamp:
- 06/28/13 12:05:53 (11 years ago)
- Location:
- trunk/sources/HeuristicLab.Clients.Hive/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveServiceLocator.cs
r9456 r9665 35 35 } 36 36 37 private HiveServiceLocator() { 38 } 39 37 40 private string username; 38 41 public string Username { … … 47 50 } 48 51 52 public int EndpointRetries { get; private set; } 53 54 public string WorkingEndpoint { get; private set; } 55 49 56 private HiveServiceClient NewServiceClient() { 50 HiveServiceClient cl; 57 if (EndpointRetries >= Settings.Default.MaxEndpointRetries) { 58 return CreateClient(WorkingEndpoint); 59 } 60 61 var configurations = Settings.Default.EndpointConfigurationPriorities; 62 63 Exception exception = null; 64 foreach (var endpointConfigurationName in configurations) { 65 try { 66 var cl = CreateClient(endpointConfigurationName); 67 cl.Open(); 68 WorkingEndpoint = endpointConfigurationName; 69 return cl; 70 } 71 catch (Exception exc) { 72 exception = exc; 73 EndpointRetries++; 74 } 75 } 76 77 throw exception ?? new Exception("No endpoint for Hive service found."); 78 } 79 80 private HiveServiceClient CreateClient(string endpointConfigurationName) { 81 HiveServiceClient cl = null; 82 51 83 if (string.IsNullOrEmpty(username) && string.IsNullOrEmpty(password)) 52 cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>( );84 cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>(endpointConfigurationName); 53 85 else 54 cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>( null, null, username, password);86 cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>(endpointConfigurationName, null, username, password); 55 87 56 88 return cl; -
trunk/sources/HeuristicLab.Clients.Hive/3.3/Settings.Designer.cs
r9207 r9665 2 2 // <auto-generated> 3 3 // This code was generated by a tool. 4 // Runtime Version:4.0.30319. 5864 // Runtime Version:4.0.30319.18034 5 5 // 6 6 // Changes to this file may cause incorrect behavior and will be lost if … … 13 13 14 14 [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "1 0.0.0.0")]15 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 16 16 internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 17 … … 26 26 [global::System.Configuration.ApplicationScopedSettingAttribute()] 27 27 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 [global::System.Configuration.DefaultSettingValueAttribute(" 1")]28 [global::System.Configuration.DefaultSettingValueAttribute("2")] 29 29 public int MaxParallelUploads { 30 30 get { … … 53 53 [global::System.Configuration.ApplicationScopedSettingAttribute()] 54 54 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 55 [global::System.Configuration.DefaultSettingValueAttribute(" 2")]55 [global::System.Configuration.DefaultSettingValueAttribute("4")] 56 56 public int MaxParallelDownloads { 57 57 get { … … 77 77 } 78 78 } 79 80 [global::System.Configuration.ApplicationScopedSettingAttribute()] 81 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 82 [global::System.Configuration.DefaultSettingValueAttribute(@"<?xml version=""1.0"" encoding=""utf-16""?> 83 <ArrayOfString xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> 84 <string>netTcpBinding_IHiveService</string> 85 <string>wsHttpBinding_IHiveService</string> 86 </ArrayOfString>")] 87 public global::System.Collections.Specialized.StringCollection EndpointConfigurationPriorities { 88 get { 89 return ((global::System.Collections.Specialized.StringCollection)(this["EndpointConfigurationPriorities"])); 90 } 91 } 92 93 [global::System.Configuration.ApplicationScopedSettingAttribute()] 94 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 95 [global::System.Configuration.DefaultSettingValueAttribute("3")] 96 public int MaxEndpointRetries { 97 get { 98 return ((int)(this["MaxEndpointRetries"])); 99 } 100 } 79 101 } 80 102 } -
trunk/sources/HeuristicLab.Clients.Hive/3.3/Settings.settings
r9207 r9665 4 4 <Settings> 5 5 <Setting Name="MaxParallelUploads" Type="System.Int32" Scope="Application"> 6 <Value Profile="(Default)"> 1</Value>6 <Value Profile="(Default)">2</Value> 7 7 </Setting> 8 8 <Setting Name="HLBinaryName" Type="System.String" Scope="Application"> … … 13 13 </Setting> 14 14 <Setting Name="MaxParallelDownloads" Type="System.Int32" Scope="Application"> 15 <Value Profile="(Default)"> 2</Value>15 <Value Profile="(Default)">4</Value> 16 16 </Setting> 17 17 <Setting Name="MaxRepeatServiceCalls" Type="System.Int32" Scope="Application"> … … 21 21 <Value Profile="(Default)">anonymous</Value> 22 22 </Setting> 23 <Setting Name="EndpointConfigurationPriorities" Type="System.Collections.Specialized.StringCollection" Scope="Application"> 24 <Value Profile="(Default)"><?xml version="1.0" encoding="utf-16"?> 25 <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 26 <string>netTcpBinding_IHiveService</string> 27 <string>wsHttpBinding_IHiveService</string> 28 </ArrayOfString></Value> 29 </Setting> 30 <Setting Name="MaxEndpointRetries" Type="System.Int32" Scope="Application"> 31 <Value Profile="(Default)">3</Value> 32 </Setting> 23 33 </Settings> 24 34 </SettingsFile> -
trunk/sources/HeuristicLab.Clients.Hive/3.3/app.config
r9207 r9665 9 9 <HeuristicLab.Clients.Hive.Settings> 10 10 <setting name="MaxParallelUploads" serializeAs="String"> 11 <value> 1</value>11 <value>2</value> 12 12 </setting> 13 13 <setting name="HLBinaryName" serializeAs="String"> … … 18 18 </setting> 19 19 <setting name="MaxParallelDownloads" serializeAs="String"> 20 <value> 2</value>20 <value>4</value> 21 21 </setting> 22 22 <setting name="MaxRepeatServiceCalls" serializeAs="String"> … … 25 25 <setting name="AnonymousUserName" serializeAs="String"> 26 26 <value>anonymous</value> 27 </setting> 28 <setting name="EndpointConfigurationPriorities" serializeAs="Xml"> 29 <value> 30 <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 31 xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 32 <string>netTcpBinding_IHiveService</string> 33 <string>wsHttpBinding_IHiveService</string> 34 </ArrayOfString> 35 </value> 36 </setting> 37 <setting name="MaxEndpointRetries" serializeAs="String"> 38 <value>3</value> 27 39 </setting> 28 40 </HeuristicLab.Clients.Hive.Settings> … … 38 50 <bindings> 39 51 <wsHttpBinding> 40 <binding name="wsHttpBinding_Hive" 41 closeTimeout="00:01:00" 42 openTimeout="00:01:00" 43 receiveTimeout="00:20:00" 44 sendTimeout="00:20:00" 45 bypassProxyOnLocal="false" 46 transactionFlow="false" 47 hostNameComparisonMode="StrongWildcard" 48 maxBufferPoolSize="2147483647" 49 maxReceivedMessageSize="2147483647" 50 messageEncoding="Text" 51 textEncoding="utf-8" 52 useDefaultWebProxy="true" 53 allowCookies="false"> 54 55 <readerQuotas maxDepth="2147483647" 56 maxStringContentLength="2147483647" 57 maxArrayLength="2147483647" 58 maxBytesPerRead="2147483647" 59 maxNameTableCharCount="2147483647"/> 52 <binding name="wsHttpBinding_Hive" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:20:00" sendTimeout="00:20:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> 53 <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/> 60 54 <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/> 61 55 <security mode="Message"> … … 65 59 </binding> 66 60 </wsHttpBinding> 61 <netTcpBinding> 62 <binding name="netTcpBinding_Hive" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:20:00" sendTimeout="00:20:00" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"> 63 <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 64 <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> 65 <security mode="TransportWithMessageCredential"> 66 <transport clientCredentialType="Windows" /> 67 <message clientCredentialType="UserName" algorithmSuite="Default" /> 68 </security> 69 </binding> 70 </netTcpBinding> 67 71 </bindings> 68 72 <client> 69 73 <endpoint address="http://services.heuristiclab.com/Hive-3.3/HiveService.svc" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding_Hive" contract="HeuristicLab.Clients.Hive.IHiveService" name="wsHttpBinding_IHiveService" behaviorConfiguration="HiveBehaviorConfiguration"> 70 74 <identity> 71 <certificate encodedValue="AwAAAAEAAAAUAAAAwK1+2oAmcy/mI2P2QjyiJRh0y60gAAAAAQAAACoCAAAwggImMIIBj6ADAgECAhAIkseQ2EEhgU720qJA61gqMA0GCSqGSIb3DQEBBAUAMCQxIjAgBgNVBAMTGXNlcnZpY2VzLmhldXJpc3RpY2xhYi5jb20wHhcNMTAwNTExMTExNDAyWhcNMzkxMjMxMjM1OTU5WjAkMSIwIAYDVQQDExlzZXJ2aWNlcy5oZXVyaXN0aWNsYWIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq26Bwmwc7k+4W30qLQ2j+FInEL5BuH6opDY6CSlrtt3xQS/anrhvpbf3QghLDVINzcHkzbPmm/SguG4F85QLB6xO+tJaOvRo0iEK5g3c307vMIru7FJwk/OhplEQ5J1hbDgL3zOJlrWlgtqRVxCtVdF3XroI9BctOt1NkeKv9ewIDAQABo1kwVzBVBgNVHQEETjBMgBCjbgdYd4j5JgUuJ1Wo/GxroSYwJDEiMCAGA1UEAxMZc2VydmljZXMuaGV1c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 </endpoint> 78 <endpoint address="net.tcp://services.heuristiclab.com/Hive-3.3/HiveService.svc" binding="netTcpBinding" bindingConfiguration="netTcpBinding_Hive" contract="HeuristicLab.Clients.Hive.IHiveService" name="netTcpBinding_IHiveService" behaviorConfiguration="HiveBehaviorConfiguration"> 79 <identity> 80 <certificate encodedValue="AwAAAAEAAAAUAAAAwK1+2oAmcy/mI2P2QjyiJRh0y60gAAAAAQAAACoCAAAwggImMIIBj6ADAgECAhAIkseQ2EEhgU720qJA61gqMA0GCSqGSIb3DQEBBAUAMCQxIjAgBgNVBAMTGXNlcnZpY2VzLmhldXJpc3RpY2xhYi5jb20wHhcNMTAwNTExMTExNDAyWhcNMzkxMjMxMjM1OTU5WjAkMSIwIAYDVQQDExlzZXJ2aWNlcy5oZXVyaXN0aWNsYWIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq26Bwmwc7k+4W30qLQ2j+FInEL5BuH6opDY6CSlrtt3xQS/anrhvpbf3QghLDVINzcHkzbPmm/SguG4F85QLB6xO+tJaOvRo0iEK5g3c307vMIru7FJwk/OhplEQ5J1hbDgL3zOJlrWlgtqRVxCtVdF3XroI9BctOt1NkeKv9ewIDAQABo1kwVzBVBgNVHQEETjBMgBCjbgdYd4j5JgUuJ1Wo/GxroSYwJDEiMCAGA1UEAxMZc2VydmljZXMuaGV1cmlzdGljbGFiLmNvbYIQCJLHkNhBIYFO9tKiQOtYKjANBgkqhkiG9w0BAQQFAAOBgQAb/2xk2uQad68shSPl/uixWgvFI8WkxOTBopOLaLtDxwCeZ3mWVHdV9VnixHtThubnEBXAhYOCQSIXWtQuXFWO+gH3YyjTRJY5kTmXyuvBRTn3/so5SrQ7Rdlm9hf6E5YVX3tCjAy7ybUyaDUkQfmH5vmvgvpMzRfsJ1qhnUpJiQ==" /> 72 81 </identity> 73 82 </endpoint>
Note: See TracChangeset
for help on using the changeset viewer.