EndpointsController Class
This controller manages the endpoints for services, handling the events for the services ModelList and maintaining the endpoints map.
EndpointsController({env: Environment, db: Database})
Item Index
Methods
Properties
Methods
addServiceToEndpointsMap
-
svcName -
charm
Add the service and charm to the endpoints map.
Parameters:
-
svcNameStringThe name of the service.
-
charmObjectThe charm for the service.
Returns:
bind
()
Undefined
Bind events for endpoint processing.
Returns:
destructor
()
Undefined
Destroy this controller
Returns:
flatten
-
meta
Flatten the relation metadata.
Parameters:
-
metaObjectThe relation metadata.
Returns:
handleServiceEvent
-
service
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:
-
serviceObjectA service model.
Returns:
initializer
-
cfg
Parameters:
-
cfgObjectApplication configuration data.
reset
()
Undefined
Reset the endpoints map.
Returns:
serviceAddHandler
-
evt
Handle event for a service being added to the services modellist.
Parameters:
-
evtObjectThe event, containing a model object.
Returns:
serviceChangeHandler
-
evt
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:
-
evtObjectThe event, containing the service as the target.
Returns:
serviceRemoveHandler
-
evt
Handle event for a service removal.
Parameters:
-
evtObjectThe event, containing the service as the target.
Returns:
setupCharmOnceLoad
-
charm -
svcName
Setup once('load') handler for a charm.
Parameters:
-
charmObjectThe charm to watch.
-
svcNameStringThe name of the correpsonding service.
Returns:
unbind
()
Undefined
Unbind events for endpoint processing.
Returns:
Properties
_allowAdHocAttrs
Boolean
protected
Tell Y.Base that it should create ad hoc attributes for
config properties.
Default: true
