...
- domain: cloudos
- type: CloudOS_subscriptionAdded
- attributes: eventChannel, backChannel, namespace, relationship, channelName
Code Block | ||||
---|---|---|---|---|
| ||||
rule receive_subscriptionRequestAdded select when cloudos subscriptionRequestAdded namespace re/MyFriends"/ channelName re/Coworkers Bob+Ted/ relationship re/friend-friend/ |
To reject the subscription request the following event should be raised:
- domain: cloudos
- type: subscriptionRequestRejected
- attributes: eventChannel
Code Block | ||||
---|---|---|---|---|
| ||||
fired { raise cloudos event subscriptionRequestRejected with eventChannel = "3f15b820-af7f-012f-4c6e-00163ebcaaaa" and _api = "sky"; } |
When the subscription request is rejected the following event will be raised with the Personal Cloud:
- domain: cloudos
- type: subscriptionRejected
- attributes: eventChannel, namespace, relationship, channelName
Code Block | ||||
---|---|---|---|---|
| ||||
rule receive_subscriptionRejected
select when cloudos subscriptionRejected
namespace re/MyFriends/
channelName re/Coworkers Bob+Ted/
relationship re/friend-friend/ |
And the following event will be raised in the Personal Cloud which made the subscription request:
- domain: cloudos
- type: subscriptionRejected
- attributes: backChannel, namespace, relationship, channelName
Code Block | ||||
---|---|---|---|---|
| ||||
firedrule receive_subscriptionRejected { select raisewhen cloudos eventsubscriptionRejected subscribe namespace re/MyFriends/ with channelName =channelName "re/Coworkers Bob+Ted"/ and namespacerelationship re/friend-friend/ |
Unsubscribe
The system:unsubscribe event is used to remove the Personal Channels between two Personal Clouds.
- domain: cloudos
- type: unsubscribe
- attribute: backChannel
Code Block | ||||
---|---|---|---|---|
| ||||
fired { raise cloudos |
event |
unsubscribe |
with eventChannel = "3f15b820-af7f-012f-4c6e- |
00163ebcfddfd" and _api = "sky"; } |
Unsubscribe
The
...
backChannel
...
The backChannel attribute uniquely identifies the Personal Channel within the Personal Cloud, and provided to the target Personal Cloud for raising events into the current Personal Cloud. The backChannel is one of the attributes provided by the subscriptionList() function.
...
- domain: cloudos
- type: CloudOS_subscriptionRemoved
- attributes: eventChannel, backChannel, namespace, relationship, channelName
The eventChannel attribute is the Personal Channel token for the remote Personal Cloud, while the backChannel is the Personal Channel token for the current Personal Cloud.
Code Block | ||||
---|---|---|---|---|
| ||||
always {rule receive_CloudOS_subscriptionRemoved select raisewhen systemcloudos eventCloudOS_subscriptionRemoved unsubscribe namespace withre/MyFriends/ backChannel = "3f15b820-af7f-012f-4c6e-00163ebcfddfd" channelName re/Coworkers Bob+Ted/ and _api = "sky"; }relationship re/friend-friend/ |
Functions
subscriptionList(namespace, relationship)
...