1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.ServiceModel;
|
---|
6 | using System.IO;
|
---|
7 | using HeuristicLab.Services.Hive.Common.DataTransfer;
|
---|
8 | using System.Net.Security;
|
---|
9 |
|
---|
10 | namespace HeuristicLab.Services.Hive.Common.ServiceContracts {
|
---|
11 |
|
---|
12 | [ServiceContract(ProtectionLevel = ProtectionLevel.EncryptAndSign)]
|
---|
13 | public interface IHiveService {
|
---|
14 |
|
---|
15 | #region Job Methods
|
---|
16 | [OperationContract]
|
---|
17 | Guid AddJob(Job job, JobData jobData);
|
---|
18 |
|
---|
19 | [OperationContract]
|
---|
20 | Guid AddChildJob(Guid parentJobId, Job job, JobData jobData);
|
---|
21 |
|
---|
22 | [OperationContract] // formerly GetJobById
|
---|
23 | Job GetJob(Guid jobId);
|
---|
24 |
|
---|
25 | [OperationContract] // formerly GetAllJobs
|
---|
26 | IEnumerable<Job> GetJobs();
|
---|
27 |
|
---|
28 | [OperationContract] // formerly GetJobResults
|
---|
29 | IEnumerable<LightweightJob> GetLightweightJobs(IEnumerable<Guid> jobIds);
|
---|
30 |
|
---|
31 | [OperationContract] // formerly GetChildJobResults
|
---|
32 | IEnumerable<LightweightJob> GetLightweightChildJobs(Guid? parentJobId, bool recursive, bool includeParent);
|
---|
33 |
|
---|
34 | [OperationContract] // formerly GetLastSerializedResult
|
---|
35 | JobData GetJobData(Guid jobId);
|
---|
36 |
|
---|
37 | [OperationContract]
|
---|
38 | Stream GetJobDataStreamed(Guid jobId);
|
---|
39 |
|
---|
40 | [OperationContract]
|
---|
41 | void UpdateJob(Job jobDto, JobData jobDataDto);
|
---|
42 |
|
---|
43 | [OperationContract] // formerly StoreFinishedJobResultStreamed
|
---|
44 | void UpdateJobDataStreamed(Stream stream);
|
---|
45 |
|
---|
46 | [OperationContract]
|
---|
47 | void DeleteChildJobs(Guid parentJobId);
|
---|
48 |
|
---|
49 | [OperationContract] // new method: appropriate job is choosen and set to 'calculating'. the slave is responsible for requesting the jobData. Server should wait some timeout until he redistributes the job
|
---|
50 | Job AquireJob(Guid slaveId);
|
---|
51 |
|
---|
52 | //[OperationContract] // dump?
|
---|
53 | //Job GetJobByIdWithDetails(Guid jobId);
|
---|
54 |
|
---|
55 | //[OperationContract] dump?
|
---|
56 | //Job AddNewJob(JobData job);
|
---|
57 |
|
---|
58 | //[OperationContract]
|
---|
59 | //void RemoveJob(Guid jobId);
|
---|
60 |
|
---|
61 | //[OperationContract] // GetJobForCalculation (was this used?
|
---|
62 | //Job GetJob(Guid slaveId);
|
---|
63 |
|
---|
64 | //[OperationContract] --> replaced by UpdateJob
|
---|
65 | //void StoreFinishedJobResult(Guid slaveId, Guid jobId, byte[] result, TimeSpan executionTime, string exception);
|
---|
66 |
|
---|
67 | //[OperationContract] dump this! a slave should just check if job is still offline, if so it can submit the finished job, otherwise throw away! its a rare case that a slave reawakes with a finished job
|
---|
68 | //void IsJobStillNeeded(Guid jobId);
|
---|
69 |
|
---|
70 | //[OperationContract] // dump?
|
---|
71 | //Job AddJobWithGroupStrings(JobData jobObj, IEnumerable<string> groups);
|
---|
72 | #endregion
|
---|
73 |
|
---|
74 |
|
---|
75 | #region Job Control Methods
|
---|
76 | [OperationContract]
|
---|
77 | void AbortJob(Guid jobId);
|
---|
78 |
|
---|
79 | [OperationContract]
|
---|
80 | Job PauseJob(Guid jobId);
|
---|
81 | #endregion
|
---|
82 |
|
---|
83 | #region HiveExperiment Methods
|
---|
84 | [OperationContract]
|
---|
85 | HiveExperiment GetHiveExperiment(Guid id);
|
---|
86 |
|
---|
87 | /// <summary>
|
---|
88 | /// Returns all experiments for the current user
|
---|
89 | /// </summary>
|
---|
90 | [OperationContract]
|
---|
91 | IEnumerable<HiveExperiment> GetHiveExperiments();
|
---|
92 |
|
---|
93 | [OperationContract]
|
---|
94 | Guid AddHiveExperiment(HiveExperiment hiveExperimentDto);
|
---|
95 |
|
---|
96 | [OperationContract]
|
---|
97 | void UpdateHiveExperiment(HiveExperiment hiveExperimentDto);
|
---|
98 |
|
---|
99 | [OperationContract]
|
---|
100 | void DeleteHiveExperiment(Guid hiveExperimentId);
|
---|
101 | #endregion
|
---|
102 |
|
---|
103 | #region Login Methods
|
---|
104 | // rename "Login"-methods to "Register" or "SayHello", since its only purpose is to send Slave-Info (is Login() should not be used anymore)
|
---|
105 | /// <summary>
|
---|
106 | /// Method can be used to check if security credentials are valid, but it does not do anything
|
---|
107 | /// </summary>
|
---|
108 | /// <returns></returns>
|
---|
109 | //[OperationContract]
|
---|
110 | //void Login();
|
---|
111 | ///// <summary>
|
---|
112 | ///// This method registers the slave and marks it as online
|
---|
113 | ///// </summary>
|
---|
114 | //[OperationContract]
|
---|
115 | //void Login(Slave slave);
|
---|
116 | //[OperationContract]
|
---|
117 | //void Logout(Guid clientId);
|
---|
118 | #endregion
|
---|
119 |
|
---|
120 | #region Heartbeat Methods
|
---|
121 | [OperationContract]
|
---|
122 | List<MessageContainer> ProcessHeartbeat(Heartbeat heartbeat);
|
---|
123 | #endregion
|
---|
124 |
|
---|
125 | #region Plugin Methods
|
---|
126 | [OperationContract]
|
---|
127 | IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds);
|
---|
128 | [OperationContract]
|
---|
129 | Stream GetStreamedPluginDatas(List<Guid> pluginIds);
|
---|
130 | [OperationContract]
|
---|
131 | IEnumerable<Plugin> GetAvailablePlugins();
|
---|
132 | [OperationContract]
|
---|
133 | Guid AddPlugin(Plugin plugin, List<PluginData> pluginData);
|
---|
134 | #endregion
|
---|
135 |
|
---|
136 | #region Calendar Methods
|
---|
137 | [OperationContract]
|
---|
138 | IEnumerable<Appointment> GetCalendar(Guid slaveId);
|
---|
139 | [OperationContract]
|
---|
140 | void SetCalendarStatus(Guid clientId, CalendarState state);
|
---|
141 | [OperationContract]
|
---|
142 | IEnumerable<Appointment> GetUptimeCalendarForResource(Guid guid);
|
---|
143 | [OperationContract]
|
---|
144 | void SetUptimeCalendarForResource(Guid guid, IEnumerable<Appointment> appointments, bool isForced);
|
---|
145 | #endregion
|
---|
146 |
|
---|
147 | #region Slave Methods
|
---|
148 | [OperationContract]
|
---|
149 | Guid AddSlave(Slave slave);
|
---|
150 |
|
---|
151 | [OperationContract]
|
---|
152 | Guid AddSlaveGroup(SlaveGroup slaveGroup);
|
---|
153 |
|
---|
154 | [OperationContract]
|
---|
155 | IEnumerable<Slave> GetSlaves();
|
---|
156 |
|
---|
157 | [OperationContract]
|
---|
158 | //[ServiceKnownType(typeof(Resource))] - not sure about those
|
---|
159 | //[ServiceKnownType(typeof(Slave))]
|
---|
160 | //[ServiceKnownType(typeof(SlaveGroup))]
|
---|
161 | IEnumerable<SlaveGroup> GetSlaveGroups();
|
---|
162 |
|
---|
163 | [OperationContract]
|
---|
164 | void DeleteSlaveGroup(Guid clientGroupId);
|
---|
165 |
|
---|
166 | [OperationContract]
|
---|
167 | //[ServiceKnownType(typeof(Resource))]
|
---|
168 | //[ServiceKnownType(typeof(Slave))]
|
---|
169 | //[ServiceKnownType(typeof(SlaveGroup))]
|
---|
170 | void AddResourceToGroup(Guid slaveGroupId, Resource resource);
|
---|
171 |
|
---|
172 | [OperationContract]
|
---|
173 | void RemoveResourceFromGroup(Guid slaveGroupId, Guid resourceId);
|
---|
174 |
|
---|
175 | [OperationContract]
|
---|
176 | void UpdateSlave(Slave slave);
|
---|
177 | #endregion
|
---|
178 |
|
---|
179 | }
|
---|
180 | }
|
---|