...
The following shows a rule that is selected when the cloudos:subscriptionAdded event
is raised:
Code Block | ||||
---|---|---|---|---|
| ||||
rule process_subscriptionAdded {
select when cloudos subscriptionAdded
namespace re/MyFriends/
channelName re/Coworkers Bob+Ted/
relationship re/friend-friend/
...
} |
Subscription Approval Event Flow
- The cloudos:subscriptionRequestApproved is raised into the Target personal cloud after creating a new channel.
- CloudOS raises the event cloudos:subscriptionAdded within the Target personal cloud.
- CloudOS raises a event over the eventChannel to the Originating personal cloud to indicate that the subscription request has been approved.
- Within the Originating personal cloud CloudOS raises the cloudos:subscriptionAdded event.
Rejection
To reject the subscription request a ruleset in the the target cloud raises the cloudos:subscriptionRequestRejected
event to signal the CloudOS service that the subscription is rejected:
Domain | cloudos |
---|---|
Type | subscriptionRequestRejected |
Attributes | eventChannel |
For example, the following postlude would raise the cloudos:subscriptionRequestRejected
event:
Code Block | ||||
---|---|---|---|---|
| ||||
fired {
raise cloudos event subscriptionRequestRejected
with eventChannel = "3f15b820-af7f-012f-4c6e-00163ebcaaaa"
and _api = "sky";
} |
When the subscription request is rejected the CloudOS service will raise the cloudos:subscriptionRejected
event within the target cloud (i.e. the cloud rejecting the subscription):
Domain | cloudos |
---|---|
Type | subscriptionRejected |
Attributes | eventChannel, namespace, relationship, channelName |
The following rule is selected when the cloudos:subscriptionRejected
event is seen:
Code Block | ||||
---|---|---|---|---|
| ||||
rule receive_subscriptionRejected {
select when cloudos subscriptionRejected
namespace re/MyFriends/
channelName re/Coworkers Bob+Ted/
relationship re/friend-friend/
...
} |
In addition, the CloudOS service raises the cloudos:subscriptionRejected
event in the originating cloud:
Domain | cloudos |
---|---|
Type | subscriptionRejected |
Attributes | backChannel, namespace, relationship, channelName |
The only difference is that the attribute backChannel is contains the value of the ECI to the target cloud.
The following rule is selected when
the cloudosthe cloudos:subscriptionRejected
event is raised:
Code Block | ||||
---|---|---|---|---|
| ||||
rule receive_subscriptionRejected { select when cloudos subscriptionRejected namespace re/MyFriends/ channelName re/Coworkers Bob+Ted/ relationship re/friend-friend/ ... } |
Subscription Rejection Event Flow
- The cloudos:subscriptionRequestRejected event is raised into the Target personal cloud.
- CloudOS raises the cloudos:subscriptionRejected event within the Target personal cloud.
- CloudOS raises an event over the eventChannel to the Originating personal cloud to indicate that the subscription request was rejected.
- Within the Originating personal cloud the CloudOS raises the cloudos:subscriptionRejected event.
...
The following postlude shows this event being raisesraised:
Code Block | ||||
---|---|---|---|---|
| ||||
fired {
raise cloudos event unsubscribe
with eventChannel = "3f15b820-7aff-012f-4c6e-00163ebcfddfd"
and _api = "sky";
} |
The CloudOS service in both the originating and target clouds raises the cloudos:subscriptionRemoved
event so that rulesets within the respective clouds can take any appropriate action:
Domain | cloudos |
---|---|
Type | subscriptionRemoved |
Attributes | eventChannel, backChannel, namespace, relationship, channelName |
The following rule is selected when the cloudos:CloudOS_subscriptionRemoved
event is raised:
Code Block | ||||
---|---|---|---|---|
| ||||
rule receive_subscriptionRemoved {
select when cloudos subscriptionRemoved
namespace re/MyFriends/
channelName re/Coworkers Bob+Ted/
relationship re/friend-friend/
...
} |
Unsubscribe Event Flow
- The cloudos:unsubscribe event is raised into the Originating personal cloud. Do note that it is also possible to raised the cloudos:unsubscribe event in the Target personal cloud as well.
- CloudOS raises the cloudos:subscriptionRemoved event within the Originating personal cloud.
- CloudOS raises an event over the eventChannel to the Target personal cloud to indicate that the subscription has been removed.
- Within the Target personal cloud the cloudos:subscriptionRemoved event is raised.
...
The subscriptionList()
function will return a map of the subscriptions within the specified namespace and relationship.
Code Block | ||||
---|---|---|---|---|
| ||||
[subscriptionList() example here] |