Message.h 9.3 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

	const int SYNC = 1;
	const int START = 2;
	const int STOP = 3;
	const int CONNECT = 4;
legoc's avatar
legoc committed
32
	const int APPS = 5;
33
34
	const int OUTPUT_PORT_WITH_ID = 6;
	const int OUTPUT_PORT = 7;
35
36
	const int ENABLE_STREAM = 8;
	const int IS_ALIVE = 9;
37
	const int WRITE_INPUT = 10;
38
39
	const int KILL = 11;
	const int STATUS = 12;
40
	const int LIST = 13;
legoc's avatar
legoc committed
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
	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
	}

legoc's avatar
legoc committed
100
	namespace ListResponse {
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;
109
		constexpr const char* EXIT_CODE = "exitCode"; // optional
legoc's avatar
legoc committed
110
111
112
	}

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

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

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

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

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

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

147
	namespace OutputPortRequest {
148
149
150
		constexpr const char* NAME = "name"; // required string name = 1;
	}

legoc's avatar
legoc committed
151
	namespace IsAliveRequest {
152
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
153
154
155
	}

	namespace IsAliveResponse {
156
		constexpr const char* IS_ALIVE = "isAlive"; // required bool isAlive = 1;
legoc's avatar
legoc committed
157
158
159
	}

	namespace ApplicationStream {
160
161
		constexpr const char* ID = "id"; // required int32 id = 1;
		constexpr const char* MESSAGE = "message"; // required string message = 2;
162
		constexpr const char* EOL = "eol"; // boolean
legoc's avatar
legoc committed
163
164
	}

165
	namespace WriteInputRequest {
166
		constexpr const char* ID = "id"; // required int32 id = 1;
167
		constexpr const char* INPUTS = "inputs"; // repeated string parameters = 2;
legoc's avatar
legoc committed
168
169
170
	}

	namespace KillRequest {
171
		constexpr const char* ID = "id"; // required int32 id = 1;
legoc's avatar
legoc committed
172
173
174
	}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
	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
265
266
267
268
269
270
}

}

#endif