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

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
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:

Code Block
themeConfluence
cloudos:subscriptionRequestPending(eventChannel, namespace, relationship, channelName)

 

Subscription Approval or Rejection

...

To approve the subscription request a ruleset in the the target cloud raises the cloudos:subscriptionRequestApproved event to signal the CloudOS service that the subscription is approved:

 

Code Block
themeConfluence
cloudos:subscriptionRequestApproved(eventChannel)

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

 

Code Block
themeConfluence
languagejavascript
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
themeConfluence
cloudos:CloudOS_subscriptionAdded(eventChannel, backChannel, namespace, relationship, channelName)

 

The following shows a rule that is selected when the cloudos:CloudOS_subscriptionAdded event is raised:

 

Code Block
themeConfluence
languagejavascript
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:
  • domain: cloudos
  • type: subscriptionRequestRejected
  • attributes: eventChannel

    a ruleset in the the target cloud raises the cloudos:subscriptionRequestRejected event to signal the CloudOS service that the subscription is rejected:

    Code Block
    themeConfluence
    cloudos:subscriptionRequestRejected(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 following event will be raised with the Personal Cloud:
    • domain: cloudos
    • type: subscriptionRejected
    • attributes: eventChannel, namespace, relationship, channelName

     

    CloudOS service will raise the cloudos:subscriptionRejected event within the target cloud (i.e. the cloud rejecting the subscription):

     

    Code Block
    themeConfluence
    cloudos:subscriptionRejected(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/

     

    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
    
      ...
    }

    In addition, the CloudOS service raises the cloudos:subscriptionRejected event in the originating cloud:

    Code Block
    themeConfluence
    cloudos:subscriptionRejected(backChannel, namespace, relationship, channelName)

    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/
      ...
    }

     

    Unsubscribe

    The system:unsubscribe event is used to remove the Personal Channels between two Personal Clouds.

    ...