-
Notifications
You must be signed in to change notification settings - Fork 27
Membership
The group policy provider supplies a holding identity's GroupPolicy
Java object. It comes as a GroupPolicy.json
file in a .cpi
.
The GroupPolicyProvider
component has only one implementation, which depends on the virtual node read component, and the .cpi
information read component.
- The virtual node read component retrieves virtual node information for the holding identity.
- The
.cpi
information component retrieves the node's.cpi
metadata, which includes the group policy files as a string. - This
GroupPolicyProvider
component implementation parses the string into aGroupPolicy
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.
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
.
The single default implementation of the GroupPolicyProvider
component responds to incoming events with these behaviors.
Start event:
- Creates cache map (if it hasn't already been created or it has been closed).
- Create registration handle for dependencies (if it hasn't already been created).
Registration changed to status UP event:
- Creates cache map (if it hasn't already been created or it has been closed).
- Creates callback with virtual node service so that the cache is updated when virtual node info changes.
- Sets lifecycle status to UP.
Registration changed to status DOWN event:
- Sets lifecycle status to DOWN.
- Closes the handle on virtual node component callback.
- Closes (nullifies) the cache map.
Stop event:
- Sets lifecycle status to DOWN.
- Closes the handle on virtual node component callback.
- Closes the handle on registration for dependency components.
- Closes (nullifies) the cache map.
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.
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.
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.
The single default implementation of the MembershipGroupReaderProvider
component responds to incoming events with these behaviors.
Start event:
- Initiates caches for group data and group readers (if they haven't already been created).
- Creates registration handle for dependency components (if one hasn't already been created).
Registration changed to status UP event:
- Registers configuration change callback handler.
- Sets lifecycle status to UP.
Registration changed to status DOWN event:
- Sets lifecycle status to DOWN.
- Closes the handle on registered configuration callback.
Configuration received event
- Sets lifecycle status to DOWN.
- Stops subscriptions.
- Closes caches.
- Recreates caches.
- Recreates subscriptions with updated configuration.
- Sets lifecycle status to UP.
Currently, only the MESSAGING configuration is handled.
Stop event:
- Sets lifecycle status to DOWN.
- Stops subscriptions.
- Closes caches.
- Closes registered callback handler for configuration and dependency services status changes.