@@ -24,17 +24,17 @@ The conforming implementation of the specification is released and included in t
24
24
* 2.1.2 [ Initialization] ( #212-initialization )
25
25
* 2.1.3 [ Methods] ( #213-methods )
26
26
* 2.2. [ Service] ( #22-service )
27
- * 2.2.1. [ Methods ] ( #221-methods )
28
- * 2.2.1.1. [ onRegisterTopic ] ( #2211-onregistertopic )
29
- * 2.2.1.2. [ onDeregisterTopic ] ( #2212-onderegistertopic )
30
- * 2.2.1.3 . [ onEventMessage ] ( #2213-oneventmessage )
31
- * 2.2.1.4 . [ onSubscription ] ( #2214-onsubscription )
32
- * 2.2.1.5 . [ onSubscriptionValidation ] ( #2215-onsubscriptionvalidation )
33
- * 2.2.1.6 . [ onSubscriptionIntentVerified ] ( #2216-onsubscriptionintentverified )
34
- * 2.2.1.7 . [ onUnsubscritpion ] ( #2217-onunsubscritpion )
35
- * 2.2.1.8 . [ onUnsubscriptionValidation ] ( #2218-onunsubscriptionvalidation )
36
- * 2.2.1.9 . [ onUnsubscriptionIntenVerified ] ( #2219-onunsubscriptionintenverified )
37
- * 2.2.1. [ Annotation ] ( #222-annotation )
27
+ * 2.2.1. [ Annotation ] ( #221-annotation )
28
+ * 2.2.2. [ Methods ] ( #222-methods )
29
+ * 2.2.2.1. [ onRegisterTopic ] ( #2221-onregistertopic )
30
+ * 2.2.2.2 . [ onDeregisterTopic ] ( #2222-onderegistertopic )
31
+ * 2.2.2.3 . [ onEventMessage ] ( #2223-oneventmessage )
32
+ * 2.2.2.4 . [ onSubscription ] ( #2224-onsubscription )
33
+ * 2.2.2.5 . [ onSubscriptionValidation ] ( #2225-onsubscriptionvalidation )
34
+ * 2.2.2.6 . [ onSubscriptionIntentVerified ] ( #2226-onsubscriptionintentverified )
35
+ * 2.2.2.7 . [ onUnsubscritpion ] ( #2227-onunsubscritpion )
36
+ * 2.2.2.8 . [ onUnsubscriptionValidation ] ( #2228-onunsubscriptionvalidation )
37
+ * 2.2.2.9. [ onUnsubscriptionIntenVerified ] ( #2229-onunsubscriptionintenverified )
38
38
* 2.3. [ Hub Client] ( #23-hub-client )
39
39
* 2.3.1. [ Initialization] ( #231-initialization )
40
40
* 2.3.2. [ Distribute Content] ( #232-distribute-content )
@@ -213,9 +213,25 @@ public type Service distinct service object {
213
213
};
214
214
```
215
215
216
- #### 2.2.1. Methods
216
+ #### 2.2.1. Annotation
217
217
218
- ##### 2.2.1.1. onRegisterTopic
218
+ Apart from the listener level configurations a ` hub ` will require few additional configurations. Hence, there should be
219
+ ` websubhub:ServiceConfig ` a service-level-annotation for ` websubhub:Service ` which contains
220
+ ` websubhub:ServiceConfiguration ` record.
221
+ ``` ballerina
222
+ # Configuration for a WebSub Hub service.
223
+ #
224
+ # + leaseSeconds - The period for which the subscription is expected to be active in the `hub`
225
+ # + webHookConfig - HTTP client configurations for subscription/unsubscription intent verification
226
+ public type ServiceConfiguration record {|
227
+ int leaseSeconds?;
228
+ ClientConfiguration webHookConfig?;
229
+ |};
230
+ ```
231
+
232
+ #### 2.2.2. Methods
233
+
234
+ ##### 2.2.2.1. onRegisterTopic
219
235
220
236
This remote method is invoked when the ` publisher ` sends a request to register a ` topic ` to the ` hub ` .
221
237
``` ballerina
@@ -228,7 +244,7 @@ remote function onRegisterTopic(websubhub:TopicRegistration msg)
228
244
returns websubhub:TopicRegistrationSuccess|websubhub:TopicRegistrationError|error;
229
245
```
230
246
231
- ##### 2.2.1 .2. onDeregisterTopic
247
+ ##### 2.2.2 .2. onDeregisterTopic
232
248
233
249
This remote method is invoked when the ` publisher ` sends a request to remove a ` topic ` from the ` hub ` .
234
250
``` ballerina
@@ -241,7 +257,7 @@ remote function onDeregisterTopic(websubhub:TopicDeregistration msg)
241
257
returns websubhub:TopicDeregistrationSuccess|websubhub:TopicDeregistrationError|error;
242
258
```
243
259
244
- ##### 2.2.1 .3. onEventMessage
260
+ ##### 2.2.2 .3. onEventMessage
245
261
246
262
This remote method is invoked when the ` publisher ` sends a request to notify the ` hub ` about content update for a
247
263
` topic ` .
@@ -255,7 +271,7 @@ remote function onUpdateMessage(websubhub:UpdateMessage msg)
255
271
returns websubhub:Acknowledgement|websubhub:UpdateMessageError|error;
256
272
```
257
273
258
- ##### 2.2.1 .4. onSubscription
274
+ ##### 2.2.2 .4. onSubscription
259
275
260
276
This remote method is invoked when the ` subscriber ` sends a request to subscribe for a ` topic ` in the ` hub ` . (This is an
261
277
optional remote method.)
@@ -273,7 +289,7 @@ remote function onSubscription(websubhub:Subscription msg)
273
289
websubhub:InternalSubscriptionError|error;
274
290
```
275
291
276
- ##### 2.2.1 .5. onSubscriptionValidation
292
+ ##### 2.2.2 .5. onSubscriptionValidation
277
293
278
294
This remote method is invoked when subscription request from the ` subscriber ` is accepted from the ` hub ` . ` hub ` could
279
295
enforce additional validation for the subscription request when this method is invoked. If the validations are failed
@@ -288,7 +304,7 @@ remote function onSubscriptionValidation(websubhub:Subscription msg)
288
304
returns websubhub:SubscriptionDeniedError|error?;
289
305
```
290
306
291
- ##### 2.2.1 .6. onSubscriptionIntentVerified
307
+ ##### 2.2.2 .6. onSubscriptionIntentVerified
292
308
293
309
This remote method is invoked after the ` hub ` verifies the subscription request.
294
310
``` ballerina
@@ -299,7 +315,7 @@ This remote method is invoked after the `hub` verifies the subscription request.
299
315
remote function onSubscriptionIntentVerified(websubhub:VerifiedSubscription msg) returns error?;
300
316
```
301
317
302
- ##### 2.2.1 .7. onUnsubscritpion
318
+ ##### 2.2.2 .7. onUnsubscritpion
303
319
304
320
This remote method is invoked when the ` subscriber ` sends a request to unsubscribe from a ` topic ` in the ` hub ` . (This is
305
321
an optional remote method.)
@@ -315,7 +331,7 @@ remote function onUnsubscription(websubhub:Unsubscription msg)
315
331
websubhub:InternalUnsubscriptionError|error;
316
332
```
317
333
318
- ##### 2.2.1 .8. onUnsubscriptionValidation
334
+ ##### 2.2.2 .8. onUnsubscriptionValidation
319
335
320
336
This remote method is invoked when unsubscription request from the ` subscriber ` is accepted from the ` hub ` . ` hub ` could
321
337
enforce additional validation for the unsubscription request when this method is invoked. If the validations are failed
@@ -330,7 +346,7 @@ remote function onUnsubscriptionValidation(websubhub:Unsubscription msg)
330
346
returns websubhub:UnsubscriptionDeniedError|error?;
331
347
```
332
348
333
- ##### 2.2.1 .9. onUnsubscriptionIntenVerified
349
+ ##### 2.2.2 .9. onUnsubscriptionIntenVerified
334
350
335
351
This remote method is invoked after the ` hub ` verifies the unsubscription request.
336
352
``` ballerina
@@ -359,22 +375,6 @@ This is due to the limited information in the WebSub specification on the relati
359
375
In the event of a bad request from the ` publisher ` or the ` subscriber ` , the WebSubHub dispatcher will automatically send
360
376
back the appropriate response to the client.
361
377
362
- #### 2.2.2. Annotation
363
-
364
- Apart from the listener level configurations a ` hub ` will require few additional configurations. Hence, there should be
365
- ` websubhub:ServiceConfig ` a service-level-annotation for ` websubhub:Service ` which contains
366
- ` websubhub:ServiceConfiguration ` record.
367
- ``` ballerina
368
- # Configuration for a WebSub Hub service.
369
- #
370
- # + leaseSeconds - The period for which the subscription is expected to be active in the `hub`
371
- # + webHookConfig - HTTP client configurations for subscription/unsubscription intent verification
372
- public type ServiceConfiguration record {|
373
- int leaseSeconds?;
374
- ClientConfiguration webHookConfig?;
375
- |};
376
- ```
377
-
378
378
### 2.3. Hub Client
379
379
380
380
In accordance with the [ WebSub specification] ( https://www.w3.org/TR/websub/#content-distribution ) , ` WebSubHub ` package
0 commit comments