Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Warning
titleDraft Specification

This specification is currently a draft under development.

Issues:

  • We need a picture. Fixed
  • Unclear where or who raises approval and rejection events. Should be clear now?
  • Some examples show postlude event raise where PJW thinks an event:send() is correct
  • Not sure why cloudos:CloudOS_subscriptionRemoved and cloudos:CloudOS_subscriptionAdded have CloudOS_ prepended when the event domain gives that information. Also, the provided examples don't have the prepend. Fixed, removed the CloudOS_ prefix.
  • An example of subscriptionList() would be nice

...

The following rule would be selected upon seeing the cloudos:subscriptionRequestAdded event with appropriate values for the event attributes:

Code Block
themeConfluence
languagejavascript
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:

Domaincloudos
Type
subscriptionRequestPending
Attributes
eventChannel, namespace, relationship, channelName

Subscription Event Flow

Image Modified

  1. The cloudos:subscribe event is raised by the originating personal cloud.
  2. CloudOS will create a new channel and raise the cloudos:subscriptionRequestAdded event within the originating personal cloud. The main purpose for raising this event is to provide the application developer the opportunity to capture the newly created channel, backChannel.
  3. CloudOS then raises an event to the target personal cloud over the targentChannel (typically the doorbell ECI) requesting the subscription.
  4. Lastly, the CloudOS in the target personal cloud will raise the cloudos:subscriptionRequestPending providing the application developer the opportunity to respond with either an approval or rejection.

Subscription Approval or Rejection

...

 

Code Block
themeConfluence
languagejavascript
rule process_subscriptionAdded {
  select when cloudos subscriptionAdded
    namespace re/MyFriends/
    channelName re/Coworkers Bob+Ted/
    relationship re/friend-friend/
  ...
}

Subscription Approval Event Flow

Image Modified

  1. The cloudos:subscriptionRequestApproved is raised into the Target personal cloud after creating a new channel.
  2. CloudOS raises the event cloudos:subscriptionAdded within the Target personal cloud.
  3. CloudOS raises a event over the eventChannel to the Originating personal cloud to indicate that the subscription request has been approved.
  4. 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:

Domaincloudos
Type
subscriptionRequestRejected
Attributes
eventChannel


For example, the following postlude would raise the cloudos:subscriptionRequestRejected event:

 

Code Block
themeConfluence
languagejavascript
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):

 

Domaincloudos
Type
subscriptionRejected
Attributes
eventChannel, namespace, relationship, channelName

 

The following rule is selected when the cloudos:subscriptionRejected event is seen:

Code Block
themeConfluence
languagejavascript
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:

Domaincloudos
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 cloudos:subscriptionRejected event is raised:

 

Code Block
themeConfluence
languagejavascript
rule receive_subscriptionRejected {
  select when cloudos subscriptionRejected
    namespace re/MyFriends/
    channelName re/Coworkers Bob+Ted/
    relationship re/friend-friend/
  ...
}

Subscription Rejection Event Flow

  1. The cloudos:subscriptionRequestRejected event is raised into the Target personal cloud.
  2. CloudOS raises the cloudos:subscriptionRejected event within the Target personal cloud.
  3. CloudOS raises an event over the eventChannel to the Originating personal cloud to indicate that the subscription request was rejected.
  4. Within the Originating personal cloud the CloudOS raises the cloudos:subscriptionRejected event.

...

The following rule is selected when the cloudos:CloudOS_subscriptionRemoved event is raised:

Code Block
themeConfluence
languagejavascript
rule receive_subscriptionRemoved {
  select when cloudos subscriptionRemoved
    namespace re/MyFriends/
    channelName re/Coworkers Bob+Ted/
    relationship re/friend-friend/
  ...
}

Unsubscribe Event Flow

  1. 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.
  2. CloudOS raises the cloudos:subscriptionRemoved event within the Originating personal cloud.
  3. CloudOS raises an event over the eventChannel to the Target personal cloud to indicate that the subscription has been removed.
  4. Within the Target personal cloud the cloudos:subscriptionRemoved event is raised.

...