Skip to content

Latest commit

 

History

History
246 lines (201 loc) · 10.3 KB

openframe-client-core-java.md

File metadata and controls

246 lines (201 loc) · 10.3 KB

Openframe Client Core Java

Purpose

Openframe Client Core Java provides the shared client-runtime functionality used by the OpenFrame Client service. It is consumed from the com.openframe.oss:openframe-client-core artifact at version 7.0.11 and supplies the application boundary between endpoint agents, tenant services, messaging systems, persistence, and platform-specific operating-system integrations.

The module includes approximately 873 components organized under the OpenFrame OSS Library client-core source tree:

openframe-oss-lib/openframe-client-core/src/main/java/com/openframe/client

Its responsibilities include:

  • Agent authentication, registration, configuration, and lifecycle management.
  • Remote-access and tool-agent communication.
  • Command, delivery, package, and operating-system update processing.
  • NATS and Kafka message handling.
  • Scheduling, execution, retries, and result tracking.
  • Cross-platform support for Linux, macOS, and Windows.
  • Logging, metrics, diagnostics, self-healing, and client updates.
  • Shared domain models and transport messages.

Architecture Overview

Openframe Client Core Java is organized as a layered client-runtime module. Controllers and listeners receive external requests or messages, services coordinate domain workflows, models represent state and messages, and platform components perform operating-system-specific operations.

flowchart LR
    External["Tenant APIs and Agent Messages"] --> Boundary["Controllers and Listeners"]
    Boundary --> Services["Client Services"]
    Services --> Domain["Core Models and State"]
    Services --> Messaging["NATS and Kafka Messaging"]
    Services --> Persistence["Repositories and Configuration"]
    Services --> Platform["Platform and Executor Components"]
    Platform --> OperatingSystem["Linux, macOS, and Windows"]
    Services --> Observability["Logging, Metrics, and Diagnostics"]
Loading

Runtime Data Flow

The client receives commands and lifecycle events through HTTP, NATS, Kafka, and application events. Core services validate and process those inputs, persist results, publish status updates, and invoke platform-specific executors when local work is required.

sequenceDiagram
    participant Agent as Endpoint Agent
    participant Listener as Client Listener
    participant Service as Client Service
    participant Store as Persistence
    participant Bus as NATS or Kafka
    participant Executor as Platform Executor

    Agent->>Listener: Send registration, status, or result message
    Listener->>Service: Validate and delegate message
    Service->>Store: Read or update client and device state
    Service->>Executor: Run local command or platform operation
    Executor-->>Service: Return execution result
    Service->>Store: Record result and state transition
    Service->>Bus: Publish status or delivery event
    Bus-->>Agent: Deliver follow-up work or result
Loading

Core Component Areas

Client Entry and Configuration

  • cli-entrypoint
  • banner
  • config-core
  • http-client-factory
  • installation-initial-config-service
  • system-info

These components initialize the client, assemble runtime configuration, create HTTP clients, and provide installation and system metadata.

Authentication and Registration

  • auth-client
  • registration-client
  • services-agent-auth
  • services-agent-registration
  • services-agent-configuration
  • services-agent-session
  • services-initial-authentication-processor
  • services-registration-processor
  • models-agent
  • models-agent-registration
  • models-agent-registration-response
  • models-agent-token-response

This area manages client credentials, token exchange, machine registration, initial authentication, tenant configuration, and registration responses.

Command, Listener, and Delivery Processing

  • listener-command-core
  • listener-command-handlers
  • listener-command-package-adopt
  • listener-command-package-update
  • listener-command-restart
  • listener-execution
  • listener-remote-access-message
  • delivery-listeners
  • core-listeners
  • rmm-listeners
  • package-adopt-listeners
  • package-update-listeners

These components consume incoming commands and status events, route them to application services, process delivery results, and acknowledge or retry messages according to processing outcomes.

RMM and Software Operations

  • services-execution
  • services-device-data-fetcher
  • services-package-manager-core
  • services-package-manager-adopt
  • services-package-manager-update
  • services-package-manager-update-orders
  • services-tool-installation
  • services-tool-connection
  • services-tool-run-manager
  • services-tool-restart
  • services-tool-uninstall
  • services-tool-kill
  • services-tool-ops
  • services-remote-access-mode

This area coordinates scripts, package-manager operations, tool installation, tool connectivity, remote access, execution state, and delivery outcomes.

Scheduling and State Management

  • service-core
  • service-adapter
  • services-last-known-good
  • services-result-store-core
  • services-result-store-ledger
  • services-result-outbox-run-manager
  • services-update-state
  • services-token-refresh-run-manager
  • services-machine-heartbeat-run-manager
  • services-machine-timezone-run-manager
  • services-os-updates-report-run-manager
  • services-package-manager-report-run-manager
  • services-tool-run-manager

These components provide reusable service contracts, adapters, scheduled processing, durable result storage, retry coordination, and state transitions.

Logging, Metrics, and Diagnostics

  • logging-core
  • logging-log-parser
  • logging-log-rotation
  • logging-log-source
  • logging-metrics
  • logging-nats-streaming
  • logging-shipping
  • metrics-init
  • doctor-core
  • doctor-checks
  • doctor-healing
  • doctor-healing-webview2
  • monitoring-permissions

This area handles local log collection and rotation, log shipping, metrics initialization, health checks, diagnostics, permissions, and automated repair workflows.

Platform Integration

  • executor-core
  • executor-unix
  • executor-windows
  • platform-directories
  • platform-file-acl
  • platform-file-lock
  • platform-machine-info-persistence
  • platform-os-version
  • platform-os-updates
  • platform-os-updates-windows-model
  • platform-powershell
  • platform-system-service
  • platform-user-session-macos
  • platform-chat-channel-macos
  • platform-chat-channel-windows
  • platform-tool-updater-core
  • platform-tool-updater-service
  • platform-uninstall

Platform components isolate operating-system behavior from the client service layer. The executor modules provide command execution, while platform modules manage files, permissions, services, updates, processes, user sessions, installers, and uninstall behavior.

Shared Models and Utilities

The models-* components define messages and state objects for agents, devices, delivery, execution, packages, tools, updates, and feature flags. The utils-* components provide filesystem operations, latches, timed permits, failure backoff, in-progress tracking, and version comparison.

flowchart TD
    Messages["Agent and Delivery Messages"] --> Services["Client Services"]
    Services --> State["Device, Tool, Package, and Update State"]
    State --> Results["Execution and Delivery Results"]
    Services --> Utilities["Shared Utilities"]
    Utilities --> Platform["Platform Implementations"]
Loading

Core Component Documentation

The following component documentation describes the primary functional areas of Openframe Client Core Java:

  • Config — Spring configuration for password encoding, Redis-backed scheduling locks, and Kafka delivery dispatch.
  • Controller — HTTP endpoints for agent authentication, registration, lifecycle operations, and log-key retrieval.
  • Feature Flags Datafetcher — GraphQL access to tenant-specific client feature flags.
  • Dto — Transport objects for client authorization requests and metrics messages.
  • Core Listeners — Event ingestion for machine, user, and delivery events.
  • Delivery Listeners — Kafka dispatch handling and NATS JetStream delivery-result processing.
  • Package Adopt Listeners — Package-adoption status processing and execution-result correlation.
  • Package Update Listeners — Package-update status, delivery failure, retry, and request-state processing.
  • Rmm Listeners — Direct NATS, JetStream, and application-event processing for RMM activity.
  • Metrics — Micrometer gauges for device-online dispatch backlog and batch capacity.
  • Publisher — Default Kafka publishing for event logs and command results.
  • Scheduler — Periodic orchestration for device, Fleet, script, software, package, and tool workflows.
  • Device Lifecycle Service — Promotion of eligible devices from pending to managed state.
  • Agent Registration Services — Machine registration, configuration delivery, tool installation, and tag assignment.
  • Agent Registration Processors — Post-registration extension processing.
  • Agent Registration Transformers — Tool-specific agent-identifier normalization.
  • Auth Services — Machine token generation, refresh handling, access guards, and authentication auditing.
  • RMM Services — Scheduling, delivery eligibility, software dispatch, and package-manager bootstrap.
  • OS Update Services — Reconciliation of update catalogs, device state, pending updates, and installation history.
  • OS Update Parsers — Normalization of operating-system update reports into domain objects.
  • RMM Watchdog Services — Channel-specific delivery republishing and recovery.

Module Structure

The module source is organized by technical responsibility rather than by deployable application. The primary package areas are:

com.openframe.client
├── config
├── controller
├── datafetcher
├── dto
├── listener
├── metrics
├── models
├── platform
├── publisher
├── scheduler
├── service
├── system
└── utils

Openframe Client Core Java is therefore a reusable client-runtime foundation. The OpenFrame Client service supplies application assembly and deployment configuration, while this module supplies the shared authentication, event processing, service orchestration, platform integration, and operational behavior.