Class: PollingTagUpdater

plugins/polling-updater~PollingTagUpdater(platformopt, optionsopt)

new PollingTagUpdater(platformopt, optionsopt)

Creates the updater instance.

Parameters:
Name Type Attributes Description
platform WirelessTagPlatform <optional>

Platform object through which tags to be updated were (or are going to be) found (or created in discovery mode). In normal mode, this is only used to possibly override configuration options, specifically the base URI for the cloud API endpoints. For discovery mode to work, either this or options.factory must be provided.

options object <optional>

overriding configuration options

Properties
Name Type Attributes Description
wsdl_url string <optional>

the full path for obtaining the WSDL for the SOAP service to be polled (default: WSDL_URL_PATH)

apiBaseURI string <optional>

the base URI to use for API endpoints (default: API_BASE_URI)

discoveryMode boolean <optional>

whether to run in discovery mode or not. Defaults to false.

factory WirelessTagPlatform~factory <optional>

the tag and tag manager object factory to use in discovery mode. Either this, or the platform parameter must be provided for discovery mode to work.

Source:

Members

discoveryMode :boolean

Type:
  • boolean
Source:

factory :WirelessTagPlatform~factory

Type:
Source:

platform :WirelessTagPlatform

Type:
Source:

Methods

addTags(tags) → {module:plugins/polling-updater~PollingTagUpdater}

Adds the given tag object(s) to the ones to be updated by this updater.

Adding the same (determined by identity) object again has no effect. However, an object that represents the same tag as one already added (i.e., has the same uuid property value) will be registered for updates, too.

Parameters:
Name Type Description
tags WirelessTag | Array.<WirelessTag>

the tag object(s) to be updated

Source:
Returns:
Type
module:plugins/polling-updater~PollingTagUpdater

apiClient() → {Promise}

If necessary creates, and otherwise obtains from cache the SOAP client instance for the WSDL endpoint.

Source:
Returns:

Resolves to the SOAP client object.

Type
Promise

removeTags(tags) → {module:plugins/polling-updater~PollingTagUpdater}

Removes the given tags from the ones to be updated by this updater.

Note that only the given object(s) will be removed. Specifically, other tag objects with the same uuid property value, if previously added, remain registered.

Parameters:
Name Type Description
tags WirelessTag | Array.<WirelessTag>

the tag object(s) to be removed from updating

Source:
Returns:
Type
module:plugins/polling-updater~PollingTagUpdater

startUpdateLoop(waitTimeopt, callbackopt)

Starts the continuous update loop. Registered tags will get updated until they are removed, or stopUpdateLoop() is called.

Has no effect if a continuous update loop is already running.

Parameters:
Name Type Attributes Description
waitTime number <optional>

the time to wait until scheduling the next update; defaults to UPDATE_LOOP_WAIT.

callback module:wirelesstags~apiCallback <optional>

result.value will be array of tag data objects returned by the polling API

Source:

stopUpdateLoop()

Stops the continuous update loop. Has no effect if an update loop is not currently active.

Source:

uniqueTagManagers() → {Array.<WirelessTagManager>}

Determines the list of tag managers with unique MACs used by the tag objects registered with this updater, and returns it.

Source:
Returns:
Type
Array.<WirelessTagManager>