ContextManageable

public protocol ContextManageable : AnyObject

Manage capability agent’s context. Context is a container used to communicate the state of the capability agents to server.

  • Add ContextInfoDelegate to ContextManager

    When the context manager receives a getContexts request it queries the registered ContextInfoDelegate for updated context.

    Declaration

    Swift

    func add(delegate: ContextInfoDelegate)

    Parameters

    delegate

    The object that acts as the provider of the ContextManager

  • Remove ContextInfoDelegate from ContextManager

    Declaration

    Swift

    func remove(delegate: ContextInfoDelegate)

    Parameters

    delegate

    The object to remove

  • Request the ContextManager for context.

    Request will be sent to the ContextInfoDelegate via the contextInfoRequestContext requests.

    Declaration

    Swift

    func getContexts(completion: @escaping ([ContextInfo]) -> Void)

    Parameters

    completion

    A completion handler block to execute when all of the requests are finished.

  • Request the ContextManager for context.

    Request will be sent to the ContextInfoDelegate via the contextInfoRequestContext requests. [ContextInfo] includes only version information.(Except namespace‘s ContextInfo).

    Declaration

    Swift

    func getContexts(namespace: String, completion: @escaping ([ContextInfo]) -> Void)

    Parameters

    namespace

    May be CapabilityAgentCategory.name.

    completion

    A completion handler block to execute when all of the requests are finished.