LibreSocial · Documentation

Appstore — plugin marketplace and JAR distribution

Publishing, discovery, download and runtime installation of OSGi bundles ("apps") over the PAST storage of the overlay. Two halves: the framework package com.p2pframework.appstore (server side, reuses the DDS remote-operation protocol) and the bundle org.lifesocial.plugin.appstore (client side, drives the Equinox BundleContext). 33 classes, 2 878 lines in the 2026 tree. The component is resolved and started in the current run descriptor, but it has no user-facing surface today: no SWT view, no console command, no REST handler.

Purpose

The appstore turns the platform itself into a distribution channel for its own extension mechanism: a user publishes a local .jar (an OSGi bundle) plus metadata into the distributed storage, other users retrieve it by name and install it into their running Equinox framework without restarting.

Roles as implemented:

Out of scope in the current code: repository browsing, keyword/category search, ratings, code signing beyond the metadata signature, and any GUI. Those existed in or were planned for earlier generations (see Design options and Evolution).

Current implementation (as of 2026)

Framework half, Source/com.p2pframework/src/com/p2pframework/appstore/:

Class Size Role
server/AppstoreServer.java 206 L abstract server object: retrieveData, storeData, deleteData, sendBack, and the two verifiers verifyData / verifyOwner over SignedAppstoreData; className = "APPSTORE" is the monitoring tag
server/AppstoreDataServer.java 223 L processMessage(OperationMessage) switch over storeMeta / removeMeta / retrieveMeta / modifyMeta; every operation first does a PAST existence check, then verifies, then acts
model/AppstoreData.java 17 L marker interface Serializable, StorageItem + generateKeyValue()
model/SignedAppstoreData.java 34 L the object actually stored in PAST: {UserID user, AppstoreData appdata, byte[] signature}
utils/AppstoreServerReturnCode.java 6 L 12-value result enum (see Technical details)

Plugin half, Source/org.lifesocial.plugin.appstore/src/org/lifesocial/plugin/appstore/ (23 classes, 2 392 lines):

Class Size Role
AppstorePlugin.java 78 L OSGi DS component @Component(name = "org.lifesocial.plugin.appstore"), @Reference(policy = DYNAMIC) to Framework; singleton with lazy UserToolKit / PublisherToolKit; holds pathToPluginFolder
AppstoreToolKit.java 204 L base for both roles: five AppstoreDataClients (pmClient, vmClient, poClient, uprClient, pprClient), return-code → exception mapping, read-modify-write helpers for the two private repositories
PublisherToolKit.java 151 L publishPlugin, publishNewVersion, deletePlugin, modifyPluginMeta …
UserToolKit.java 283 L retrievePluginMeta, findAllDependencies, downloadPlugin, installPlugin, startPlugin, stopPlugin, uninstallPlugin(AllVersions), bootInstallPlugins, checkForUpdate
client/AppstoreClient.java 53 L extends RemoteOperationClient; getBytesToSign(appData, dataID) and createSignature with the node's EC private key
client/AppstoreDataClient.java 55 L the four meta operations, each with key = data.generateKeyValue()
model/* 912 L PluginMeta(+StorageItem), VersionMeta(+StorageItem), PluginObjectFile(+StorageItem), PrivateUserRepository(+StorageItem), PrivatePublisherRepository(+StorageItem)
utils/SeriVersion.java 373 L copy of org.osgi.framework.Version made Serializable (major.minor.micro.qualifier, Comparable)
utils/* 216 L ItemAlreadyExistsException, RequestNotVerifiedException, FileNotReadedException, ObjectFileIsNullException, AppstorePluginException, PluginPropertiesContainer, PrivateRepositoryInstalledEntry, PrivateRepositoryPublishedEntry
Activator.java 30 L plain BundleActivator, only stores the BundleContext; Bundle-ActivationPolicy: lazy

Sample payloads, built by the same Gradle build but not part of -runrequires: org.lifesocial.plugin.appstore.samples.clickme, .dummy, .redplugin, .registrationform — Eclipse-RCP bundles (Require-Bundle: org.eclipse.ui, org.lifesocial.ui, config/plugin.xml contributing views/commands), i.e. the artefacts that were published and installed through the store during development. settings.gradle lines 50–54 and 102–106 wire all five bundles into the build.

Wiring

Item Key pattern
PluginMetaStorageItem plm_<pluginName>.app
VersionMetaStorageItem vrm_<pluginName>_<version>.app
PluginObjectFileStorageItem jar_<pluginName>_<version>.app
PrivateUserRepositoryStorageItem upr_<username>.app
PrivatePublisherRepositoryStorageItem ppr_<username>.app

What is not wired (verified in the 2026 tree)

Design options and decision

Three designs are documented in the corpus; the shipped code is the third one, and the second and first still leave traces.

  1. Central app server (classic marketplace). Not chosen anywhere in the LibreSocial line: the platform's premise (demonstrated in LifeSocial.KOM demo 2010, argued in Graffi 2010) is that no single instance may hold the data or the authority. A central store would reintroduce a censorship/availability single point of failure, and its operator would be a trivially attackable target — the reason the DHT-based design was chosen for storage and search at all (Pastry 2001, PAST 2001). This alternative is reconstructed from that architectural position; no document compares it explicitly against a centralised store.
  2. Repository-object model (project group 2012): a Repository identified by a RepositoryCategoryID, a RepositoryDictionary, RepositoryEntry records and a RepositoryOwnerClient speaking a dedicated RepositoryOperationRequest / RepositoryRequestType protocol — five layers, own client-server protocol, own category model (PG 2012 final report, presentation). Implemented under com.p2pframework.appstore.repository_old/ and deleted on 2013-02-28 (commit 61c641a67). Trade-off as it can be read from the code: a repository object is a mutable shared collection owned by an authority — it needs its own request protocol, its own authorisation, and read-modify-write conflicts against every concurrent publication.
  3. Per-item signed storage items plus private repositories — what ships. Each app release is a separate PAST object addressed by a deterministic name-derived key; authorisation is a signature checked by the responsible node, not an ACL; the only mutable state is two small per-user lists. Chosen because it reuses the already-existing generic remote-operation plumbing (PG 2011/12 final report, framework overview 2013): four new enum values instead of a new protocol, no owner-role bookkeeping, and publication is three independent storeMeta calls that cannot conflict with other publishers. The cost is that the store has no collection: there is no way to enumerate or search apps, only to look up an exact name — the marketplace's discovery problem was traded away for a much simpler consistency story.
  4. DDS-collection repositories (proposed, never shipped). The master's thesis Modasia 2015 and its slides describe exactly this step: the user's repository list and each repository's app list as Distributed LinkedList entries, the set of users of a repository as a Distributed Set, and an AppstorePluginHandler REST class in the webprovider layer behind a single-page HTML5/Bootstrap/Backbone.js GUI. The current tree contains none of it. Had it landed, browsing and membership would work (the primitives exist — see DDS), at the price of the bucketed-structure overhead and merge handling for every publish. The extraction of the thesis holds only chapters 1–2, so no measured comparison of the two data models survives; the ranking above is therefore partly reconstructed.

Monitoring instead of central control: the QoS question ("is the distribution of 1.5 MB JARs degrading the nodes that host them?") was handled by the over-overlay, not by a store operator — SkyEye 2008, monitored LifeSocial 2011, tree-based monitoring with the convex-hull watchdog 2016 as the anti-abuse refinement. The appstore's contribution is the "APPSTORE" measurement tag fed into that pipeline. (Gossip-based monitoring was rejected in the monitoring line for its weak causal ordering — see monitoring; this affects the appstore only indirectly, and that ranking is reconstructed from the monitoring papers, not from any appstore document.)

Technical details

Publish (PublisherToolKit.publishPlugin). PluginObjectFile.readFile(path) → three storeMeta calls (plm_, vrm_, jar_) → addPublishedPluginToPrivateRepository(entry). storeMeta signs serialize(appData) || serialize(key) with the node's EC private key (ECAsymmetricKey.signObject); the comment in AppstoreClient.getBytesToSign flags the known fragility: Java serialisation is not guaranteed byte-stable, so a signature may fail to verify against a re-serialised object.

Server-side semantics (AppstoreDataServer):

Install path (UserToolKit). downloadPlugin fetches the jar_… item, writes it under /apps/jar_<name>_<version>.app; installPlugin maps that path to a file:/// URL and calls BundleContext.installBundle, then records PrivateRepositoryInstalledEntry(name, version). findAllDependencies does a breadth-first closure over VersionMeta.getDependencies() — plugin-name level, not package level, self-reference removal makes it cycle-safe, but it resolves only the current version of each dependency. bootInstallPlugins re-downloads/installs and starts entries whose autoLoad flag is set.

Integrity model. Application code is not signed and not encrypted: PAST-level access control and per-element encryption belong to DDS (SecureDistributedDataItem, group keys) and the appstore deliberately bypasses it. Authenticity of metadata is proven by the EC signature over (AppstoreData, key); the JAR itself is whatever the publisher stored. Retrieval requires knowing the exact name and version — which today is the only practical access restriction. See security and access control.

Integration points. DDS enums and DataBackend (protocol reuse); StorageDispatcher / PAST, past-storage (replication, providerListLength, capacity-aware redirection and the social cache all apply to the JAR items exactly as to any other object — see caching); messaging (MessageChannel.sendMessageToResponsibleNode, overlay routing); monitoring ("APPSTORE" series in MeasuringStorageImpl and the SkyEyeData/GLOBAL_* output); Equinox/OSGi bundle lifecycle (INSTALLED → RESOLVED → STARTING → ACTIVE → STOPPING → UNINSTALLED); com.p2pframework.users for user-ID ↔ node-ID resolution used by the verifiers.

Sizing limits. A JAR is one PAST object, so it is subject to the object-size behaviour measured for the platform: publications of ~1.5 MB per object were used in the 20-machine testbed described in PG 2012 (100 publications, and the Byte/s figures the group recorded there were judged implausible — measurement quality open), while the same report notes that objects above roughly 3.1–4.3 MB made storage unreliable. No DDS bucket splitting (dds_split_size) applies to appstore items.

Evolution and supersession

Period State
2008–2009 No appstore, but the prerequisites are defined: OSGi/Equinox plugin architecture in Podrajanski 2008 and Alvite 2008; hands-on plugin/JAR handling in the plugin practicum doc 2008, Quick Start 2009 and the JAR how-to 2009.
2011/12 Project group builds the generic remote-operation protocol (RemoteOperation, RemoteOperationClient, DataBackend) that the appstore later plugs into (PG 2011/12 report).
Aug 2012 com.p2pframework.appstore server appears (first commits Appstore Server not ready, 2012-08-15).
Jan–Feb 2013 Plugin bundle org.lifesocial.plugin.appstore appears; the repository_old model and the IAppstorePlugin/IPublisherClient/IUserClient API interfaces are deleted (2013-02-20, 2013-02-28) in favour of ToolKits + per-item keys; Version becomes the serialisable SeriVersion.
Mar 2013 Four sample bundles added; org.lifesocial.ui.appstore SWT views (RepositoryView, RepositoryBrowserView, PreciseSearchView) added.
2013/14 PG 2013 report, presentation: REST/JSON web front end per plugin (webprovider PluginHandler classes), AppstorePluginHandler, RepositoryReference in org.lifesocial.core.main; this supersedes the 2012 report's repository-object description.
2015 Modasia thesis and slides document the intended DDS-based repository model and the single-page web GUI — the design was not realised; on 2015-01-15 the old RCP UI projects (including the appstore views) are deleted, and the webprovider appstore handler disappears with them.
2019–2020 Touched by the social-cache integration (2019-10-28). The LibreSocial framework paper 2020 and Graffi's dissertation 2020 list the AppStore as a framework service rather than a user-facing feature — the accurate description for a headless build; the survey 2020 keeps it as a platform capability.
2025 Imam's revival 2025 and the setup guide 2025: the appstore bundles matter only as build/manifest/classpath objects (JDK 1.7 era, ~120 fixes), no architecture change.
2026 Gradle + bnd migration (bnd.bnd per bundle, JavaSE-17, lazy activation, DS annotations), appstore in cnf/org.libresocial.launcher.common.bndrun, code reformatted (gradlew rewriteRun), @Serial annotations. Behaviour unchanged since 2014.

Reading order for reviewers: the 2012 report describes a component architecture with a repository layer that no longer exists; the 2015 thesis describes a GUI and DDS repositories that were never shipped; the 2020 papers and the 2025/2026 build describe what actually runs — a headless, name-keyed publication service. Only the 2020-and-later descriptions should be trusted for the current state, and only the source for the API surface.

Known open points in 2026: no discovery/browse path at all (a caller must know a plugin name); AppstoreRepository identifiers with no model behind them; last-write-wins modifyMeta without the hash precondition used by DDS; signature over Java-serialised bytes (fragile by the authors' own comment); /apps absolute path; unbounded retry loop in issueOperation; a test suite that is commented out.