Folks.IndividualAggregator – folks Reference Manual

# IndividualAggregator

## Object Hierarchy:

## Description:

public class IndividualAggregator : Object

Stores Individuals which have been created through aggregation of all the Personas provided by the various Backends.

This is the main interface for client applications.

Linking and unlinking of personas and individuals is performed entirely through the aggregator. Personas may be linked together to form individuals; for example, the personas which form `individual1` and `individual2` may be linked together with `another_persona` to give a new Individual:

      var personas = new HashSet<Persona> ();
      personas.add_all (individual1.personas);
      personas.add_all (individual2.personas);
      personas.add (another_persona);
      yield my_individual_aggregator.link_personas (personas);

The individuals which contained those personas will be removed when IndividualAggregator.link_personas is called. Any personas in those individuals which were not included in the linking call may end up implicitly linked to the new individual, or may be aggregated into other new individuals.

For example, consider the situation where `individual1` contains two personas, `persona1A` and `persona1B` ; `individual2` contains one persona, `persona2A`; and `another_persona` comes from `individual3`, which also contains `persona3A` and `persona3B`. Calling IndividualAggregator.link_personas on `persona1A`, `persona1B`, `persona2A` and `another_persona` will result in `individual1` and `individual2` being removed. A new Individual will be created containing all the personas passed to the linking function. It might also contain `persona3A` and `persona3B`; or they might be in one or two other new individuals.

An existing individual may be unlinked to form singleton individuals for each of its personas:

      yield my_individual_aggregator.unlink_individual (my_individual);

Note that to link two individuals together, their two sets of personas must be linked together. There is no API to directly link the individuals themselves, as conceptually folks links Personas, not Individuals.

Folks does not support having more than one IndividualAggregator instantiated at the same time. Most clients should use IndividualAggregator.dup to retrieve the IndividualAggregator singleton.

Namespace: Folks
Package: folks

## Content:

### Properties:

- public BackendStore backend_store { get; construct; }
  The backend store providing the persona stores for this aggregator.
- public Map<string,Individual> individuals { get; }
  A map from Individual.ids to their Individuals.
- public bool is_prepared { get; }
  Whether IndividualAggregator.prepare has successfully completed for this aggregator.
- public bool is_quiescent { get; }
  Whether the aggregator has reached a quiescent state. This will happen at some point after IndividualAggregator.prepare has successfully completed for the aggregator. An aggregator is in a quiescent state when all the PersonaStores listed by its backends have reached a quiescent state. Once it's reached a quiescent state, this property will never change again (from `true` to `false`).
- public PersonaStore? primary_store { get; }
  Our configured primary (writeable) store.
- public Individual? user { get; }
  The Individual representing the user.

### Static methods:

- public static IndividualAggregator dup ()
  Create or return the singleton IndividualAggregator class instance. If the instance doesn't exist already, it will be created with the default BackendStore.
- public static IndividualAggregator? dup_with_backend_store (BackendStore store)
  Create or return the singleton IndividualAggregator class instance with a custom BackendStore. If the instance doesn't exist already, it will be created with the given BackendStore rather than the default one. If the instance already exists but is using another BackendStore then a warning is raised and null is returned.

### Creation methods:

- public IndividualAggregator ()
  Create a new IndividualAggregator.
- public IndividualAggregator.with_backend_store (BackendStore store)
  Create a new IndividualAggregator with a custom BackendStore.

### Methods:

- public async Persona? add_persona_from_details (Individual? parent, PersonaStore persona_store, HashTable<string,Value?> details) throws IndividualAggregatorError
  Add a new persona in the given PersonaStore based on the `details` provided.
- public async Persona ensure_individual_property_writeable (Individual individual, string property_name) throws IndividualAggregatorError
  Ensure that the given property is writeable for the given Individual.
- public Map<Individual,Map<Individual,MatchResult>> get_all_potential_matches (MatchResult min_threshold = VERY_HIGH)
  Get all combinations between all Individuals.
- public Map<Individual,MatchResult> get_potential_matches (Individual matchee, MatchResult min_threshold = VERY_HIGH)
  Get all matches for a given Individual.
- public async void link_personas (Set<Persona> personas) throws IndividualAggregatorError
  Link the given Personas together.
- public async Individual? look_up_individual (string id) throws Error
  Look up an individual in the aggregator.
- public async void prepare () throws Error
  Prepare the IndividualAggregator for use.
- public async void remove_individual (Individual individual) throws Error
  Completely remove the individual and all of its personas from their backing stores.
- public async void remove_persona (Persona persona) throws Error
  Completely remove the persona from its backing store.
- public async void unlink_individual (Individual individual) throws Error
  Unlinks the given Individual into its constituent Personas.
- public async void unprepare () throws Error
  Clean up and release resources used by the aggregator.

### Signals:

- public signal void individuals_changed (Set<Individual> added, Set<Individual> removed, string? message, Persona? actor, ChangeReason reason)
  Emitted when one or more Individuals are added to or removed from the aggregator.
- public signal void individuals_changed_detailed (MultiMap<Individual?,Individual?> changes)
  Emitted when one or more Individuals are added to or removed from the aggregator.

### Inherited Members:

All known members inherited from class GLib.Object

- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data

- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer

- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref