Changeset 1377 for trunk/sources/HeuristicLab.Hive.Server.Core
- Timestamp:
- 03/20/09 13:37:39 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Hive.Server.Core
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
r1374 r1377 28 28 using HeuristicLab.Hive.Contracts; 29 29 using HeuristicLab.Core; 30 using HeuristicLab.Hive.Server. Core.InternalInterfaces.DataAccess;30 using HeuristicLab.Hive.Server.DataAccess; 31 31 using System.Resources; 32 32 using System.Reflection; -
trunk/sources/HeuristicLab.Hive.Server.Core/ClientManager.cs
r1121 r1377 27 27 using HeuristicLab.Hive.Contracts.BusinessObjects; 28 28 using HeuristicLab.Hive.Contracts; 29 using HeuristicLab.Hive.Server. Core.InternalInterfaces.DataAccess;29 using HeuristicLab.Hive.Server.DataAccess; 30 30 31 31 namespace HeuristicLab.Hive.Server.Core { -
trunk/sources/HeuristicLab.Hive.Server.Core/DbTestApp.cs
r1025 r1377 27 27 using HeuristicLab.Hive.Contracts; 28 28 using HeuristicLab.Hive.Contracts.Interfaces; 29 using HeuristicLab.Hive.Server. Core.InternalInterfaces.DataAccess;29 using HeuristicLab.Hive.Server.DataAccess; 30 30 using HeuristicLab.Hive.Contracts.BusinessObjects; 31 31 using System.Diagnostics; 32 using HeuristicLab.DataAccess.Interfaces; 32 33 33 34 namespace HeuristicLab.Hive.Server { … … 70 71 } 71 72 72 private void TestUserAdapter() {73 IUserAdapter userAdapter =74 ServiceLocator.GetUserAdapter();75 76 User user = new User();77 user.Name = "TestDummy";78 79 userAdapter.Update(user);80 81 User userRead =82 userAdapter.GetById(user.Id);83 Debug.Assert(84 userRead != null &&85 user.Id == userRead.Id);86 87 user.Password = "passme";88 userAdapter.Update(user);89 userRead =90 userAdapter.GetByName(user.Name);91 Debug.Assert(92 userRead != null &&93 userRead.Name == user.Name &&94 userRead.Password == user.Password);95 96 ICollection<User> users =97 userAdapter.GetAll();98 int count = users.Count;99 100 userAdapter.Delete(user);101 102 users = userAdapter.GetAll();103 Debug.Assert(count - 1 == users.Count);104 }105 106 private void TestUserGroupAdapter() {107 IUserGroupAdapter userGroupAdapter =108 ServiceLocator.GetUserGroupAdapter();109 110 User user =111 new User();112 user.Name = "Stefan";113 114 User user2 =115 new User();116 user2.Name = "Martin";117 118 User user3 =119 new User();120 user3.Name = "Heinz";121 122 UserGroup group =123 new UserGroup();124 125 UserGroup subGroup =126 new UserGroup();127 subGroup.Members.Add(user);128 129 group.Members.Add(user3);130 group.Members.Add(user2);131 group.Members.Add(subGroup);132 133 userGroupAdapter.Update(group);134 135 UserGroup read =136 userGroupAdapter.GetById(group.Id);137 138 ICollection<UserGroup> userGroups =139 userGroupAdapter.GetAll();140 141 IUserAdapter userAdapter =142 ServiceLocator.GetUserAdapter();143 144 userAdapter.Delete(user3);145 146 read =147 userGroupAdapter.GetById(group.Id);148 149 userGroupAdapter.Delete(subGroup);150 151 read =152 userGroupAdapter.GetById(group.Id);153 154 userGroups =155 userGroupAdapter.GetAll();156 157 userGroupAdapter.Delete(group);158 159 userGroups =160 userGroupAdapter.GetAll();161 162 userAdapter.Delete(user);163 userAdapter.Delete(user2);164 }165 166 73 private void TestClientGroupAdapter() { 167 74 IClientGroupAdapter clientGroupAdapter = … … 301 208 302 209 public override void Run() { 303 I TransactionManager transactionManager =304 ServiceLocator.Get TransactionManager();210 IDBSynchronizer transactionManager = 211 ServiceLocator.GetDBSynchronizer(); 305 212 306 213 TestClientAdapter(); 307 214 transactionManager.UpdateDB(); 308 215 309 TestUserAdapter();310 transactionManager.UpdateDB();311 312 TestUserGroupAdapter();313 transactionManager.UpdateDB();314 315 216 TestClientGroupAdapter(); 316 217 transactionManager.UpdateDB(); -
trunk/sources/HeuristicLab.Hive.Server.Core/HeuristicLab.Hive.Server.Core.csproj
r1272 r1377 73 73 <Compile Include="HiveServerCorePlugin.cs" /> 74 74 <Compile Include="HiveServerMessages.Designer.cs" /> 75 <Compile Include="InternalInterfaces\DataAccess\IClientAdapter.cs" />76 <Compile Include="InternalInterfaces\DataAccess\IClientGroupAdapter.cs" />77 <Compile Include="InternalInterfaces\DataAccess\IDataAdapter.cs" />78 <Compile Include="InternalInterfaces\DataAccess\IJobAdapter.cs" />79 <Compile Include="InternalInterfaces\DataAccess\IJobResultsAdapter.cs" />80 <Compile Include="InternalInterfaces\DataAccess\IPermissionOwnerAdapter.cs" />81 <Compile Include="InternalInterfaces\DataAccess\IResourceAdapter.cs" />82 <Compile Include="InternalInterfaces\DataAccess\IUserAdapter.cs" />83 <Compile Include="InternalInterfaces\DataAccess\IUserGroupAdapter.cs" />84 75 <Compile Include="InternalInterfaces\IInternalJobManager.cs" /> 85 76 <Compile Include="InternalInterfaces\IScheduler.cs" /> … … 89 80 <Compile Include="ServerConsoleFacade.cs" /> 90 81 <Compile Include="ServiceLocator.cs" /> 91 <Compile Include="UserRoleManager.cs" />92 82 </ItemGroup> 93 83 <ItemGroup> … … 100 90 <Name>HeuristicLab.Core</Name> 101 91 </ProjectReference> 92 <ProjectReference Include="..\HeuristicLab.DataAccess\HeuristicLab.DataAccess.csproj"> 93 <Project>{9076697B-C151-46CD-95BC-1D059492B478}</Project> 94 <Name>HeuristicLab.DataAccess</Name> 95 </ProjectReference> 102 96 <ProjectReference Include="..\HeuristicLab.Hive.Contracts\HeuristicLab.Hive.Contracts.csproj"> 103 97 <Project>{134F93D7-E7C8-4ECD-9923-7F63259A60D8}</Project> … … 107 101 <Project>{21187322-52DD-4243-80A4-A85F0263E63B}</Project> 108 102 <Name>HeuristicLab.Hive.JobBase</Name> 103 </ProjectReference> 104 <ProjectReference Include="..\HeuristicLab.Hive.Server.DataAccess\HeuristicLab.Hive.Server.DataAccess.csproj"> 105 <Project>{4D5A2A16-66C2-431D-9AA3-BD3041E64B84}</Project> 106 <Name>HeuristicLab.Hive.Server.DataAccess</Name> 109 107 </ProjectReference> 110 108 <ProjectReference Include="..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj"> -
trunk/sources/HeuristicLab.Hive.Server.Core/JobManager.cs
r1172 r1377 27 27 using HeuristicLab.Hive.Contracts.BusinessObjects; 28 28 using HeuristicLab.Hive.Contracts; 29 using HeuristicLab.Hive.Server. Core.InternalInterfaces.DataAccess;29 using HeuristicLab.Hive.Server.DataAccess; 30 30 using HeuristicLab.Hive.Server.Core.InternalInterfaces; 31 31 -
trunk/sources/HeuristicLab.Hive.Server.Core/LifecycleManager.cs
r1133 r1377 25 25 using System.Text; 26 26 using HeuristicLab.Hive.Contracts.Interfaces; 27 using HeuristicLab.Hive.Server. Core.InternalInterfaces.DataAccess;27 using HeuristicLab.Hive.Server.DataAccess; 28 28 using System.Timers; 29 using HeuristicLab.DataAccess.Interfaces; 29 30 30 31 namespace HeuristicLab.Hive.Server.Core { … … 64 65 } 65 66 66 public I TransactionManager GetTransactionManager() {67 return ServiceLocator.Get TransactionManager();67 public IDBSynchronizer GetDBSynchronizer() { 68 return ServiceLocator.GetDBSynchronizer(); 68 69 } 69 70 70 71 public void Shutdown() { 71 ServiceLocator.Get TransactionManager().UpdateDB();72 ServiceLocator.GetDBSynchronizer().UpdateDB(); 72 73 73 74 if (OnShutdown != null) -
trunk/sources/HeuristicLab.Hive.Server.Core/ServerConsoleFacade.cs
r1172 r1377 35 35 private IJobManager jobManager = 36 36 ServiceLocator.GetJobManager(); 37 38 private IUserRoleManager userRoleManager =39 ServiceLocator.GetUserRoleManager();40 37 41 38 private String loginName = null; … … 103 100 104 101 #endregion 105 106 #region IUserRoleManager Members107 108 public ResponseList<HeuristicLab.Hive.Contracts.BusinessObjects.User> GetAllUsers() {109 return userRoleManager.GetAllUsers();110 }111 112 public ResponseObject<User> AddNewUser(User user) {113 return userRoleManager.AddNewUser(user);114 }115 116 public ResponseList<UserGroup> GetAllUserGroups() {117 return userRoleManager.GetAllUserGroups();118 }119 120 public Response RemoveUser(long userId) {121 return userRoleManager.RemoveUser(userId);122 }123 124 public ResponseObject<UserGroup> AddNewUserGroup(UserGroup userGroup) {125 return userRoleManager.AddNewUserGroup(userGroup);126 }127 128 public Response RemoveUserGroup(long groupId) {129 return userRoleManager.RemoveUserGroup(groupId);130 }131 132 public Response AddUserToGroup(long groupId, long userId) {133 return userRoleManager.AddUserToGroup(groupId, userId);134 }135 136 public Response AddUserGroupToGroup(long groupId, long groupToAddId) {137 return userRoleManager.AddUserGroupToGroup(groupId, groupToAddId);138 }139 140 public Response RemovePermissionOwnerFromGroup(long groupId, long userId) {141 return userRoleManager.RemovePermissionOwnerFromGroup(groupId, userId);142 }143 144 #endregion145 146 102 } 147 103 } -
trunk/sources/HeuristicLab.Hive.Server.Core/ServiceLocator.cs
r1272 r1377 20 20 #endregion 21 21 22 using HeuristicLab.Hive.Server. Core.InternalInterfaces.DataAccess;22 using HeuristicLab.Hive.Server.DataAccess; 23 23 using HeuristicLab.PluginInfrastructure; 24 24 using System.Runtime.CompilerServices; … … 26 26 using HeuristicLab.Hive.Server.Core; 27 27 using HeuristicLab.Hive.Server.Core.InternalInterfaces; 28 using HeuristicLab.DataAccess.Interfaces; 28 29 29 30 /// <summary> … … 34 35 new DiscoveryService(); 35 36 36 private static I TransactionManager transManager = null;37 private static IDBSynchronizer transManager = null; 37 38 38 39 private static IClientManager clientManager = null; 39 40 40 41 private static IJobManager jobManager = null; 41 42 private static IUserRoleManager userRoleManager = null;43 42 44 43 private static IClientCommunicator clientCommunicator = null; … … 51 50 52 51 private static IResourceAdapter resourceAdapter = null; 53 54 private static IUserAdapter userAdapter = null;55 56 private static IUserGroupAdapter userGroupAdapter = null;57 58 private static IPermissionOwnerAdapter permOwnerAdapter = null;59 52 60 53 private static IJobAdapter jobAdapter = null; … … 70 63 /// <returns></returns> 71 64 [MethodImpl(MethodImplOptions.Synchronized)] 72 public static I TransactionManager GetTransactionManager() {65 public static IDBSynchronizer GetDBSynchronizer() { 73 66 if (transManager == null) { 74 transManager = discoveryService.GetInstances<I TransactionManager>()[0];67 transManager = discoveryService.GetInstances<IDBSynchronizer>()[0]; 75 68 } 76 69 … … 100 93 101 94 return jobManager; 102 }103 104 /// <summary>105 /// Gets the user role manager106 /// </summary>107 /// <returns></returns>108 [MethodImpl(MethodImplOptions.Synchronized)]109 public static IUserRoleManager GetUserRoleManager() {110 if (userRoleManager == null)111 userRoleManager = new UserRoleManager();112 113 return userRoleManager;114 95 } 115 96 … … 179 160 180 161 /// <summary> 181 /// Gets the user database adapter182 /// </summary>183 /// <returns></returns>184 [MethodImpl(MethodImplOptions.Synchronized)]185 public static IUserAdapter GetUserAdapter() {186 if (userAdapter == null) {187 userAdapter = discoveryService.GetInstances<IUserAdapter>()[0];188 }189 190 return userAdapter;191 }192 193 /// <summary>194 /// Gets the user group database adapter195 /// </summary>196 /// <returns></returns>197 [MethodImpl(MethodImplOptions.Synchronized)]198 public static IUserGroupAdapter GetUserGroupAdapter() {199 if (userGroupAdapter == null) {200 userGroupAdapter = discoveryService.GetInstances<IUserGroupAdapter>()[0];201 }202 203 return userGroupAdapter;204 }205 206 /// <summary>207 /// Gets the permission owner database adapter208 /// </summary>209 /// <returns></returns>210 [MethodImpl(MethodImplOptions.Synchronized)]211 public static IPermissionOwnerAdapter GetPermissionOwnerAdapter() {212 if (permOwnerAdapter == null) {213 permOwnerAdapter = discoveryService.GetInstances<IPermissionOwnerAdapter>()[0];214 }215 216 return permOwnerAdapter;217 }218 219 /// <summary>220 162 /// Gets the job database adapter 221 163 /// </summary>
Note: See TracChangeset
for help on using the changeset viewer.