- Timestamp:
- 03/12/10 10:57:21 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/JobAdapter.cs
r2117 r3011 37 37 class JobAdapter : 38 38 DataAdapterBase<dsHiveServerTableAdapters.JobTableAdapter, 39 Job ,39 JobDto, 40 40 dsHiveServer.JobRow>, 41 41 IJobAdapter { … … 87 87 if (clientAdapter == null) 88 88 clientAdapter = 89 this.Session.GetDataAdapter<Client Info, IClientAdapter>();89 this.Session.GetDataAdapter<ClientDto, IClientAdapter>(); 90 90 91 91 return clientAdapter; … … 112 112 if (pluginInfoAdapter == null) { 113 113 pluginInfoAdapter = 114 this.Session.GetDataAdapter<HivePluginInfo , IPluginInfoAdapter>();114 this.Session.GetDataAdapter<HivePluginInfoDto, IPluginInfoAdapter>(); 115 115 } 116 116 … … 125 125 if (projectAdapter == null) { 126 126 projectAdapter = 127 this.Session.GetDataAdapter<Project , IProjectAdapter>();127 this.Session.GetDataAdapter<ProjectDto, IProjectAdapter>(); 128 128 } 129 129 … … 137 137 138 138 #region Overrides 139 protected override Job ConvertRow(dsHiveServer.JobRow row,140 Job job) {139 protected override JobDto ConvertRow(dsHiveServer.JobRow row, 140 JobDto job) { 141 141 if (row != null && job != null) { 142 142 job.Id = row.JobId; … … 203 203 job.PluginsNeeded.Clear(); 204 204 foreach (Guid requiredPlugin in requiredPlugins) { 205 HivePluginInfo pluginInfo =205 HivePluginInfoDto pluginInfo = 206 206 PluginInfoAdapter.GetById(requiredPlugin); 207 207 … … 218 218 } 219 219 220 protected override dsHiveServer.JobRow ConvertObj(Job job,220 protected override dsHiveServer.JobRow ConvertObj(JobDto job, 221 221 dsHiveServer.JobRow row) { 222 222 if (job != null && row != null) { … … 250 250 row.SetJobStateNull(); 251 251 252 //Todo: commout 253 /* 252 254 row.Percentage = job.Percentage; 253 255 … … 266 268 row.CoresNeeded = job.CoresNeeded; 267 269 268 row.MemoryNeeded = job.MemoryNeeded; 270 row.MemoryNeeded = job.MemoryNeeded;*/ 269 271 270 272 if (job.Project != null) … … 279 281 280 282 #region IJobAdapter Members 281 public ICollection<Job > GetAllSubjobs(Jobjob) {283 public ICollection<JobDto> GetAllSubjobs(JobDto job) { 282 284 if (job != null) { 283 285 return … … 291 293 } 292 294 293 public ICollection<Job > GetJobsByState(State state) {295 public ICollection<JobDto> GetJobsByState(State state) { 294 296 return 295 297 base.FindMultiple( … … 299 301 } 300 302 301 public ICollection<Job > GetJobsOf(ClientInfo client) {303 public ICollection<JobDto> GetJobsOf(ClientDto client) { 302 304 if (client != null) { 303 305 return … … 311 313 } 312 314 313 public ICollection<Job > GetActiveJobsOf(ClientInfo client) {315 public ICollection<JobDto> GetActiveJobsOf(ClientDto client) { 314 316 315 317 if (client != null) { … … 324 326 } 325 327 326 public ICollection<Job > GetJobsOf(Guid userId) {328 public ICollection<JobDto> GetJobsOf(Guid userId) { 327 329 return 328 330 base.FindMultiple( … … 332 334 } 333 335 334 public ICollection<Job > FindJobs(State state, int cores, int memory,336 public ICollection<JobDto> FindJobs(State state, int cores, int memory, 335 337 Guid resourceId) { 336 338 return … … 345 347 } 346 348 347 public ICollection<Job > GetJobsByProject(Guid projectId) {349 public ICollection<JobDto> GetJobsByProject(Guid projectId) { 348 350 return 349 351 base.FindMultiple( … … 353 355 } 354 356 355 protected override void doUpdate(Job obj) {357 protected override void doUpdate(JobDto obj) { 356 358 if (obj != null) { 357 359 ProjectAdapter.Update(obj.Project); … … 364 366 List<Guid> relationships = 365 367 new List<Guid>(); 366 foreach (HivePluginInfo pluginInfo in obj.PluginsNeeded) {368 foreach (HivePluginInfoDto pluginInfo in obj.PluginsNeeded) { 367 369 //first check if pluginInfo already exists in the db 368 HivePluginInfo found = PluginInfoAdapter.GetByNameVersionBuilddate(370 HivePluginInfoDto found = PluginInfoAdapter.GetByNameVersionBuilddate( 369 371 pluginInfo.Name, pluginInfo.Version, pluginInfo.BuildDate); 370 372 if (found != null) { … … 384 386 } 385 387 386 protected override bool doDelete(Job job) {388 protected override bool doDelete(JobDto job) { 387 389 if (job != null) { 388 390 dsHiveServer.JobRow row = … … 403 405 404 406 //delete orphaned pluginInfos 405 ICollection<HivePluginInfo > orphanedPluginInfos =407 ICollection<HivePluginInfoDto> orphanedPluginInfos = 406 408 PluginInfoAdapter.GetOrphanedPluginInfos(); 407 foreach(HivePluginInfo orphanedPlugin in orphanedPluginInfos) {409 foreach(HivePluginInfoDto orphanedPlugin in orphanedPluginInfos) { 408 410 PluginInfoAdapter.Delete(orphanedPlugin); 409 411 }
Note: See TracChangeset
for help on using the changeset viewer.