Message.h 9.25 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

	const int SYNC = 1;
	const int START = 2;
	const int STOP = 3;
	const int CONNECT = 4;
	const int SHOW_ALL = 5;
	const int SHOW = 6;
	const int ENABLE_STREAM = 7;
	const int IS_ALIVE = 8;
	const int SEND_PARAMETERS = 9;
	const int KILL = 10;
	const int STATUS = 11;
	const int ALL_AVAILABLE = 12;
	const int OUTPUT = 13;
	const int SET_STATUS = 14;
	const int GET_STATUS = 15;
	const int CREATE_PUBLISHER = 16;
	const int TERMINATE_PUBLISHER = 17;
	const int CONNECT_PUBLISHER = 18;
	const int SUBSCRIBE_PUBLISHER = 19;
	const int CANCEL = 20;
	const int SET_RESULT = 21;
	const int REQUEST_PORT = 22;
	const int CONNECT_PORT = 23;
	const int REMOVE_PORT = 24;
	const int REQUEST = 25;
	const int RESPONSE = 26;
	const int STARTED_UNMANAGED = 27;
	const int TERMINATED_UNMANAGED = 28;
56
	const int IMPL_VERSION = 29;
57
58
59
	const int STORE_KEY_VALUE = 30;
	const int GET_KEY_VALUE = 31;
	const int REMOVE_KEY = 32;
legoc's avatar
legoc committed
60

61
62
63
64
65
66
67
68
69
70
71
	namespace Event {
		constexpr const char* CANCEL = "CANCEL";
		constexpr const char* STREAM = "STREAM";
		constexpr const char* ENDSTREAM = "ENDSTREAM";
		constexpr const char* SYNC = "SYNC";
		constexpr const char* STATUS = "STATUS";
		constexpr const char* RESULT = "RESULT";
		constexpr const char* PORT = "PORT";
		constexpr const char* PUBLISHER = "PUBLISHER";
	}

legoc's avatar
legoc committed
72
	namespace StartRequest {
73
74
75
		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
76
77
78
	}

	namespace RequestResponse {
79
80
		constexpr const char* VALUE = "value"; // required int32 value = 1;
		constexpr const char* MESSAGE = "message"; // optional string message = 2;
legoc's avatar
legoc committed
81
82
83
	}

	namespace StopRequest {
84
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
85
86
87
	}

	namespace ConnectRequest {
88
		constexpr const char* NAME = "name"; // required string name = 1;
legoc's avatar
legoc committed
89
90
91
	}

	namespace ApplicationConfig {
92
93
94
95
96
97
		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
98
99
100
	}

	namespace AllAvailableResponse {
101
		constexpr const char* APPLICATION_CONFIG = "applicationConfig"; // repeated ApplicationConfig applicationConfig = 1;
legoc's avatar
legoc committed
102
103
104
	}

	namespace StatusEvent {
105
106
107
108
		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;
legoc's avatar
legoc committed
109
110
111
	}

	namespace PublisherEvent {
112
113
114
		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
115
116
117
	}

	namespace ResultEvent {
118
119
120
		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
121
122
123
	}

	namespace PortEvent {
124
125
126
		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
127
128
129
	}

	namespace ApplicationInfo {
130
131
132
133
134
135
		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
136
137
138
	}

	namespace ApplicationInfoListResponse {
139
		constexpr const char* APPLICATION_INFO = "applicationInfo"; // repeated ApplicationInfo applicationInfo = 1;
legoc's avatar
legoc committed
140
141
142
	}

	namespace ShowStreamRequest {
143
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
144
145
146
	}

	namespace IsAliveRequest {
147
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
148
149
150
	}

	namespace IsAliveResponse {
151
		constexpr const char* IS_ALIVE = "isAlive"; // required bool isAlive = 1;
legoc's avatar
legoc committed
152
153
154
	}

	namespace ApplicationStream {
155
156
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* MESSAGE = "message"; // required string message = 2;
157
		constexpr const char* EOL = "eol"; // boolean
legoc's avatar
legoc committed
158
159
160
	}

	namespace SendParametersRequest {
161
162
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* PARAMETERS = "parameters"; // repeated string parameters = 2;
legoc's avatar
legoc committed
163
164
165
	}

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

	namespace OutputRequest {
170
		constexpr const char* NAME = "name"; // required string name = 1;
legoc's avatar
legoc committed
171
172
173
	}

	namespace SetStatusRequest {
174
175
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* APPLICATION_STATE = "applicationState"; // required int32 applicationState = 2;
legoc's avatar
legoc committed
176
177
178
	}

	namespace GetStatusRequest {
179
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
180
181
182
	}

	namespace SetResultRequest {
183
184
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* DATA = "data"; // required bytes data = 2;
legoc's avatar
legoc committed
185
186
187
	}

	namespace RequestPortRequest {
188
189
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
legoc's avatar
legoc committed
190
191
192
	}

	namespace ConnectPortRequest {
193
194
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
legoc's avatar
legoc committed
195
196
197
	}

	namespace RemovePortRequest {
198
199
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* NAME = "name"; // required string name = 2;
legoc's avatar
legoc committed
200
201
202
	}

	namespace CreatePublisherRequest {
203
204
205
		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
206
207
208
	}

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

	namespace ConnectPublisherRequest {
214
215
		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
216
217
218
	}

	namespace PublisherResponse {
219
220
221
222
		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
223
224
225
	}

	namespace Request {
226
227
228
229
230
		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
231
232
233
	}

	namespace StartedUnmanagedRequest {
234
235
		constexpr const char* NAME = "name"; // required string name = 1;
		constexpr const char* PID = "pid"; // optional int64 pid = 2;
legoc's avatar
legoc committed
236
237
238
	}

	namespace TerminatedUnmanagedRequest {
239
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
240
	}
241
242
243
244
245
246
247

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

248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
	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
	}

legoc's avatar
legoc committed
264
265
266
267
268
269
}

}

#endif