All Classes Files Functions Variables Enumerations Enumerator Groups Pages
Queue.idl
Go to the documentation of this file.
1 /**
2  * @file Queue.idl
3  * @brief Set the email messages queue.
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 MessageStatus {
17  msExecuting,
18  msBackup,
19  msContentFiltering,
20  msAntivirusControl, ///< shouldn't it be Antivirus Check
21  msLocalDelivering,
22  msSmtpDelivering,
23  msFinishing ///< Terminating in AC manual vs. Finishing in AC
24 };
25 
26 /**
27  * Message waiting in the queue
28  */
30  kerio::web::KId id; ///< Queue ID
31  string creationTime; ///< when the message was created
32  string nextTry; ///< when to try send message
33  kerio::web::ByteValueWithUnits messageSize; ///< message size in appropriate units
34  string from; ///< sender email address
35  string to; ///< recipient email address
36  string status; ///< message status
37  string authSender; ///< email address of authenticated sender
38  kerio::web::IpAddress senderIp; ///< IP address of authenticated sender
39 };
40 
41 /**
42  * Message being processed by server
43  */
45  kerio::web::KId id; ///< Queue ID
46  kerio::web::ByteValueWithUnits messageSize; ///< message size in appropriate units
47  string from; ///< sender email address
48  string to; ///< recipient email address
49  MessageStatus status; ///< message status
50  long percentage; ///< only for processing: completed percentage
51  string server; ///< server name or IP
52  string time; ///< time in process
53 };
54 
55 typedef sequence<MessageInQueue> MessageInQueueList;
56 typedef sequence<MessageInProcess> MessageInProcessList;
57 
58 interface Queue {
59 
60  /**
61  * Obtain a list of queued messages.
62  *
63  * @param list - awaiting messages
64  * @param totalItems - number of listed messages
65  * @param volume - space occupied by messages in the queue
66  * @param query - search conditions
67  */
68  void get(out MessageInQueueList list, out long totalItems, out kerio::web::ByteValueWithUnits volume, in kerio::web::SearchQuery query);
69 
70  /**
71  * List messages that are being processed by the server.
72  *
73  * @param list - processed messages
74  * @param totalItems - number of processed messages
75  * @param query - search conditions
76  */
77  void getProcessed(out MessageInProcessList list, out long totalItems, in kerio::web::SearchQuery query);
78 
79  /**
80  * Remove selected messages from the message queue.
81  *
82  * @param deletedItems - number of items deleted from the message queue
83  * @param messageIds - identifiers of messages to be deleted
84  */
85  void remove(out long deleteItems, in kerio::web::KIdList messageIds);
86 
87  /**
88  * Remove all message from the queue.
89  *
90  * @param deletedItems - number of items deleted from the message queue
91  */
92  void removeAll(out long deleteItems);
93 
94  /**
95  * Remove all messages matching a pattern from the message queue.
96  *
97  * @param deletedItems - number of items deleted from the message queue
98  * @param senderPattern - sender pattern with wildcards
99  * @param recipientPattern - recipient pattern with wildcards
100  */
101  void removeMatching(out long deleteItems, in string senderPattern, in string recipientPattern);
102 
103  /**
104  * Try to process message queue immediately.
105  */
106  void run();
107 
108  /**
109  * Try to send selected messages.
110  *
111  * @param messageIds - identifiers of messages to be sent immediately
112  */
113  void tryToSend(in kerio::web::KIdList messageIds);
114 };
115 
116 }; }; };//end of namespace