Changeset 8251 for branches/OaaS
- Timestamp:
- 07/06/12 13:31:40 (12 years ago)
- Location:
- branches/OaaS
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS/HeuristicLab 3.3 Hive.Slave.sln
r8242 r8251 21 21 EndProject 22 22 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Clients.Hive.Slave.AzureClient-3.3", "HeuristicLab.Clients.Hive.Slave.AzureClient\3.3\HeuristicLab.Clients.Hive.Slave.AzureClient-3.3.csproj", "{D0DDC7C9-9215-4325-AA2F-0C4ABF809321}" 23 EndProject 24 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Clients.Hive-3.3", "HeuristicLab.Clients.Hive\3.3\HeuristicLab.Clients.Hive-3.3.csproj", "{B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}" 23 25 EndProject 24 26 Global … … 144 146 {D0DDC7C9-9215-4325-AA2F-0C4ABF809321}.Release|x64.ActiveCfg = Release|Any CPU 145 147 {D0DDC7C9-9215-4325-AA2F-0C4ABF809321}.Release|x86.ActiveCfg = Release|Any CPU 148 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 149 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Debug|Any CPU.Build.0 = Debug|Any CPU 150 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Debug|x64.ActiveCfg = Debug|x64 151 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Debug|x64.Build.0 = Debug|x64 152 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Debug|x86.ActiveCfg = Debug|x86 153 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Debug|x86.Build.0 = Debug|x86 154 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Release|Any CPU.ActiveCfg = Release|Any CPU 155 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Release|Any CPU.Build.0 = Release|Any CPU 156 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Release|x64.ActiveCfg = Release|x64 157 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Release|x64.Build.0 = Release|x64 158 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Release|x86.ActiveCfg = Release|x86 159 {B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}.Release|x86.Build.0 = Release|x86 146 160 EndGlobalSection 147 161 GlobalSection(SolutionProperties) = preSolution -
branches/OaaS/HeuristicLab.Clients.Hive.Slave.Azure/ServiceConfiguration.Cloud.cscfg
r8242 r8251 5 5 <ConfigurationSettings> 6 6 <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" /> 7 <Setting name="HiveServerAddress" value="" /> 8 <Setting name="HiveServerCertifcateEncodedValue" value="" /> 7 9 </ConfigurationSettings> 8 10 </Role> -
branches/OaaS/HeuristicLab.Clients.Hive.Slave.Azure/ServiceConfiguration.Local.cscfg
r8242 r8251 5 5 <ConfigurationSettings> 6 6 <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" /> 7 <Setting name="HiveServerAddress" value="" /> 8 <Setting name="HiveServerCertifcateEncodedValue" value="" /> 7 9 </ConfigurationSettings> 8 10 </Role> -
branches/OaaS/HeuristicLab.Clients.Hive.Slave.Azure/ServiceDefinition.build.csdef
r8242 r8251 14 14 <Import moduleName="Diagnostics" /> 15 15 </Imports> 16 <ConfigurationSettings> 17 <Setting name="HiveServerAddress" /> 18 <Setting name="HiveServerCertifcateEncodedValue" /> 19 </ConfigurationSettings> 16 20 </WorkerRole> 17 21 </ServiceDefinition> -
branches/OaaS/HeuristicLab.Clients.Hive.Slave.Azure/ServiceDefinition.csdef
r8242 r8251 5 5 <Import moduleName="Diagnostics" /> 6 6 </Imports> 7 <ConfigurationSettings> 8 <Setting name="HiveServerAddress" /> 9 <Setting name="HiveServerCertifcateEncodedValue" /> 10 </ConfigurationSettings> 7 11 </WorkerRole> 8 12 </ServiceDefinition> -
branches/OaaS/HeuristicLab.Clients.Hive.Slave.AzureClient/3.3/WorkerRole.cs
r8242 r8251 32 32 private Thread coreThread; 33 33 34 private const string HiveServerAddressSetting = "HiveServerAddress"; 35 private const string HiveServerCertificateSetting = "HiveServerCertifcateEncodedValue"; 36 34 37 public override void Run() { 35 38 core = new Core(false); 39 40 string hiveServerAddress = RoleEnvironment.GetConfigurationSettingValue(HiveServerAddressSetting); 41 string hiveServerCertificate = RoleEnvironment.GetConfigurationSettingValue(HiveServerCertificateSetting); 42 43 // values are empty, settings from app.config are used 44 if (!string.IsNullOrEmpty(hiveServerAddress) && !string.IsNullOrEmpty(hiveServerCertificate)) { 45 core.SetNewHiveServer(hiveServerAddress, hiveServerCertificate); 46 } 47 36 48 coreThread = new Thread(core.Start); 37 49 coreThread.Start(); … … 59 71 } 60 72 73 RoleEnvironment.Changed += RoleEnvironmentChanged; 74 61 75 return base.OnStart(); 62 76 } … … 66 80 base.OnStop(); 67 81 } 82 83 private void RoleEnvironmentChanged(object sender, RoleEnvironmentChangedEventArgs e) { 84 } 68 85 } 69 86 } -
branches/OaaS/HeuristicLab.Clients.Hive.Slave/3.3/Core.cs
r8242 r8251 500 500 } 501 501 #endregion 502 503 public void SetNewHiveServer(string remote, string identity) { 504 SlaveClientCom.Instance.LogMessage("Set new hive server address and identity"); 505 HiveServiceLocator.Instance.RemoteAddress = remote; 506 HiveServiceLocator.Instance.IdentityCertificate = identity; 507 } 508 509 public void ChangeHiveServerAndRestart(string remote, string identity) { 510 SlaveClientCom.Instance.LogMessage("Change hive server"); 511 ShutdownCore(); 512 SetNewHiveServer(remote, identity); 513 Start(); 514 } 502 515 } 503 516 } -
branches/OaaS/HeuristicLab.Clients.Hive/3.3/HiveServiceLocator.cs
r7259 r8251 21 21 22 22 using System; 23 using System.Security.Cryptography.X509Certificates; 24 using System.ServiceModel; 23 25 using HeuristicLab.Clients.Common; 24 26 … … 47 49 } 48 50 51 private string remoteAddress; 52 public string RemoteAddress { 53 get { return remoteAddress; } 54 set { remoteAddress = value; } 55 } 56 57 private string identityCertificate; 58 public string IdentityCertificate { 59 get { return identityCertificate; } 60 set { identityCertificate = value; } 61 } 62 49 63 private HiveServiceClient NewServiceClient() { 50 64 HiveServiceClient cl; 51 65 if (string.IsNullOrEmpty(username) && string.IsNullOrEmpty(password)) 52 66 cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>(); 53 else 67 else { 54 68 cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>(null, null, username, password); 69 } 70 71 if (!string.IsNullOrEmpty(remoteAddress) && !string.IsNullOrEmpty(identityCertificate)) { 72 73 X509Certificate2Collection supportingCertificates = new X509Certificate2Collection(); 74 supportingCertificates.Import(Convert.FromBase64String(identityCertificate)); 75 76 X509Certificate2 primaryCertificate = supportingCertificates[0]; 77 supportingCertificates.RemoveAt(0); 78 EndpointIdentity ei = EndpointIdentity.CreateX509CertificateIdentity(primaryCertificate, supportingCertificates); 79 80 cl.Endpoint.Address = new EndpointAddress(new Uri(remoteAddress), ei); 81 } 55 82 56 83 return cl; -
branches/OaaS/HeuristicLab.Clients.Hive/3.3/IHiveServiceLocator.cs
r7259 r8251 26 26 string Username { get; set; } 27 27 string Password { get; set; } 28 string RemoteAddress { get; set; } 29 string IdentityCertificate { get; set; } 28 30 void CallHiveService(Action<IHiveService> call); 29 31 T CallHiveService<T>(Func<IHiveService, T> call);
Note: See TracChangeset
for help on using the changeset viewer.