This API documentation is for Ballerina 1.2.0. View API documentation for the latest release.

Object - websub : HubPersistenceStore

Represents the hub persistence configuration and functions.

Methods

Adds or updates subscription details.

Removes subscription details.

Function to add a topic.

Function to remove a topic.

Function to retrieve subscription details of all subscribers.

Function to retrieve all registered topics.

addSubscription

(SubscriptionDetails subscriptionDetails)

returns error?

Adds or updates subscription details.

 error? result = hubPersistenceStore.addSubscription(subscriptionDetails);

Parameters

  • Return Type

    (error?)
  • An error if an error occurred while adding the subscription or else () otherwise

removeSubscription

(SubscriptionDetails subscriptionDetails)

returns error?

Removes subscription details.

 error? result = hubPersistenceStore.removeSubscription(subscriptionDetails);

Parameters

  • Return Type

    (error?)
  • An error if an error occurred while removing the subscription or else () otherwise

addTopic

(string topic)

returns error?

Function to add a topic.

 error? result = hubPersistenceStore.addTopic("topic");

Parameters

  • topic string
  • The topic to add

  • Return Type

    (error?)
  • An error if an error occurred while adding the topic or else () otherwise

removeTopic

(string topic)

returns error?

Function to remove a topic.

 error? result = hubPersistenceStore.removeTopic("topic");

Parameters

  • topic string
  • The topic to remove

  • Return Type

    (error?)
  • An error if an error occurred while removing the topic or else () otherwise

retrieveAllSubscribers

()

returns SubscriptionDetails[] | error

Function to retrieve subscription details of all subscribers.

 SubscriptionDetails[]|error result = hubPersistenceStore.retrieveAllSubscribers();
  • Return Type

    (SubscriptionDetails[] | error)
  • An array of subscriber details or else an error if an error occurred while retrieving the subscriptions

retrieveTopics

()

returns string[] | error

Function to retrieve all registered topics.

 string[]|error result = hubPersistenceStore.retrieveTopics();
  • Return Type

    (string[] | error)
  • An array of topics or else error if an error occurred while retrieving the topics