Changeset 4368 for branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades
- Timestamp:
- 09/07/10 10:22:27 (14 years ago)
- Location:
- branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ClientFacade.cs
r4333 r4368 69 69 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 70 70 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Client)] 71 public ResponseObject<SerializedJob> GetLastSerializedResult(Guid jobId , bool requested, bool snapshot) {71 public ResponseObject<SerializedJob> GetLastSerializedResult(Guid jobId) { 72 72 using (contextFactory.GetContext(false)) { 73 73 ServiceLocator.GetAuthorizationManager().AuthorizeForJobs(jobId); 74 return jobManager.GetLastSerializedResult(jobId, requested, snapshot); 74 return jobManager.GetLastSerializedResult(jobId); 75 } 76 } 77 78 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 79 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Client)] 80 public ResponseObject<SerializedJob> GetSnapshotResult(Guid jobId) { 81 using (contextFactory.GetContext(false)) { 82 ServiceLocator.GetAuthorizationManager().AuthorizeForJobs(jobId); 83 return jobManager.GetSnapshotResult(jobId); 75 84 } 76 85 } … … 103 112 } 104 113 114 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 115 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Client)] 116 public ResponseObject<JobResultList> GetChildJobResults(Guid? parentJobId, bool recursive, bool includeParent) { 117 using (contextFactory.GetContext(false)) { 118 if (parentJobId.HasValue) { 119 ServiceLocator.GetAuthorizationManager().AuthorizeForJobs(parentJobId.Value); 120 } 121 // If parentJobId is null, GetChildJobResults will filter the results for the current user 122 return jobManager.GetChildJobResults(parentJobId, recursive, includeParent); 123 } 124 } 105 125 #endregion 126 127 106 128 } 107 129 } -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ServerConsoleFacade.cs
r4333 r4368 32 32 using HeuristicLab.Hive.Contracts.ResponseObjects; 33 33 using System.Security.Permissions; 34 using HeuristicLab.Hive.JobBase; 34 35 35 36 namespace HeuristicLab.Hive.Server.Core { … … 46 47 } 47 48 49 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 48 50 public Response Login() { 49 51 Response resp = new Response(); … … 129 131 130 132 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 131 public ResponseObject<SerializedJob> GetLastSerializedResult(Guid jobId, bool requested, bool snapshot) { 132 using (contextFactory.GetContext(false)) { 133 return jobManager.GetLastSerializedResult(jobId, requested, snapshot); 133 public ResponseObject<SerializedJob> GetLastSerializedResult(Guid jobId) { 134 using (contextFactory.GetContext(false)) { 135 return jobManager.GetLastSerializedResult(jobId); 136 } 137 } 138 139 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 140 public ResponseObject<SerializedJob> GetSnapshotResult(Guid jobId) { 141 using (contextFactory.GetContext(false)) { 142 return jobManager.GetSnapshotResult(jobId); 134 143 } 135 144 } … … 223 232 using (contextFactory.GetContext()) { 224 233 return jobManager.AddJobWithGroupStrings(job, resources); 234 } 235 } 236 237 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 238 public ResponseObject<JobResultList> GetChildJobResults(Guid? parentJobId, bool recursive, bool includeParent) { 239 using (contextFactory.GetContext()) { 240 return jobManager.GetChildJobResults(parentJobId, recursive, includeParent); 241 } 242 } 243 244 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 245 public ResponseObject<JobDto> AddChildJob(Guid parentJobId, SerializedJob serializedJob) { 246 using (contextFactory.GetContext()) { 247 return jobManager.AddChildJob(parentJobId, serializedJob); 248 } 249 } 250 251 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 252 public ResponseObject<JobDto> PauseJob(SerializedJob serializedJob) { 253 using (contextFactory.GetContext()) { 254 return jobManager.PauseJob(serializedJob); 225 255 } 226 256 } -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/SlaveFacade.cs
r4337 r4368 37 37 using HeuristicLab.Hive.Contracts.ResponseObjects; 38 38 using System.Security.Permissions; 39 using HeuristicLab.Hive.JobBase; 39 40 40 41 namespace HeuristicLab.Hive.Server.Core { … … 42 43 public class SlaveFacade : ISlaveFacade { 43 44 private ISlaveCommunicator slaveCommunicator = ServiceLocator.GetSlaveCommunicator(); 45 private IJobManager jobManager = ServiceLocator.GetJobManager(); 44 46 private IContextFactory contextFactory = ServiceLocator.GetContextFactory(); 45 47 … … 126 128 using (contextFactory.GetContext()) { 127 129 return slaveCommunicator.SetCalendarStatus(slaveId, state); 130 } 131 } 132 133 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 134 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Slave)] 135 public ResponseObject<JobDto> AddChildJob(Guid parentJobId, SerializedJob serializedJob) { 136 using (contextFactory.GetContext()) { 137 return jobManager.AddChildJob(parentJobId, serializedJob); 138 128 139 } 129 140 } … … 186 197 } 187 198 } 199 200 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 201 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Slave)] 202 public ResponseObject<JobDto> PauseJob(SerializedJob serializedJob) { 203 using (contextFactory.GetContext()) { 204 return jobManager.PauseJob(serializedJob); 205 } 206 } 207 208 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 209 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Slave)] 210 public JobResultList GetChildJobResults(Guid? parentJobId, bool recursive, bool includeParent) { 211 using (contextFactory.GetContext(false)) { 212 return jobManager.GetChildJobResults(parentJobId, recursive, includeParent).Obj; 213 } 214 } 215 216 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 217 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Slave)] 218 public SerializedJob GetLastSerializedResult(Guid jobId) { 219 using (contextFactory.GetContext(false)) { 220 return jobManager.GetLastSerializedResult(jobId).Obj; 221 } 222 } 188 223 #endregion 189 224 }
Note: See TracChangeset
for help on using the changeset viewer.