All Classes Files Functions Variables Enumerations Enumerator Groups Pages
Delivery.idl
Go to the documentation of this file.
1 /**
2  * @file Delivery.idl
3  * @brief Set Internet Connection, POP3 download, ETRN download, Scheduling.
4  *
5  * @author Dusan Juhas
6  *
7  * @copyright Copyright © 2017 Kerio Technologies s.r.o.
8  */
9 
10 #import <kerio/web/idl/SharedStructures.idl>
11 
12 module kerio {
13 module jsonapi {
14 module admin {
15 
16 enum TriggerType {
17  Every,
18  At
19 };
20 
21 /**
22  * fewer posibilities than TimeUnit
23  */
24 enum TiedTimeUnit {
25  TMinutes,
26  THours
27 };
28 
29 /**
30  *
31  * Note: all fields must be assigned if used in set methods
32  */
33 struct TimeCondition {
34  TriggerType type;
35  long number; ///< for type "every"
36  TiedTimeUnit units; ///< for type "every"
37  long minutes; ///< for type "at"
38  long hours; ///< for type "at"
39  boolean isLimited; ///< is trigger limited to specified time range?
40  kerio::web::KId groupId; ///< time range identifier; (ID should be ok because should show all available time ranges anyway)
41 };
42 
43 /**
44  *
45  * Note: all fields must be assigned if used in set methods
46  */
48  boolean sendFromQueue; ///< send messages from outgoing queue
49  boolean pop3Download; ///< download messages from POP3 mailboxes
50  boolean sendEtrn; ///< send ETRN command to invoke mail transfer
51 };
52 
54  kerio::web::KId id;
55  boolean isActive; ///< record is active
56  string description;
57  TimeCondition condition;
58  boolean allowDialUp; ///< allow to establish dial-up connection if necessary
59  ScheduledActionAction action;
60 };
61 
62 typedef sequence<ScheduledAction> ScheduledActionList;
63 
64 struct EtrnDownload {
65  kerio::web::KId id;
66  boolean isActive;
67  string server; ///< server URL
68  string domains; ///< semicolon separated list of domain names
69  string description;
70  boolean requireAuthentication; ///< Is authentication required?
71  string userName; ///< make sense only if authentication is required
72  string password; ///< make sense only if authentication is required
73 };
74 
75 typedef sequence<EtrnDownload> EtrnDownloadList;
76 
77 enum SslMode {
78  NoSsl,
79  SpecialPort,
80  StlsCommand
81 };
82 
83 enum Pop3Authentication {
84  PlainPop3,
85  Apop
86 };
87 
88 /**
89  * If leaveOnServer ID enabled, messages are left on the server and
90  * the removeAfterPeriod option is used; Otherwise, messages are deleted immediately
91  * and removeAfterPeriod is ignored.
92  * If removeAfterPeriod is enabled, messages are deleted after specified period (in days).
93  */
94 struct LeaveOnServer {
95  boolean enabled;
96  kerio::web::OptionalLong removeAfterPeriod;
97 };
98 
99 struct Pop3Account {
100  kerio::web::KId id;
101  boolean isActive;
102  string server; ///< POP3 server name
103  string userName; ///< username on POP3 server
104  string password; ///< password appropriate to username
105  string description;
106  string deliveryAddress;
107  boolean useSortingRules;///< If value is true sortType will save otherwise deliveryAddress will save. Default is false.
108  string sortType;
109  boolean dropDuplicates; ///< drop duplicate messages?
110  SslMode mode;
111  long port;
112  Pop3Authentication authentication;
113  kerio::web::ByteValueWithUnits messageLimit; ///< per session download limit - total message size
114  long maxCount; ///< per session download limit - maximum message count
115  LeaveOnServer leaveOnServer;
116 };
117 
118 typedef sequence<Pop3Account> Pop3AccountList;
119 
120 struct Pop3Sorting {
121  kerio::web::KId id;
122  boolean isActive;
123  string sortAddress;
124  string deliverTo;
125  string description;
126 };
127 
128 typedef sequence<Pop3Sorting> Pop3SortingList;
129 
130 enum InternetConnection {
131  Permanent, ///< permanent Internet connection
132  Triggered, ///< connection is established by scheduler
133  TriggeredOnRas ///< Remote Access Service - Windows only option
134 };
135 
137  InternetConnection type; ///< type of Internet settings connection
138  string rasLine; ///< name of RAS line
139  boolean useSystemCredentials; ///< use username and password defined in system
140  string rasUser; ///< RAS username
141  string rasPassword; ///< write only; password to RAS
142  boolean dialOnHigh; ///< enable dial-up on high priority message
143 };
144 
145 interface Delivery {
146 
147  /**
148  * Add new ETRN downloads.
149  *
150  * @param errors - list of error messages
151  * @param downloads - new ETRN download records
152  */
153  void addEtrnDownloadList(out kerio::web::ErrorList errors, in EtrnDownloadList downloads);
154 
155  /**
156  * Add new POP3 accounts.
157  *
158  * @param errors - list of error messages
159  * @param accounts - new POP3 account records
160  */
161  void addPop3AccountList(out kerio::web::ErrorList errors, in Pop3AccountList accounts);
162 
163  /**
164  * Add new POP3 sorting rules.
165  *
166  * @param errors - list of error messages
167  * @param sortings - new POP3 sorting records
168  */
169  void addPop3SortingList(out kerio::web::ErrorList errors, in Pop3SortingList sortings);
170 
171  /**
172  * Add scheduled actions.
173  *
174  * @param errors - list of error messages
175  * @param actions - new scheduler actions
176  */
177  void addScheduledActionList(out kerio::web::ErrorList errors, in ScheduledActionList actions);
178 
179  /**
180  * Start ETRN downloads.
181  */
182  void downloadEtrn();
183 
184  /**
185  * Obtain list of ETRN download items.
186  *
187  * @param list - ETRN download records
188  * @param totalItems - amount of records for given search condition, useful when a limit is defined in the query
189  * @param query - query conditions and limits
190  */
191  void getEtrnDownloadList(out EtrnDownloadList list, out long totalItems, in kerio::web::SearchQuery query);
192 
193  /**
194  * Get timeout for ETRN reply on dial-up line
195  *
196  * @param seconds - number of seconds for ETRN timeout
197  */
198  void getEtrnTimeout(out long seconds);
199 
200  /**
201  * Obtain Internet connection settings.
202  *
203  * @param settings - Internet connection settings
204  */
205  void getInternetSettings(out InternetSettings settings);
206 
207  /**
208  * Obtain list of POP3 accounts.
209  *
210  * @param list - POP3 accounts
211  * @param totalItems - amount of accounts for given search condition, useful when a limit is defined in the query
212  * @param query - query conditions and limits
213  */
214  void getPop3AccountList(out Pop3AccountList list, out long totalItems, in kerio::web::SearchQuery query);
215 
216  /**
217  * Obtain list of POP3 sorting rules
218  *
219  * @param list - POP3 sorting records
220  * @param totalItems - amount of records for given search condition, useful when a limit is defined in the query
221  * @param query - query conditions and limits
222  */
223  void getPop3SortingList(out Pop3SortingList list, out long totalItems, in kerio::web::SearchQuery query);
224 
225  /**
226  * Obtain Remote Access Service. Valid information available on Windows only.
227  *
228  * @param names - list of available RAS names
229  */
230  void getRasNames(out kerio::web::StringList names);
231 
232  /**
233  * Obtain a list of scheduler actions.
234  *
235  * @param list - scheduler actions
236  * @param totalItems - amount of actions for given search condition, useful when limit is defined in query
237  * @param query - query conditions and limits
238  */
239  void getScheduledActionList(out ScheduledActionList list, out long totalItems, in kerio::web::SearchQuery query);
240 
241  /**
242  * Remove ETRN download items.
243  *
244  * @param errors - error message list
245  * @param ids - identifier list of ETRN download records to be deleted
246  */
247  void removeEtrnDownloadList(out kerio::web::ErrorList errors, in kerio::web::KIdList ids);
248 
249  /**
250  * Remove POP3 accounts.
251  *
252  * @param errors - list of error messages
253  * @param ids - identifier list of POP3 account records to be deleted
254  */
255  void removePop3AccountList(out kerio::web::ErrorList errors, in kerio::web::KIdList ids);
256 
257  /**
258  * Remove POP3 sorting rules.
259  *
260  * @param errors - list of error messages
261  * @param ids - identifier list of POP3 sorting records to be deleted
262  */
263  void removePop3SortingList(out kerio::web::ErrorList errors, in kerio::web::KIdList ids);
264 
265  /**
266  * Remove scheduled actions.
267  *
268  * @param errors - error message list
269  * @param ids - identifier list of scheduler actions to be deleted
270  */
271  void removeScheduledActionList(out kerio::web::ErrorList errors, in kerio::web::KIdList ids);
272 
273  /**
274  * Proceed all POP3 downloads right now.
275  */
276  void runPop3Downloads();
277 
278  /**
279  * Set 1 ETRN download item.
280  *
281  * @param downloadId - updated ETRN download identifier
282  * @param download - new ETRN download record
283  */
284  void setEtrnDownload(in kerio::web::KId downloadId, in EtrnDownload download);
285 
286  /**
287  * Set timeout for ETRN reply on dial-up line.
288  *
289  * @param seconds - number of seconds for ETRN timeout
290  */
291  void setEtrnTimeout(in long seconds);
292 
293  /**
294  * Set Internet connection settings.
295  *
296  * @param settings - Internet connection settings
297  */
298  void setInternetSettings(in InternetSettings settings);
299 
300  /**
301  * Set POP3 account.
302  *
303  * @param accountId - updated POP3 account identifier
304  * @param account - new POP3 account record
305  */
306  void setPop3Account(in kerio::web::KId accountId, in Pop3Account account);
307 
308  /**
309  * Set POP3 sorting rule.
310  *
311  * @param sortingId - updated POP3 sorting identifier
312  * @param sorting - new POP3 sorting record
313  */
314  void setPop3Sorting(in kerio::web::KId sortingId, in Pop3Sorting sorting);
315 
316  /**
317  * Set a scheduled action.
318  *
319  * @param actionId - updated action identifier
320  * @param action - new scheduler actions
321  */
322  void setScheduledAction(in kerio::web::KId actionId, in ScheduledAction action);
323 };
324 
325 }; }; };//end of namespace