Warning | ||
---|---|---|
| ||
This specification is currently a draft under development. Issues:
|
The CloudOS Subscription Event Protocol provides an event based model for managing subscriptions between Personal Clouds. The current implementation of the protocol will create a symmetric relationship between both Personal Clouds. Cloud subscriptions are done in such a way that both the originating and target clouds end up with a unique event channel to the other that is specific to the purpose for the subscription.
...
The following rule would be selected upon seeing the cloudos:subscriptionRequestAdded
event with appropriate values for the event attributes:
Code Block | ||||
---|---|---|---|---|
| ||||
rule process_subscriptionRequestAdded { select when cloudos subscriptionRequestAdded namespace re/MyFriends/" channelName re/Coworkers Bob+Ted/ relationship re/friend-friend/ ... } |
The CloudOS services in the target cloud raises the cloudos:subscriptionRequestPending
to signal the receipt of a pending subscription request:
Code Block | ||
---|---|---|
| ||
cloudos:subscriptionRequestPending(eventChannel, namespace, relationship, channelName) |
Subscription Approval or Rejection
...
cloudos:subscriptionRequestApproved
event to signal the CloudOS service that the subscription is approved:
Code Block | ||
---|---|---|
| ||
cloudos:subscriptionRequestApproved(eventChannel) |
For example, the following postlude would raise the cloudos:subscriptionRequestApproved
event:
Code Block | ||||
---|---|---|---|---|
| ||||
fired { raise cloudos event subscriptionRequestApproved with eventChannel = "3f15b820-af7f-012f-4c6e-00163ebcaaaa" and _api = "sky"; } |
Once the subscription request is approved, the CloudOS service in both the orginating and target clouds will raise the cloudos:CloudOS_subscriptionAdded
event so that a ruleset can take additional actions once the subscription has been created
Code Block | ||
---|---|---|
| ||
cloudos:CloudOS_subscriptionAdded(eventChannel, backChannel, namespace, relationship, channelName) |
cloudos:CloudOS_subscriptionAdded event
is raised:
Code Block | ||||
---|---|---|---|---|
| ||||
rule process_subscriptionRequestAdded { select when cloudos subscriptionRequestAdded namespace re/MyFriends/ channelName re/Coworkers Bob+Ted/ relationship re/friend-friend/ ... } |
Rejection
To reject the subscription request
the following event should be raised:a ruleset in the the target cloud raises the cloudos:subscriptionRequestRejected
event to signal the CloudOS service that the subscription is rejected:
Code Block | ||
---|---|---|
| ||
cloudos:subscriptionRequestRejected(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"; } |
- domain: cloudos
- type: subscriptionRejected
- attributes: eventChannel, namespace, relationship, channelName
cloudos:subscriptionRejected
event within the target cloud (i.e. the cloud rejecting the subscription):
Code Block | ||
---|---|---|
| ||
cloudos:subscriptionRejected(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:
Code Block | ||
---|---|---|
| ||
cloudos:subscriptionRejected(backChannel, namespace, relationship, channelName) |
The following rule is selected when the 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/ ... } |
Unsubscribe
The system:unsubscribe event is used to remove the Personal Channels between two Personal Clouds.
...