@@ -34,37 +34,29 @@ interface Repository
34
34
*/
35
35
public function newMessageId (): int ;
36
36
37
- /**
38
- * Releases the given message id, allowing it to be reused in the future.
39
- *
40
- * @param int $messageId
41
- * @return void
42
- */
43
- public function releaseMessageId (int $ messageId ): void ;
44
-
45
37
/**
46
38
* Returns the number of registered topic subscriptions. The method does
47
39
* not differentiate between pending and acknowledged subscriptions.
48
40
*
49
41
* @return int
50
42
*/
51
- public function countTopicSubscriptions (): int ;
43
+ public function countSubscriptions (): int ;
52
44
53
45
/**
54
46
* Adds a topic subscription to the repository.
55
47
*
56
48
* @param TopicSubscription $subscription
57
49
* @return void
58
50
*/
59
- public function addTopicSubscription (TopicSubscription $ subscription ): void ;
51
+ public function addSubscription (TopicSubscription $ subscription ): void ;
60
52
61
53
/**
62
54
* Get all topic subscriptions with the given message identifier.
63
55
*
64
56
* @param int $messageId
65
57
* @return TopicSubscription[]
66
58
*/
67
- public function getTopicSubscriptionsWithMessageId (int $ messageId ): array ;
59
+ public function getSubscriptionsWithMessageId (int $ messageId ): array ;
68
60
69
61
/**
70
62
* Find a topic subscription with the given topic.
@@ -90,7 +82,7 @@ public function getTopicSubscriptionsMatchingTopic(string $topic): array;
90
82
* @param string $topic
91
83
* @return bool
92
84
*/
93
- public function removeTopicSubscription (string $ topic ): bool ;
85
+ public function removeSubscription (string $ topic ): bool ;
94
86
95
87
/**
96
88
* Returns the number of pending publish messages.
@@ -115,40 +107,55 @@ public function addPendingPublishedMessage(PublishedMessage $message): void;
115
107
*/
116
108
public function getPendingPublishedMessageWithMessageId (int $ messageId ): ?PublishedMessage ;
117
109
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
118
119
/**
119
- * Gets a list of pending published messages last sent before the given date time .
120
+ * Returns the number of pending unsubscribe requests .
120
121
*
121
- * @param DateTime $dateTime
122
- * @return PublishedMessage[]
122
+ * @return int
123
123
*/
124
- public function getPendingPublishedMessagesLastSentBefore ( DateTime $ dateTime ): array ;
124
+ public function countPendingOutgoingMessages ( ): int ;
125
125
126
126
/**
127
- * Marks the pending published message with the given message identifier as received.
128
- * If the message has no QoS level of 2, is not found or has already been received,
129
- * false is returned. Otherwise the result will be true.
127
+ * Gets a list of pending outgoing messages last sent before the given date time.
130
128
*
131
- * @param int $messageId
132
- * @return bool
129
+ * @param DateTime $dateTime
130
+ * @return PublishedMessage[]
133
131
*/
134
- public function markPendingPublishedMessageAsReceived (int $ messageId ): bool ;
132
+ public function getPendingOutgoingMessagesLastSentBefore (DateTime $ dateTime ): array ;
133
+
135
134
136
135
/**
137
- * Removes a pending published message from the repository. If a pending message
138
- * with the given identifier is found and successfully removed from the repository,
139
- * `true` is returned. Otherwise `false` will be returned.
136
+ * Returns the number of pending publish confirmations.
140
137
*
141
- * @param int $messageId
142
- * @return bool
138
+ * @return int
143
139
*/
144
- public function removePendingPublishedMessage (int $ messageId ): bool ;
140
+ public function countPendingPublishConfirmations (): int ;
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
145
149
146
150
/**
147
- * Returns the number of pending unsubscribe requests.
151
+ * Marks the pending published message with the given message identifier as received.
152
+ * If the message has no QoS level of 2, is not found or has already been received,
153
+ * false is returned. Otherwise the result will be true.
148
154
*
149
- * @return int
155
+ * @param int $messageId
156
+ * @return bool
150
157
*/
151
- public function countPendingUnsubscribeRequests ( ): int ;
158
+ public function markPendingPublishedMessageAsReceived ( int $ messageId ): bool ;
152
159
153
160
/**
154
161
* Adds a pending unsubscribe request to the repository.
@@ -166,13 +173,28 @@ public function addPendingUnsubscribeRequest(UnsubscribeRequest $request): void;
166
173
*/
167
174
public function getPendingUnsubscribeRequestWithMessageId (int $ messageId ): ?UnsubscribeRequest ;
168
175
176
+
169
177
/**
170
- * Gets a list of pending unsubscribe requests last sent before the given date time .
178
+ * Adds a pending publish confirmation to the repository .
171
179
*
172
- * @param DateTime $dateTime
173
- * @return UnsubscribeRequest[]
180
+ * @param PublishedMessage $message
181
+ * @return void
182
+ * @throws PendingPublishConfirmationAlreadyExistsException
183
+ */
184
+ public function addPendingPublishConfirmation (PublishedMessage $ message ): void ;
185
+
186
+ /**
187
+ * Gets a pending publish confirmation with the given message identifier, if found.
188
+ *
189
+ * @param int $messageId
190
+ * @return PublishedMessage|null
174
191
*/
175
- public function getPendingUnsubscribeRequestsLastSentBefore (DateTime $ dateTime ): array ;
192
+ public function getPendingPublishConfirmationWithMessageId (int $ messageId ): ?PublishedMessage ;
193
+
194
+
195
+
196
+
197
+
176
198
177
199
/**
178
200
* Removes a pending unsubscribe requests from the repository. If a pending request
@@ -184,29 +206,16 @@ public function getPendingUnsubscribeRequestsLastSentBefore(DateTime $dateTime):
184
206
*/
185
207
public function removePendingUnsubscribeRequest (int $ messageId ): bool ;
186
208
187
- /**
188
- * Returns the number of pending publish confirmations.
189
- *
190
- * @return int
191
- */
192
- public function countPendingPublishConfirmations (): int ;
193
-
194
- /**
195
- * Adds a pending publish confirmation to the repository.
196
- *
197
- * @param PublishedMessage $message
198
- * @return void
199
- * @throws PendingPublishConfirmationAlreadyExistsException
200
- */
201
- public function addPendingPublishConfirmation (PublishedMessage $ message ): void ;
202
209
203
210
/**
204
- * Gets a pending publish confirmation with the given message identifier, if found.
211
+ * Removes a pending published message from the repository. If a pending message
212
+ * with the given identifier is found and successfully removed from the repository,
213
+ * `true` is returned. Otherwise `false` will be returned.
205
214
*
206
215
* @param int $messageId
207
- * @return PublishedMessage|null
216
+ * @return bool
208
217
*/
209
- public function getPendingPublishConfirmationWithMessageId (int $ messageId ): ? PublishedMessage ;
218
+ public function removePendingPublishedMessage (int $ messageId ): bool ;
210
219
211
220
/**
212
221
* Removes the pending publish confirmation with the given message identifier
0 commit comments