Class: Subscriber

Subscriber

Subscriber defines the name and the ID of the Subscriber and the Callbacks (with possible restrictions) what the subscriber is interested in.

new Subscriber()

Constructor: Initializes the subscriptionCallbacks, subscriptionCallbacks and conditions.

Requires

  • module:easejs
  • module:AttributeTypeList
  • module:CallbackList
  • module:Condition
  • module:ConditionList

Members

privateattributesSubsetAttributeTypeList

Restricts the associated Attributes of the callback to a subset (i.e: the subscriber wants a subset from the available the context data). If no attributes are specified, all available attributes will returned.

privateconditionsConditionList

Defines special conditions for notification.

privatesubscriberIdstring

ID of the Subscriber.

privatesubscriptionCallbacksCallbackList

Callbacks that should be subscribed.

Methods

addCondition(_condition)

Adds a condition.
Name Type Description
_condition Condition Condition

equals(_subscriber){boolean}

Compares this instance with the given one.
Name Type Description
_subscriber Subscriber Subscriber that should be compared.

getAttributesSubset(){string}

Returns the attributesSubset.

getConditions(){string}

Returns the conditions.

getSubscriberId(){string}

Returns the subscriberId.

getSubscriberName(){string}

Returns the name.

getSubscriptionCallbacks(){CallbackList}

Returns the subscriptionCallbacks.

removeCondition(_condition)

Removes a condition.
Name Type Description
_condition Condition Condition

setAttributesSubset(_attributesSubset)

Sets the attributesSubset.
Name Type Description
_attributesSubset AttributeTypeList attributesSubset

setConditions(_conditions)

Sets the conditions.
Name Type Description
_conditions Callback | Array conditions

setSubscriberId(_subscriberId)

Sets the subscriberId.
Name Type Description
_subscriberId string subscriberId

setSubscriberName(_subscriberName)

Sets the setSubscriberName.
Name Type Description
_subscriberName string subscriberName

setSubscriptionCallbacks(_subscriptionCallbacks)

Sets the subscriptionCallbacks.
Name Type Description
_subscriptionCallbacks CallbackList subscriptionCallbacks

withAttributesSubset(_attributesSubset){Subscriber}

Builder for attributesSubset.
Name Type Description
_attributesSubset AttributeTypeList attributesSubset

withConditions(_conditions){Subscriber}

Builder for conditions.
Name Type Description
_conditions ConditionList | Array conditions

withSubscriberId(_subscriberId){Subscriber}

Builder for subscriberId.
Name Type Description
_subscriberId String subscriberId

withSubscriberName(_subscriberName){Subscriber}

Builder for subscriberName.
Name Type Description
_subscriberName String subscriberName

withSubscriptionCallbacks(_subscriptionCallbacks){Subscriber}

Builder for subscriptionCallbacks.
Name Type Description
_subscriptionCallbacks CallbackList subscriptionCallbacks