Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The system:subscribe event is used to create a channel between two Personal Clouds.

...

cloudos

...

:subscribe

...

  • channelName
  • namespace
  • relationship
  • targetChannel

(channelName, namespace, relationship, targetChannel)

  • The channelName attribute is a label associated with the subscription that should convey meaning to developer. The channelName is only used as a component in the creation of the event channel identifier. If no channelName is specified the value of "orphan" will be used.
  • The namespace attribute is provided as a means for the developer to group subscriptions within a single, or group, or applications. The namespace is used to filter the list of subscriptions returned by the subscriptionList() function. If no namespace is specified the value of "shared" will be used.
  • The relationship attribute allows the developer to characterize the relationship between the originator and target clouds. The relationship attribute should be specified as a pair of values separated by a dash (e.g. parent-child, peer-peer, master-slave). The first value of the relationship attribute will be stored with the originating Personal Cloud subscription, the second value will be stored with the target Personal Cloud subscription. The relationship attribute values are used to filter the list of subscriptions returned by the subscriptionList() function. If no relationship is specified the value of "peer-peer" will be used.
  • The targetChannel attribute is the event channel identifier for the target cloud to which the subscription is to be made.
The app ruleset wishing to create the subscription signals the CloudOS to do so by raising the system:subscribeevent. This is most often done in a rule postlude as shown in the following example:
Code Block
themeConfluence
languagejavascript
fired {
  raise cloudos event subscribe
    with channelName   = "Coworkers Bob+Ted"
    and  namespace     = "MyFriends"
    and  relationship  = "friend-friend"
    and  targetChannel = "3f15b820-af7f-012f-4c6e-00163ebczzzz"
    and  _api = "sky";
}

 

Upon receiving the subscription request, the target cloud raises the following event to the originating cloud

The CloudOS service raises the cloudos:subscriptionRequestAdded event within the originating cloud so that other rulesets can take action, if needed:

  • domain: cloudos
  • type: subscriptionRequestAdded
  • attributes: targetChannelbackChannelnamespace, relationshipchannelName

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

Code Block
themeConfluence
languagejavascript
rule receive_subscriptionRequestAdded
  select when cloudos subscriptionRequestAdded
    namespace re/MyFriends/"
    channelName re/Coworkers Bob+Ted/
    relationship re/friend-friend/
 

The

Personal Cloud receiving the subscription request will have the following event raised

CloudOS services in the target cloud raises the cloudos:subscriptionRequestPending to signal the receipt of a pending subscription request:

 
  • domain: cloudos
  • type: subscriptionRequestPending subscriptionRequestPending
  • attributes: eventChannel, namespace namespace, relationship, channelName 
  • channelName

Subscription Approval or Rejection

...