gCore

TopologyManager

Namespace: gCore\Modules\Managers\Base\TopologyManager Implements: ModuleInterface Access: gCore::getService('TopologyManager')

TopologyManager is the site's view of its constellation's one topology ({<c>}:gnode:constellation). The free-tier stub keeps the interface and degrades its behaviour; the Pro implementation (gCore\Topology\TopologyManagerPro) registers the site and draws the topology.

The model

Stub behaviour (free tier)

Public API

Lifecycle: getInstance, initialize, isInitialized, getStatus, getConfig, updateConfig.

Registration: smartRegister, forceRegister, getRegistrationStatus, deregister, updateCapabilities, refreshRegistration, isRegisteredInTopology, getCapabilityVector.

Discovery: discoverServices(array $requirements, int $limit = 10, string $layer = '3') where $requirements maps an axis to a word, a list of words or a [lo, hi] range and $layer is a shape word or layer key; findServices, getServiceDetails, getLoadSequence.

Axes and view: getCapabilityDimensions, getDimensions, getDimension, registerDimension, getTopologyVisualization.

$topology = gCore::getService('TopologyManager');

$topology->smartRegister(['protocol' => 'http'], ['name' => 'Shop']);

$apps = $topology->discoverServices(['protocol' => ['resp3']], 5, 'app');

Contract

See CONTRACT.md (TopologyManager) and the gNode CONTRACT.md.