API Docs for:
Show:

EndpointsController Class

Module: store.endpoints
Parent Module: store

This controller manages the endpoints for services, handling the events for the services ModelList and maintaining the endpoints map.

EndpointsController({env: Environment, db: Database})

Methods

addServiceToEndpointsMap

(
  • svcName
  • charm
)
Undefined

Add the service and charm to the endpoints map.

Parameters:

  • svcName String

    The name of the service.

  • charm Object

    The charm for the service.

Returns:

Undefined: Nothing.

bind

() Undefined

Bind events for endpoint processing.

Returns:

Undefined: Nothing.

destructor

() Undefined

Destroy this controller

Returns:

Undefined: Nothing.

flatten

(
  • meta
)
List

Flatten the relation metadata.

Parameters:

  • meta Object

    The relation metadata.

Returns:

List: A list of objects, where each entry is a hash with a 'name' key and the key value pairs from the metadata.

handleServiceEvent

(
  • service
)
Undefined

Generic handler for a service event. If it is not pending, make sure we have a charm. If the charm has loaded, set or update the service's endpoints; otherwise, make that happen once the load has completed.

Parameters:

  • service Object

    A service model.

Returns:

Undefined: Nothing.

initializer

(
  • cfg
)

Parameters:

  • cfg Object

    Application configuration data.

reset

() Undefined

Reset the endpoints map.

Returns:

Undefined: Nothing.

serviceAddHandler

(
  • evt
)
Undefined

Handle event for a service being added to the services modellist.

Parameters:

  • evt Object

    The event, containing a model object.

Returns:

Undefined: Nothing.

serviceChangeHandler

(
  • evt
)
Undefined

Handle event for a service transitioning from a ghost to a corporeal object as indicated by the 'pending' attribute becoming false. Also handles changes in the service's charm.

Parameters:

  • evt Object

    The event, containing the service as the target.

Returns:

Undefined: Nothing.

serviceRemoveHandler

(
  • evt
)
Undefined

Handle event for a service removal.

Parameters:

  • evt Object

    The event, containing the service as the target.

Returns:

Undefined: Nothing.

setupCharmOnceLoad

(
  • charm
  • svcName
)
Undefined

Setup once('load') handler for a charm.

Parameters:

  • charm Object

    The charm to watch.

  • svcName String

    The name of the correpsonding service.

Returns:

Undefined: Nothing.

unbind

() Undefined

Unbind events for endpoint processing.

Returns:

Undefined: Nothing.

Properties

_allowAdHocAttrs

Boolean protected

Defined in app/store/endpoints.js:25

Available since 3.5.0

Tell Y.Base that it should create ad hoc attributes for config properties.

Default: true