Changeset 4494 for trunk/sources/HeuristicLab.Services.Deployment
- Timestamp:
- 09/26/10 00:48:11 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Services.Deployment/3.3
- Files:
-
- 3 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Services.Deployment/3.3/AdminService.cs
r4493 r4494 23 23 24 24 namespace HeuristicLab.Services.Deployment { 25 public class Admin : IAdmin{26 #region IAdmin Members25 public class AdminService : IAdminService { 26 #region IAdminService Members 27 27 [PrincipalPermission(SecurityAction.Demand, Role = "Deployment Administrator")] 28 28 public void DeployProduct(ProductDescription product) { -
trunk/sources/HeuristicLab.Services.Deployment/3.3/App.config
r4307 r4494 1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <configuration> 3 <configSections>4 </configSections>5 3 <system.diagnostics> 6 4 <!-- for logging. Make sure the IIS application user has write access rights for the output directory --> … … 41 39 </sharedListeners--> 42 40 </system.diagnostics> 41 43 42 <connectionStrings> 44 <remove name="LocalSqlServer" /> 45 <add connectionString="Server=SERVICES;Database=HeuristicLab.Deployment;Integrated Security=SSPI" name="HeuristicLab.Services.Deployment.DataAccess.Properties.Settings.HeuristicLab_PluginStoreConnectionString" /> 46 <add name="HeuristicLab.Authentication" connectionString="Initial Catalog=HeuristicLab.Authentication;data source=localhost;Integrated Security=SSPI;" /> 43 <add name="HeuristicLab.Authentication" 44 connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Authentication" /> 45 <add name="HeuristicLab.Services.Deployment.DataAccess.Properties.Settings.HeuristicLab_DeploymentConnectionString" 46 connectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Deployment" /> 47 47 </connectionStrings> 48 48 49 <system.webServer> 49 50 <security> … … 53 54 </security> 54 55 </system.webServer> 56 55 57 <system.web> 56 <compilation debug=" false" />58 <compilation debug="true" /> 57 59 <httpRuntime maxRequestLength="2097151" /> 58 60 <membership defaultProvider="AspNetSqlMembershipProvider"> 59 61 <providers> 60 62 <clear /> 61 <add name="AspNetSqlMemberShipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="HeuristicLab.Authentication" applicationName="HeuristicLab.Authentication" enablePasswordReset="false" enablePasswordRetrieval="false" passwordFormat="Hashed" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="8" /> 63 <add name="AspNetSqlMemberShipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 64 connectionStringName="HeuristicLab.Authentication" applicationName="HeuristicLab.Authentication" enablePasswordReset="false" 65 enablePasswordRetrieval="false" passwordFormat="Hashed" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" 66 minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="8" /> 62 67 </providers> 63 68 </membership> … … 66 71 <providers> 67 72 <clear /> 68 <add name="AspNetSqlRoleProvider" connectionStringName="HeuristicLab.Authentication" applicationName="HeuristicLab.Authentication" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 73 <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 74 connectionStringName="HeuristicLab.Authentication" applicationName="HeuristicLab.Authentication" /> 69 75 </providers> 70 76 </roleManager> 71 77 </system.web> 78 72 79 <!-- When deploying the service library project, the content of the config file must be added to the host's 73 80 app.config file. System.Configuration does not support config files for libraries. --> … … 86 93 </mexHttpBinding> 87 94 </bindings> 95 88 96 <diagnostics performanceCounters="Default"> 89 97 <!--<messageLogging logMalformedMessages="false" logMessagesAtTransportLevel="false" />--> 90 98 </diagnostics> 99 100 <behaviors> 101 <endpointBehaviors> 102 <behavior name="DefaultEndpointBehavior"> 103 <dataContractSerializer maxItemsInObjectGraph="1000000" /> 104 </behavior> 105 </endpointBehaviors> 106 107 <serviceBehaviors> 108 <behavior name="DefaultServiceBehavior"> 109 <serviceMetadata httpGetEnabled="true" /> 110 <serviceDebug includeExceptionDetailInFaults="true" /> 111 <serviceCredentials> 112 <serviceCertificate findValue="localhost" storeLocation="LocalMachine" 113 storeName="My" x509FindType="FindBySubjectName" /> 114 <userNameAuthentication userNamePasswordValidationMode="MembershipProvider" 115 membershipProviderName="AspNetSqlMembershipProvider" /> 116 </serviceCredentials> 117 <serviceAuthorization principalPermissionMode="UseAspNetRoles" 118 roleProviderName="AspNetSqlRoleProvider" /> 119 </behavior> 120 </serviceBehaviors> 121 </behaviors> 122 91 123 <services> 92 <service behaviorConfiguration="HeuristicLab.Services.Deployment.UpdateBehavior" 93 name="HeuristicLab.Services.Deployment.Update"> 94 <endpoint address="" behaviorConfiguration="SerializationBehavior" 95 binding="wsHttpBinding" bindingConfiguration="DefaultWsHttpBinding" 96 contract="HeuristicLab.Services.Deployment.IUpdate" /> 97 <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="DefaultMexHttpBinding" 98 contract="IMetadataExchange" /> 124 <service name="HeuristicLab.Services.Deployment.UpdateService" behaviorConfiguration="DefaultServiceBehavior"> 125 <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="DefaultMexHttpBinding" contract="IMetadataExchange" /> 126 <endpoint behaviorConfiguration="DefaultEndpointBehavior" binding="wsHttpBinding" bindingConfiguration="DefaultWsHttpBinding" 127 contract="HeuristicLab.Services.Deployment.IUpdateService" /> 99 128 <host> 100 129 <baseAddresses> 101 <add baseAddress="http://localhost:8732/Design_Time_Addresses/Deployment-3.3/Update " />130 <add baseAddress="http://localhost:8732/Design_Time_Addresses/Deployment-3.3/UpdateService" /> 102 131 </baseAddresses> 103 132 </host> 104 133 </service> 105 <service behaviorConfiguration="HeuristicLab.Services.Deployment.AdminBehavior" 106 name="HeuristicLab.Services.Deployment.Admin"> 107 <endpoint address="" behaviorConfiguration="SerializationBehavior" 108 binding="wsHttpBinding" bindingConfiguration="DefaultWsHttpBinding" 109 contract="HeuristicLab.Services.Deployment.IAdmin" /> 110 <endpoint address="mex" behaviorConfiguration="SerializationBehavior" 111 binding="mexHttpBinding" bindingConfiguration="DefaultMexHttpBinding" 112 contract="IMetadataExchange" /> 134 135 <service name="HeuristicLab.Services.Deployment.AdminService" behaviorConfiguration="DefaultServiceBehavior"> 136 <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="DefaultMexHttpBinding" contract="IMetadataExchange" /> 137 <endpoint behaviorConfiguration="DefaultEndpointBehavior" binding="wsHttpBinding" bindingConfiguration="DefaultWsHttpBinding" 138 contract="HeuristicLab.Services.Deployment.IAdminService" /> 113 139 <host> 114 140 <baseAddresses> 115 <add baseAddress="http://localhost:8732/Design_Time_Addresses/Deployment-3.3/Admin " />141 <add baseAddress="http://localhost:8732/Design_Time_Addresses/Deployment-3.3/AdminService" /> 116 142 </baseAddresses> 117 143 </host> 118 144 </service> 119 145 </services> 120 <behaviors>121 <endpointBehaviors>122 <behavior name="SerializationBehavior">123 <dataContractSerializer maxItemsInObjectGraph="1000000" />124 </behavior>125 </endpointBehaviors>126 <serviceBehaviors>127 <behavior name="HeuristicLab.Services.Deployment.UpdateBehavior">128 <serviceMetadata httpGetEnabled="true" />129 <serviceDebug includeExceptionDetailInFaults="false" />130 <serviceCredentials>131 <serviceCertificate findValue="localhost" storeLocation="LocalMachine"132 storeName="My" x509FindType="FindBySubjectName" />133 <userNameAuthentication userNamePasswordValidationMode="MembershipProvider"134 membershipProviderName="AspNetSqlMembershipProvider" />135 </serviceCredentials>136 <serviceAuthorization principalPermissionMode="UseAspNetRoles"137 roleProviderName="AspNetSqlRoleProvider" />138 </behavior>139 <behavior name="HeuristicLab.Services.Deployment.AdminBehavior">140 <serviceMetadata httpGetEnabled="true" />141 <serviceDebug includeExceptionDetailInFaults="false" />142 <serviceCredentials>143 <serviceCertificate findValue="localhost" storeLocation="LocalMachine"144 storeName="My" x509FindType="FindBySubjectName" />145 <userNameAuthentication userNamePasswordValidationMode="MembershipProvider"146 membershipProviderName="AspNetSqlMembershipProvider" />147 </serviceCredentials>148 <serviceAuthorization principalPermissionMode="UseAspNetRoles"149 roleProviderName="AspNetSqlRoleProvider" />150 </behavior>151 </serviceBehaviors>152 </behaviors>153 146 </system.serviceModel> 154 147 </configuration> -
trunk/sources/HeuristicLab.Services.Deployment/3.3/HeuristicLab.Services.Deployment-3.3.csproj
r4307 r4494 98 98 </ItemGroup> 99 99 <ItemGroup> 100 <Compile Include="Admin .cs" />101 <Compile Include="IAdmin .cs" />102 <Compile Include="IUpdate .cs" />100 <Compile Include="AdminService.cs" /> 101 <Compile Include="IAdminService.cs" /> 102 <Compile Include="IUpdateService.cs" /> 103 103 <Compile Include="PluginDescription.cs" /> 104 104 <Compile Include="PluginStore.cs" /> … … 110 110 <DependentUpon>Settings.settings</DependentUpon> 111 111 </Compile> 112 <Compile Include="Update .cs" />112 <Compile Include="UpdateService.cs" /> 113 113 </ItemGroup> 114 114 <ItemGroup> -
trunk/sources/HeuristicLab.Services.Deployment/3.3/IAdminService.cs
r4493 r4494 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Linq;25 using System.Runtime.Serialization;26 22 using System.ServiceModel; 27 using System.Text;28 using HeuristicLab.Services.Deployment.DataAccess;29 23 30 24 namespace HeuristicLab.Services.Deployment { 31 25 [ServiceContract] 32 public interface IAdmin {26 public interface IAdminService { 33 27 [OperationContract] 34 28 void DeployProduct(ProductDescription product); -
trunk/sources/HeuristicLab.Services.Deployment/3.3/IUpdateService.cs
r4493 r4494 20 20 #endregion 21 21 22 using System;23 22 using System.Collections.Generic; 24 using System.Linq;25 using System.Runtime.Serialization;26 23 using System.ServiceModel; 27 using System.Text;28 using HeuristicLab.Services.Deployment.DataAccess;29 24 30 25 namespace HeuristicLab.Services.Deployment { 31 26 [ServiceContract] 32 public interface IUpdate {27 public interface IUpdateService { 33 28 [OperationContract] 34 29 byte[] GetPlugin(PluginDescription description); -
trunk/sources/HeuristicLab.Services.Deployment/3.3/PluginStore.cs
r3612 r4494 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Data.SqlClient; 24 25 using System.Linq; 25 using System.Text;26 using System.Data.Common;27 26 using System.Transactions; 28 using System.Data.SqlClient;29 27 using HeuristicLab.Services.Deployment.DataAccess; 30 28 … … 38 36 public IEnumerable<ProductDescription> Products { 39 37 get { 40 using (var ctx = new PluginStoreClassesDataContext()) {38 using (var ctx = new DeploymentDataContext()) { 41 39 return (from p in ctx.Products 42 40 let plugins = from pair in ctx.ProductPlugins … … 52 50 public IEnumerable<PluginDescription> Plugins { 53 51 get { 54 using (var ctx = new PluginStoreClassesDataContext()) {52 using (var ctx = new DeploymentDataContext()) { 55 53 return (from plugin in ctx.Plugins 56 54 select MakePluginDescription(ctx, plugin)).ToList(); … … 60 58 61 59 public byte[] PluginFile(PluginDescription pluginDescription) { 62 using (var ctx = new PluginStoreClassesDataContext()) {60 using (var ctx = new DeploymentDataContext()) { 63 61 return GetExistingPlugin(ctx, pluginDescription.Name, pluginDescription.Version).PluginPackage.Data.ToArray(); 64 62 } … … 66 64 67 65 public void Persist(PluginDescription pluginDescription, byte[] pluginPackage) { 68 using (var ctx = new PluginStoreClassesDataContext()) {66 using (var ctx = new DeploymentDataContext()) { 69 67 try { 70 68 using (var transaction = new TransactionScope()) { … … 91 89 92 90 public void Persist(ProductDescription productDescription) { 93 using (var ctx = new PluginStoreClassesDataContext()) {91 using (var ctx = new DeploymentDataContext()) { 94 92 try { 95 93 using (var transaction = new TransactionScope()) { … … 112 110 } 113 111 public void Delete(ProductDescription productDescription) { 114 using (var ctx = new PluginStoreClassesDataContext()) {112 using (var ctx = new DeploymentDataContext()) { 115 113 try { 116 114 using (var transaction = new TransactionScope()) { … … 136 134 137 135 #region insert/update/delete product 138 private void InsertOrUpdateProduct( PluginStoreClassesDataContext ctx, ProductDescription product) {136 private void InsertOrUpdateProduct(DeploymentDataContext ctx, ProductDescription product) { 139 137 var productEntity = (from p in ctx.Products 140 138 where p.Name == product.Name … … 158 156 } 159 157 160 private void DeleteProductPlugins( PluginStoreClassesDataContext ctx, Product productEntity) {158 private void DeleteProductPlugins(DeploymentDataContext ctx, Product productEntity) { 161 159 var oldPlugins = (from p in ctx.ProductPlugins 162 160 where p.ProductId == productEntity.Id … … 168 166 169 167 #region insert/update plugins 170 private Plugin InsertOrUpdatePlugin( PluginStoreClassesDataContext ctx, PluginDescription pluginDescription) {168 private Plugin InsertOrUpdatePlugin(DeploymentDataContext ctx, PluginDescription pluginDescription) { 171 169 var pluginEntity = (from p in ctx.Plugins 172 170 where p.Name == pluginDescription.Name … … 183 181 } 184 182 185 private void UpdatePlugin( PluginStoreClassesDataContext ctx, Plugin pluginEntity, PluginDescription pluginDescription) {183 private void UpdatePlugin(DeploymentDataContext ctx, Plugin pluginEntity, PluginDescription pluginDescription) { 186 184 // update plugin data 187 185 pluginEntity.License = pluginDescription.LicenseText; … … 205 203 206 204 207 private void DeleteOldDependencies( PluginStoreClassesDataContext ctx, Plugin pluginEntity) {205 private void DeleteOldDependencies(DeploymentDataContext ctx, Plugin pluginEntity) { 208 206 var oldDependencies = (from dep in ctx.Dependencies 209 207 where dep.PluginId == pluginEntity.Id … … 216 214 217 215 #region product <-> productDescription transformation 218 private ProductDescription MakeProductDescription( PluginStoreClassesDataContext ctx, Product p, IEnumerable<Plugin> plugins) {216 private ProductDescription MakeProductDescription(DeploymentDataContext ctx, Product p, IEnumerable<Plugin> plugins) { 219 217 var desc = new ProductDescription(p.Name, new Version(p.Version), from plugin in plugins 220 218 select MakePluginDescription(ctx, plugin)); … … 232 230 // cache for plugin descriptions 233 231 private Dictionary<long, PluginDescription> pluginDescriptions = new Dictionary<long, PluginDescription>(); 234 private PluginDescription MakePluginDescription( PluginStoreClassesDataContext ctx, Plugin plugin) {232 private PluginDescription MakePluginDescription(DeploymentDataContext ctx, Plugin plugin) { 235 233 if (!pluginDescriptions.ContainsKey(plugin.Id)) { 236 234 // no cached description -> create new … … 267 265 268 266 #region helper queries 269 private Plugin GetExistingPlugin( PluginStoreClassesDataContext ctx, string name, Version version) {267 private Plugin GetExistingPlugin(DeploymentDataContext ctx, string name, Version version) { 270 268 return (from p in ctx.Plugins 271 269 where p.Name == name … … 274 272 } 275 273 276 private Product GetExistingProduct( PluginStoreClassesDataContext ctx, string name, Version version) {274 private Product GetExistingProduct(DeploymentDataContext ctx, string name, Version version) { 277 275 return (from p in ctx.Products 278 276 where p.Name == name … … 281 279 } 282 280 283 private IEnumerable<Plugin> GetDependencies( PluginStoreClassesDataContext ctx, Plugin plugin) {281 private IEnumerable<Plugin> GetDependencies(DeploymentDataContext ctx, Plugin plugin) { 284 282 return from pair in ctx.Dependencies 285 283 from dependency in ctx.Plugins -
trunk/sources/HeuristicLab.Services.Deployment/3.3/UpdateService.cs
r4493 r4494 20 20 #endregion 21 21 22 using System;23 22 using System.Collections.Generic; 24 using System.Linq;25 using System.Runtime.Serialization;26 using System.ServiceModel;27 using System.Text;28 using HeuristicLab.Services.Deployment.DataAccess;29 23 30 24 namespace HeuristicLab.Services.Deployment { 31 public class Update : IUpdate {32 #region IUpdate Members25 public class UpdateService : IUpdateService { 26 #region IUpdateService Members 33 27 34 28 public byte[] GetPlugin(PluginDescription description) {
Note: See TracChangeset
for help on using the changeset viewer.