summaryrefslogtreecommitdiff
path: root/src/yalp.idl
blob: 9d87fc2ea2d7e22bb4eb1b4d3dee596ac580663b (plain)
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
26
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
module YalpInterfaces
{

enum YalpErrorCode {
	OK,
	ERROR_SQL,
	ERROR_OUTPUT_PLUGIN_NA,
	ERROR_UNDEFINED
};

enum YalpErrorLevel {
	ERROR_LEVEL_DEBUG,
	ERROR_LEVEL_INFO,
	ERROR_LEVEL_ERROR,
	ERROR_LEVEL_CRITICAL
};

struct YalpError {
	string msg;
	YalpErrorCode code;
	YalpErrorLevel level;
	string descr;
};

struct YalpFile {
	boolean isDir;
	string name;
	string parent;
};
typedef sequence<YalpFile> YalpFiles;

struct StreamCounter {
	unsigned long actualStreams;
	unsigned long allStreams;
};

enum AccessRights {
	ADMIN,
	USER,
	NO_YALP_SERVER,
	DENY
};

struct YalpUser {
	unsigned long id;
	string name;
	string realName;
	AccessRights level;
};
typedef sequence<YalpUser> Users;

enum MediaType {
	IMAGE,
	VIDEO,
	SOUND,
	OTHER
};
typedef sequence<MediaType> MediaTypes;

struct StringProperty {
	string property;
	string value;
};
typedef sequence<StringProperty> StringProperties;

struct IntProperty {
	string property;
	long value;
};
typedef sequence<IntProperty> IntProperties;

typedef sequence<string> MediaTags;

struct Media {
	/* mandatory */
	string name;
	unsigned long id;
	MediaType type;
	unsigned long inputPluginId;
	/* optional */
	YalpUser owner;
	string lastEdit;
	string path;
	string fileName;
	string duration;
	StringProperties stringProps;
	IntProperties intProps;
	MediaTags tags;
};
typedef sequence<Media> Medias;

enum Action {
	START,
	PLAY,
	PAUSE,
	STOP,
	FORWARD,
	BACKWARD,
	CREATE,
	EDIT,
	DELETE
};
typedef sequence<Action> Actions;

enum AccessType {
	FILE,
	FILES,
	STREAM
};

enum EncodingType {
	UNKNOWN,
	MP3,
	MPG,
	MPEG,
	AVI,
	MOV,
	M2T,
	JPEG,
	JPG,
	TIFF
};

struct AccessInfo {
	string name;
	string description;
	string executable;
	string params;
	AccessType type;
};

struct Output {
	unsigned long id;
	AccessInfo info;
	Medias playlist;
	Action outputAction;
	string destIp;
};

enum PluginType {
	INPUT_PLUGIN,
	OUTPUT_PLUGIN,
	AUTH_PLUGIN
};

struct PluginInfo {
	/* mandatory */
	unsigned long id;
	string name;
	string description;
	PluginType type;
	/* optional */
	MediaTypes supportedTypes;
	AccessInfo access;
	unsigned short maxClients;
	unsigned short actClients;
};
typedef sequence<PluginInfo> PluginInfos;

struct Session {
	unsigned long id;
	YalpUser me;
	string ip;
	PluginInfos availablePlugins;
};

/* YALP startup
 *
 * 1) CORBA - NameService
 * 2) YALP  - ServerControl (connects to Db via NameService)
 * 4) YALP  - all Plugins (connecting to ServerControl via NS)
 * 5) YALP  - Clients (connecting to ServerControl via NS, getting handles)
 *                    (to available OutputPlugins via ServerControl       )
 */

/* implemented by OutputPlugins */
interface OutputPluginInterface {
	void getInfo(out PluginInfo info, out YalpError err);
	void control(inout Output ctlOutput, out YalpError err);
	oneway void shutdown();
};

/* implemented by InputPlugins */
interface InputPluginInterface {
	void getInfo(out PluginInfo info, out YalpError err);
	void changeMedia(in Media toChange, in Action todo, out YalpError err);

	void search(in string str, in MediaTypes types, out Medias result,
		out YalpError err);

	void getNumOfMedias(out unsigned long num, out YalpError err);
};

/* implemented by UserIdentificationPlugin */
interface UserIdentificationInterface {
	void getInfo(out PluginInfo info, out YalpError err);
	void userVerify(in string user, in string passwd, out YalpError err,
		out YalpUser acc);

	void getUser(out Users list, out YalpError err);

	void changeUser(in YalpUser usr, in string passwd, in Action todo,
		out YalpError err);
};

/* implemented by YALP */
interface ServerControlInterface {

/* User Handling */

	void clientLogon(in string userName, in string pass, in string ipAdress,
		out Session hej, out YalpError err);

	void clientLogoff(in Session bye, out YalpError err);

	void getUser(out Users list, out YalpError err);

	void changeUser(in YalpUser usr, in string passwd, in Action todo,
		out YalpError err);

/* Media Handling */

	void changeMedia(in Media toChange, in Action todo, out YalpError err);
	void getNumOfMedias(out unsigned long num, out YalpError err);
	void control(inout Output ctlOutput, out YalpError err);

	void search(in string str, in MediaTypes types, out Medias result,
		out YalpError err);


/* Outputplugin Handling */

	void registerOutputPlugin(in OutputPluginInterface itf, inout PluginInfo info,
		out YalpError err);

	void removeOutputPlugin(in PluginInfo itf, out YalpError err);

	void getOutputPlugins(out PluginInfos itfs, in string name,
		out YalpError err);


/* Inputplugin Handling */

	void registerInputPlugin(in Object itf, inout PluginInfo info,
		out YalpError err);

	void removeInputPlugin(in PluginInfo itf, out YalpError err);

	void getInputPlugins(out PluginInfos itfs, in string name,
		out YalpError err);


/* Identificationplugin Handling */

	void registerAuthPlugin(in Object itf, inout PluginInfo info,
		out YalpError err);

	void removeAuthPlugin(in PluginInfo itf, out YalpError err);
	void getAuthPlugins(out PluginInfos itfs, in string name, out YalpError err);

	/* Server related */
	void ping(out YalpError pong);
	oneway void serverShutdown();
};

};