Message.h 10.9 KB
Newer Older
legoc's avatar
legoc committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * Copyright 2015 Institut Laue-Langevin
 *
 * Licensed under the EUPL, Version 1.1 only (the "License");
 * You may not use this work except in compliance with the Licence.
 * You may obtain a copy of the Licence at:
 *
 * http://joinup.ec.europa.eu/software/page/eupl
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the Licence is distributed on an "AS IS" basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the Licence for the specific language governing permissions and
 * limitations under the Licence.
 */

#ifndef CAMEO_MESSAGE_H_
#define CAMEO_MESSAGE_H_

#include <string>

namespace cameo {

namespace message {

26
	constexpr const char* TYPE = "type";
legoc's avatar
legoc committed
27
28

	const int SYNC = 1;
legoc's avatar
legoc committed
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
	const int SYNC_STREAM = 2;
	const int START = 3;
	const int STOP = 4;
	const int CONNECT = 5;
	const int CONNECT_WITH_ID = 6;
	const int APPS = 7;
	const int OUTPUT_PORT = 8;
	const int OUTPUT_PORT_WITH_ID = 9;
	const int IS_ALIVE = 10;
	const int WRITE_INPUT = 11;
	const int KILL = 12;
	const int STATUS = 13;
	const int LIST = 14;
	const int SET_STATUS = 15;
	const int GET_STATUS = 16;
44
45
46
47
	const int CREATE_PUBLISHER_v0 = 17;
	const int TERMINATE_PUBLISHER_v0 = 18;
	const int CONNECT_PUBLISHER_v0 = 19;
	const int SUBSCRIBE_PUBLISHER_v0 = 20;
legoc's avatar
legoc committed
48
49
	const int CANCEL = 21;
	const int SET_RESULT = 22;
50
51
52
	const int REQUEST_PORT_v0 = 23;
	const int CONNECT_PORT_v0 = 24;
	const int REMOVE_PORT_v0 = 25;
legoc's avatar
legoc committed
53
54
	const int REQUEST = 26;
	const int RESPONSE = 27;
55
56
	const int ATTACH_UNMANAGED = 28;
	const int DETACH_UNMANAGED = 29;
legoc's avatar
legoc committed
57
58
59
60
	const int IMPL_VERSION = 30;
	const int STORE_KEY_VALUE = 31;
	const int GET_KEY_VALUE = 32;
	const int REMOVE_KEY = 33;
61
	const int REQUEST_PORT = 34;
62
	const int PORT_UNAVAILABLE = 35;
63
64
	const int RELEASE_PORT = 36;
	const int PORTS = 37;
legoc's avatar
legoc committed
65

66
	namespace Event {
legoc's avatar
legoc committed
67
		constexpr const char* SYNC = "SYNC";
68
69
70
		constexpr const char* CANCEL = "CANCEL";
		constexpr const char* STREAM = "STREAM";
		constexpr const char* ENDSTREAM = "ENDSTREAM";
legoc's avatar
legoc committed
71
		constexpr const char* SYNCSTREAM = "SYNCSTREAM";
72
73
74
75
		constexpr const char* STATUS = "STATUS";
		constexpr const char* RESULT = "RESULT";
		constexpr const char* PORT = "PORT";
		constexpr const char* PUBLISHER = "PUBLISHER";
76
		constexpr const char* KEYVALUE = "KEYVALUE";
77
78
	}

79
	namespace ApplicationIdentity {
80
81
82
83
84
85
		constexpr const char* NAME = "name"; // string
		constexpr const char* ID = "id"; // int32
		constexpr const char* SERVER = "server"; // string
		constexpr const char* STARTER = "starter"; // object
	}

legoc's avatar
legoc committed
86
87
88
89
	namespace SyncStreamRequest {
		constexpr const char* NAME = "name"; // string
	}

legoc's avatar
legoc committed
90
	namespace StartRequest {
91
92
93
		constexpr const char* NAME = "name"; // required string name = 1;
		constexpr const char* ARGS = "args"; // repeated string args = 2;
		constexpr const char* INSTANCE_REFERENCE = "instanceReference"; // required string instanceReference = 3;
legoc's avatar
legoc committed
94
95
96
	}

	namespace RequestResponse {
97
98
		constexpr const char* VALUE = "value"; // required int32 value = 1;
		constexpr const char* MESSAGE = "message"; // optional string message = 2;
legoc's avatar
legoc committed
99
100
101
	}

	namespace StopRequest {
102
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
103
104
105
	}

	namespace ConnectRequest {
106
		constexpr const char* NAME = "name"; // required string name = 1;
legoc's avatar
legoc committed
107
108
	}

109
110
111
112
	namespace ConnectWithIdRequest {
		constexpr const char* ID = "id"; // int32
	}

legoc's avatar
legoc committed
113
	namespace ApplicationConfig {
114
115
116
117
118
119
		constexpr const char* NAME = "name"; // required string name = 1;
		constexpr const char* DESCRIPTION = "description"; // optional string description = 2;
		constexpr const char* RUNS_SINGLE = "runsSingle"; // required bool runsSingle = 3;
		constexpr const char* RESTART = "restart"; // required bool restart = 4;
		constexpr const char* STARTING_TIME = "startingTime"; // required int32 startingTime = 5;
		constexpr const char* STOPPING_TIME = "stoppingTime"; // required int32 stoppingTime = 7;
legoc's avatar
legoc committed
120
121
	}

122
	namespace ApplicationConfigListResponse {
123
		constexpr const char* APPLICATION_CONFIG = "applicationConfig"; // repeated ApplicationConfig applicationConfig = 1;
legoc's avatar
legoc committed
124
125
126
	}

	namespace StatusEvent {
127
128
129
130
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
		constexpr const char* APPLICATION_STATE = "applicationState"; // required int32 applicationState = 3;
		constexpr const char* PAST_APPLICATION_STATES = "pastApplicationStates"; // required int32 pastApplicationStates = 4;
131
		constexpr const char* EXIT_CODE = "exitCode"; // optional
legoc's avatar
legoc committed
132
133
134
	}

	namespace PublisherEvent {
135
136
137
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
		constexpr const char* PUBLISHER_NAME = "publisherName"; // required string publisherName = 3;
legoc's avatar
legoc committed
138
139
140
	}

	namespace ResultEvent {
141
142
143
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
		constexpr const char* DATA = "data"; // required bytes data = 3;
legoc's avatar
legoc committed
144
145
146
	}

	namespace PortEvent {
147
148
149
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
		constexpr const char* PORT_NAME = "portName"; // required string portName = 3;
legoc's avatar
legoc committed
150
151
152
	}

	namespace ApplicationInfo {
153
154
155
156
157
158
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
		constexpr const char* APPLICATION_STATE = "applicationState"; // required int32 applicationState = 3;
		constexpr const char* PAST_APPLICATION_STATES = "pastApplicationStates"; // required int32 pastApplicationStates = 4;
		constexpr const char* ARGS = "args"; // required string args = 5;
		constexpr const char* PID = "pid"; // optional int64 pid = 6;
legoc's avatar
legoc committed
159
160
161
	}

	namespace ApplicationInfoListResponse {
162
		constexpr const char* APPLICATION_INFO = "applicationInfo"; // repeated ApplicationInfo applicationInfo = 1;
legoc's avatar
legoc committed
163
164
	}

165
	namespace OutputPortWithIdRequest {
166
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
167
168
	}

169
	namespace OutputPortRequest {
170
171
172
		constexpr const char* NAME = "name"; // required string name = 1;
	}

legoc's avatar
legoc committed
173
	namespace IsAliveRequest {
174
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
175
176
177
	}

	namespace IsAliveResponse {
178
		constexpr const char* IS_ALIVE = "isAlive"; // required bool isAlive = 1;
legoc's avatar
legoc committed
179
180
181
	}

	namespace ApplicationStream {
182
183
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* MESSAGE = "message"; // required string message = 2;
184
		constexpr const char* EOL = "eol"; // boolean
legoc's avatar
legoc committed
185
186
	}

187
	namespace WriteInputRequest {
188
		constexpr const char* ID = "id"; // required int32 id = 1;
189
		constexpr const char* INPUTS = "inputs"; // repeated string parameters = 2;
legoc's avatar
legoc committed
190
191
192
	}

	namespace KillRequest {
193
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
194
195
196
	}

	namespace SetStatusRequest {
197
198
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* APPLICATION_STATE = "applicationState"; // required int32 applicationState = 2;
legoc's avatar
legoc committed
199
200
201
	}

	namespace GetStatusRequest {
202
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
203
204
205
	}

	namespace SetResultRequest {
206
207
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* DATA = "data"; // required bytes data = 2;
legoc's avatar
legoc committed
208
209
	}

210
	namespace RequestPortV0Request {
211
212
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
legoc's avatar
legoc committed
213
214
	}

215
	namespace ConnectPortV0Request {
216
217
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
legoc's avatar
legoc committed
218
219
	}

220
	namespace RemovePortV0Request {
221
222
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
legoc's avatar
legoc committed
223
224
225
	}

	namespace CreatePublisherRequest {
226
227
228
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
		constexpr const char* NUMBER_OF_SUBSCRIBERS = "numberOfSubscribers"; // required int32 numberOfSubscribers = 3;
legoc's avatar
legoc committed
229
230
231
	}

	namespace TerminatePublisherRequest {
232
233
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
legoc's avatar
legoc committed
234
235
236
	}

	namespace ConnectPublisherRequest {
237
238
		constexpr const char* APPLICATION_ID = "applicationId"; // required int32 applicationId = 1;
		constexpr const char* PUBLISHER_NAME = "publisherName"; // required string publisherName = 2;
legoc's avatar
legoc committed
239
240
241
	}

	namespace PublisherResponse {
242
243
244
245
		constexpr const char* MESSAGE = "message"; // optional string message = 1;
		constexpr const char* PUBLISHER_PORT = "publisherPort"; // required int32 publisherPort = 2;
		constexpr const char* SYNCHRONIZER_PORT = "synchronizerPort"; // required int32 synchronizerPort = 3;
		constexpr const char* NUMBER_OF_SUBSCRIBERS = "numberOfSubscribers"; // optional int32 numberOfSubscribers = 4;
legoc's avatar
legoc committed
246
247
248
	}

	namespace Request {
249
250
251
252
253
		constexpr const char* APPLICATION_NAME = "applicationName"; // required string applicationName = 1;
		constexpr const char* APPLICATION_ID = "applicationId"; // required int32 applicationId = 2;
		constexpr const char* SERVER_URL = "serverUrl"; // required string serverUrl = 5;
		constexpr const char* SERVER_PORT = "serverPort"; // required int32 serverPort = 6;
		constexpr const char* REQUESTER_PORT = "requesterPort"; // required int32 requesterPort = 7;
legoc's avatar
legoc committed
254
255
	}

256
	namespace AttachUnmanagedRequest {
257
258
		constexpr const char* NAME = "name"; // required string name = 1;
		constexpr const char* PID = "pid"; // optional int64 pid = 2;
legoc's avatar
legoc committed
259
260
	}

261
	namespace DetachUnmanagedRequest {
262
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
263
	}
264
265
266
267
268
269
270

	namespace VersionResponse {
		constexpr const char* MAJOR = "major";
		constexpr const char* MINOR = "minor";
		constexpr const char* REVISION = "revision";
	}

271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
	namespace StoreKeyValueRequest {
		constexpr const char* ID = "id"; // int32
		constexpr const char* KEY = "key"; // string
		constexpr const char* VALUE = "value"; // string
	}

	namespace GetKeyValueRequest {
		constexpr const char* ID = "id"; // int32
		constexpr const char* KEY = "key"; // string
	}

	namespace RemoveKeyRequest {
		constexpr const char* ID = "id"; // int32
		constexpr const char* KEY = "key"; // string
	}

287
	namespace KeyEvent {
288
289
		constexpr const char* ID = "id"; // int32
		constexpr const char* NAME = "name"; // string
290
		constexpr const char* STATUS = "status"; // long STORE_KEY_VALUE or REMOVE_KEY
291
		constexpr const char* KEY = "key"; // string
292
		constexpr const char* VALUE = "value"; // string
293
	}
294
295
296
297
298

	namespace RequestPortRequest {
		constexpr const char* ID = "id"; // int32
	}

299
	namespace PortUnavailableRequest {
300
301
302
303
304
305
306
307
308
309
310
311
		constexpr const char* ID = "id"; // int32
		constexpr const char* PORT = "port"; // int32
	}

	namespace ReleasePortRequest {
		constexpr const char* ID = "id"; // int32
		constexpr const char* PORT = "port"; // int32
	}

	namespace PortInfo {
		constexpr const char* PORT = "port"; // int32
		constexpr const char* STATUS = "status"; // string
legoc's avatar
legoc committed
312
		constexpr const char* OWNER = "owner"; // string
313
314
315
316
317
	}

	namespace PortInfoListResponse {
		constexpr const char* PORT_INFO = "portInfo"; // multiple PortInfo
	}
legoc's avatar
legoc committed
318
319
320
321
322
323
}

}

#endif