- Timestamp:
- 11/27/08 17:19:51 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/ClientAdapter.cs
r826 r845 29 29 namespace HeuristicLab.Hive.Server.ADODataAccess { 30 30 class ClientAdapter: IClientAdapter { 31 #region IClientAdapter Members32 31 private dsHiveServerTableAdapters.ClientTableAdapter adapter = 33 32 new dsHiveServerTableAdapters.ClientTableAdapter(); … … 35 34 private ResourceAdapter resAdapter = 36 35 new ResourceAdapter(); 36 37 #region IClientAdapter Members 38 private ClientInfo Convert(dsHiveServer.ClientRow row) { 39 if(row != null) { 40 ClientInfo client = new ClientInfo(); 41 42 /*Parent - resource*/ 43 Resource resource = 44 resAdapter.GetResourceById(row.ResourceId); 45 client.ResourceId = resource.ResourceId; 46 client.Name = resource.Name; 47 48 /*ClientInfo*/ 49 client.ClientId = row.GUID; 50 client.CpuSpeedPerCore = row.CPUSpeed; 51 client.Memory = row.Memory; 52 client.Login = row.Login; 53 if (row.Status != null) 54 client.State = (State)Enum.Parse(typeof(State), row.Status, true); 55 client.NrOfCores = row.NumberOfCores; 56 57 //todo: config adapter (client.config) 58 59 return client; 60 } 61 else 62 return null; 63 } 64 65 private dsHiveServer.ClientRow Convert(ClientInfo client, 66 dsHiveServer.ClientRow row) { 67 if (client != null && row != null) { 68 row.ResourceId = client.ResourceId; 69 row.GUID = client.ClientId; 70 row.CPUSpeed = client.CpuSpeedPerCore; 71 row.Memory = client.Memory; 72 row.Login = client.Login; 73 row.Status = client.State.ToString(); 74 row.NumberOfCores = client.NrOfCores; 75 76 //todo: config adapter 77 /*if (client.Config != null) 78 row.ClientConfigId = client.Config.ClientConfigId; 79 else 80 row.ClientConfigId = null;*/ 81 } 82 83 return row; 84 } 37 85 38 86 public void UpdateClient(ClientInfo client) { … … 52 100 } 53 101 54 row.ResourceId = client.ResourceId; 55 row.GUID = client.ClientId; 56 row.CPUSpeed = client.CpuSpeedPerCore; 57 //row.Memory = client.Memory; 58 /*if(client.Login != null) 59 row.Login = client.Login.ToString();*/ 60 row.Status = client.State.ToString(); 61 62 //todo: config adapter 63 /*if (client.Config != null) 64 row.ClientConfigId = client.Config.ClientConfigId;*/ 65 66 row.NumberOfCores = client.NrOfCores; 102 Convert(client, row); 67 103 68 104 adapter.Update(data); 69 105 } 70 }71 72 private ClientInfo Convert(dsHiveServer.ClientRow row) {73 ClientInfo client = new ClientInfo();74 75 client.ResourceId = row.ResourceId;76 client.ClientId = row.GUID;77 client.CpuSpeedPerCore = row.CPUSpeed;78 //client.Memory = row.Memory;79 //client.Login = row.Login;80 //client.State =;81 //client.Config82 client.NrOfCores = row.NumberOfCores;83 84 return client;85 106 } 86 107
Note: See TracChangeset
for help on using the changeset viewer.