Skip to content

Membership

Charlie Crean edited this page Jan 27, 2022 · 28 revisions

Components

GroupPolicyProvider

Description

The group policy provider supplies a holding identity's GroupPolicy Java object. It comes as a GroupPolicy.json file in a .cpi.

Implementation

The GroupPolicyProvider component has only one implementation, which depends on the virtual node read component, and the .cpi information read component.

  1. The virtual node read component retrieves virtual node information for the holding identity.
  2. The .cpi information component retrieves the node's .cpi metadata, which includes the group policy files as a string.
  3. This GroupPolicyProvider component implementation parses the string into a GroupPolicy object.

GroupPolicy objects are cached, so multiple reads return the same object. The cache clears when the component stops or if it goes down due to down dependencies.

Usage

The MembershipGroupReaderProvider uses GroupPolicyProvider to expose the GroupPolicy object internally to any interested parties, through the group reader objects. For static networks, GroupPolicy.json defines the static member list. It is used in the static registration implementation of the MemberRegistrationService.

Lifecycle handling

The single default implementation of the GroupPolicyProvider component responds to incoming events with these behaviors.

Start event:

  1. Creates cache map (if it hasn't already been created or it has been closed).
  2. Create registration handle for dependencies (if it hasn't already been created).

Registration changed to status UP event:

  1. Creates cache map (if it hasn't already been created or it has been closed).
  2. Creates callback with virtual node service so that the cache is updated when virtual node info changes.
  3. Sets lifecycle status to UP.

Registration changed to status DOWN event:

  1. Sets lifecycle status to DOWN.
  2. Closes the handle on virtual node component callback.
  3. Closes (nullifies) the cache map.

Stop event:

  1. Sets lifecycle status to DOWN.
  2. Closes the handle on virtual node component callback.
  3. Closes the handle on registration for dependency components.
  4. Closes (nullifies) the cache map.

MembershipGroupReaderProvider

Description

This component provides a group reader for a holding identity. A network member can call it to access the group data it has permission to see, such as group parameters, and to access functionality such as member lookups.

Implementations

There is only one implementation of this component, which creates group reader instances on request and caches them for faster lookups later. It also creates subscriptions to receive group data, which it caches and uses later to create the group readers as needed. These caches are cleared when this component stops or goes down and they are recreated when the component starts or comes back up.

Usage

Any internal component can use the MembershipGroupReaderProvider if it requires member lookups or a member's view of group data, such as group parameters. It can also be used to access the member's group policy file or .cpi whitelist. For example, P2P components can use it to look up member information.

Lifecycle handling

The single default implementation of the MembershipGroupReaderProvider component responds to incoming events with these behaviors.

Start event:

  1. Initiates caches for group data and group readers (if they haven't already been created).
  2. Creates registration handle for dependency components (if one hasn't already been created).

Registration changed to status UP event:

  1. Registers configuration change callback handler.
  2. Sets lifecycle status to UP.

Registration changed to status DOWN event:

  1. Sets lifecycle status to DOWN.
  2. Closes the handle on registered configuration callback.

Configuration received event

  1. Sets lifecycle status to DOWN.
  2. Stops subscriptions.
  3. Closes caches.
  4. Recreates caches.
  5. Recreates subscriptions with updated configuration.
  6. Sets lifecycle status to UP.

Currently, only the MESSAGING configuration is handled.

Stop event:

  1. Sets lifecycle status to DOWN.
  2. Stops subscriptions.
  3. Closes caches.
  4. Closes registered callback handler for configuration and dependency services status changes.