Changeset 948
- Timestamp:
- 12/10/08 15:03:00 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Contracts/HeuristicLab.Hive.Contracts.csproj
r934 r948 89 89 <Compile Include="Interfaces\ILifecycleManager.cs" /> 90 90 <Compile Include="Interfaces\IServerConsoleFacade.cs" /> 91 <Compile Include="Interfaces\ITransactionManager.cs" /> 91 92 <Compile Include="Interfaces\IUserRoleManager.cs" /> 92 93 <Compile Include="JobBase.cs" /> -
trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/ILifecycleManager.cs
r925 r948 36 36 37 37 /// <summary> 38 /// Gets the transaction manager 39 /// </summary> 40 /// <returns></returns> 41 ITransactionManager GetTransactionManager(); 42 43 /// <summary> 38 44 /// Shuts the application down 39 45 /// </summary> 40 void Sh tudown();46 void Shutdown(); 41 47 } 42 48 } -
trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientAdapter.cs
r936 r948 37 37 new dsHiveServer.ClientDataTable(); 38 38 39 private IResourceAdapter resAdapter = 40 ServiceLocator.GetResourceAdapter(); 39 private IResourceAdapter resAdapter = null; 40 41 private IResourceAdapter ResAdapter { 42 get { 43 if (resAdapter == null) 44 resAdapter = ServiceLocator.GetResourceAdapter(); 45 46 return resAdapter; 47 } 48 } 41 49 42 50 public ClientAdapter() { … … 53 61 /*Parent - resource*/ 54 62 client.ResourceId = row.ResourceId; 55 resAdapter.GetResourceById(client);63 ResAdapter.GetResourceById(client); 56 64 57 65 /*ClientInfo*/ … … 115 123 public void UpdateClient(ClientInfo client) { 116 124 if (client != null) { 117 resAdapter.UpdateResource(client);125 ResAdapter.UpdateResource(client); 118 126 119 127 dsHiveServer.ClientRow row = … … 179 187 data.RemoveClientRow(row); 180 188 181 return resAdapter.DeleteResource(client);189 return ResAdapter.DeleteResource(client); 182 190 } 183 191 } -
trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/TransactionManager.cs
r925 r948 26 26 using HeuristicLab.Hive.Server.Core.InternalInterfaces.DataAccess; 27 27 using System.Timers; 28 using HeuristicLab.Hive.Contracts.Interfaces; 28 29 29 30 namespace HeuristicLab.Hive.Server.ADODataAccess { -
trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/UserAdapter.cs
r939 r948 37 37 new dsHiveServer.HiveUserDataTable(); 38 38 39 private IPermissionOwnerAdapter permOwnerAdapter = 40 ServiceLocator.GetPermissionOwnerAdapter(); 39 private IPermissionOwnerAdapter permOwnerAdapter = null; 40 41 private IPermissionOwnerAdapter PermOwnerAdapter { 42 get { 43 if (permOwnerAdapter == null) 44 permOwnerAdapter = ServiceLocator.GetPermissionOwnerAdapter(); 45 46 return permOwnerAdapter; 47 } 48 } 41 49 42 50 private IUserGroupAdapter userGroupAdapter = null; 51 52 private IUserGroupAdapter UserGroupAdapter { 53 get { 54 if(userGroupAdapter == null) { 55 userGroupAdapter = ServiceLocator.GetUserGroupAdapter(); 56 } 57 58 return userGroupAdapter; 59 } 60 } 43 61 44 62 public UserAdapter() { … … 55 73 /*Parent - PermissionOwner*/ 56 74 user.PermissionOwnerId = row.PermissionOwnerId; 57 permOwnerAdapter.GetPermissionOwnerById(user);75 PermOwnerAdapter.GetPermissionOwnerById(user); 58 76 59 77 /*User*/ … … 83 101 public void UpdateUser(User user) { 84 102 if (user != null) { 85 permOwnerAdapter.UpdatePermissionOwner(user);103 PermOwnerAdapter.UpdatePermissionOwner(user); 86 104 87 105 dsHiveServer.HiveUserRow row = … … 116 134 117 135 PermissionOwner permOwner = 118 permOwnerAdapter.GetPermissionOwnerByName(name);136 PermOwnerAdapter.GetPermissionOwnerByName(name); 119 137 120 138 if (permOwner != null) { … … 152 170 153 171 if (row != null) { 154 if (userGroupAdapter == null)155 userGroupAdapter =156 ServiceLocator.GetUserGroupAdapter();157 158 172 ICollection<UserGroup> userGroups = 159 userGroupAdapter.MemberOf(user);173 UserGroupAdapter.MemberOf(user); 160 174 161 175 foreach (UserGroup group in userGroups) { 162 176 group.Members.Remove(user); 163 userGroupAdapter.UpdateUserGroup(group);177 UserGroupAdapter.UpdateUserGroup(group); 164 178 } 165 179 166 180 data.RemoveHiveUserRow(row); 167 181 168 return permOwnerAdapter.DeletePermissionOwner(user);182 return PermOwnerAdapter.DeletePermissionOwner(user); 169 183 } 170 184 } -
trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/UserGroupAdapter.cs
r939 r948 44 44 new dsHiveServer.PermissionOwner_UserGroupDataTable(); 45 45 46 private IPermissionOwnerAdapter permOwnerAdapter = 47 ServiceLocator.GetPermissionOwnerAdapter(); 48 49 private IUserAdapter userAdapter = 50 ServiceLocator.GetUserAdapter(); 46 private IPermissionOwnerAdapter permOwnerAdapter = null; 47 48 private IPermissionOwnerAdapter PermOwnerAdapter { 49 get { 50 if (permOwnerAdapter == null) 51 permOwnerAdapter = ServiceLocator.GetPermissionOwnerAdapter(); 52 53 return permOwnerAdapter; 54 } 55 } 56 57 private IUserAdapter userAdapter = null; 58 59 private IUserAdapter UserAdapter { 60 get { 61 if (userAdapter == null) 62 userAdapter = ServiceLocator.GetUserAdapter(); 63 64 return userAdapter; 65 } 66 } 51 67 52 68 public UserGroupAdapter() { … … 65 81 /*Parent - Permission Owner*/ 66 82 userGroup.PermissionOwnerId = row.PermissionOwnerId; 67 permOwnerAdapter.GetPermissionOwnerById(userGroup);83 PermOwnerAdapter.GetPermissionOwnerById(userGroup); 68 84 69 85 //first check for created references … … 88 104 if (permOwner == null) { 89 105 PermissionOwner permissionOwner = 90 userAdapter.GetUserById(permOwnerUserGroupRow.PermissionOwnerId);106 UserAdapter.GetUserById(permOwnerUserGroupRow.PermissionOwnerId); 91 107 92 108 if (permissionOwner == null) { … … 133 149 //first update the member to make sure it exists in the DB 134 150 if (permOwner is User) { 135 userAdapter.UpdateUser(permOwner as User);151 UserAdapter.UpdateUser(permOwner as User); 136 152 } else if (permOwner is UserGroup) { 137 153 UpdateUserGroup(permOwner as UserGroup); … … 201 217 public void UpdateUserGroup(UserGroup group) { 202 218 if (group != null) { 203 permOwnerAdapter.UpdatePermissionOwner(group);219 PermOwnerAdapter.UpdatePermissionOwner(group); 204 220 205 221 dsHiveServer.UserGroupRow row = … … 292 308 293 309 data.RemoveUserGroupRow(row); 294 return permOwnerAdapter.DeletePermissionOwner(group);310 return PermOwnerAdapter.DeletePermissionOwner(group); 295 311 } 296 312 } -
trunk/sources/HeuristicLab.Hive.Server.Core/HeuristicLab.Hive.Server.Core.csproj
r934 r948 75 75 <Compile Include="InternalInterfaces\DataAccess\IPermissionOwnerAdapter.cs" /> 76 76 <Compile Include="InternalInterfaces\DataAccess\IResourceAdapter.cs" /> 77 <Compile Include="InternalInterfaces\DataAccess\ITransactionManager.cs" />78 77 <Compile Include="InternalInterfaces\DataAccess\IUserAdapter.cs" /> 79 78 <Compile Include="InternalInterfaces\DataAccess\IUserGroupAdapter.cs" /> -
trunk/sources/HeuristicLab.Hive.Server.Core/LifecycleManager.cs
r925 r948 25 25 using System.Text; 26 26 using HeuristicLab.Hive.Contracts.Interfaces; 27 using HeuristicLab.Hive.Server.Core.InternalInterfaces.DataAccess; 27 28 28 29 namespace HeuristicLab.Hive.Server.Core { … … 34 35 } 35 36 36 public void Shtudown() { 37 public ITransactionManager GetTransactionManager() { 38 return ServiceLocator.GetTransactionManager(); 39 } 40 41 public void Shutdown() { 37 42 ServiceLocator.GetTransactionManager().UpdateDB(); 38 43 } -
trunk/sources/HeuristicLab.Hive.Server.Core/ServiceLocator.cs
r925 r948 23 23 using HeuristicLab.PluginInfrastructure; 24 24 using System.Runtime.CompilerServices; 25 using HeuristicLab.Hive.Contracts.Interfaces; 25 26 26 27 /// <summary> -
trunk/sources/HeuristicLab.Hive.Server/HiveServerApplication.cs
r925 r948 147 147 148 148 lifecycleManager.Init(); 149 //sync with db every 5 minutes 150 lifecycleManager.GetTransactionManager().EnableAutoUpdate( 151 new TimeSpan(0, 5, 0)); 149 152 150 153 Form mainForm = new MainForm(clientCommunicator.BaseAddresses[0], … … 153 156 Application.Run(mainForm); 154 157 155 lifecycleManager.Sh tudown();158 lifecycleManager.Shutdown(); 156 159 } 157 160
Note: See TracChangeset
for help on using the changeset viewer.