Skip to content

Commit 78a72d4

Browse files
CesarCoelholacourteagmoclaude
authored
Release 14.0 (#53)
* Updates the versions to 14.0-SNAPSHOT * Adds the notes for version 14.0 * Removes the auto-generation of setters * Removes deprecated methods * Removes deprecated methods (2) * Updates the code to use the .getInSeconds() method (2) * Updates the code to use the .getInSeconds() method (3) * Updates the code to use the .getInSeconds() method (4) * Updates the code to use the .getInSeconds() method (5) * Small optimization * Adds the MPS spec update * Adds entry for v12.3 * Adds better protection when encoding undefined Enumerations * Updates the indentation * M&C testbed. (#49) * Packet Service implementation * Alert Service implementation * Action Service implementation * Adds hook to generate .docx files from cli * Updates the .docx file generated tables * Better printing of Time and FineTime * Deprecated old method * Adds a catch to handle better the exceptions * Adds getTypeShortForm method * Fix PUB-SUB broker dropping subscriptions on partial deregister The broker's subscriberSet (a TreeSet<String> keyed by consumer URI) treated all subscriptions from the same consumer as a single entry. When a consumer held two concurrent subscriptions (e.g. monitorEvents and monitorExecution) and deregistered one, removeSubscriber() evicted the consumer's URI entirely. Subsequent NOTIFY messages for the still- active subscription found no binding via hasSubscriber() and triggered handleConsumerCommunicationError(), silently purging the remaining subscription from the broker table. Fix: key each entry in the set as subscriptionId + uriTo so every subscription occupies its own slot. addSubscriber/removeSubscriber now take both the URI and the subscription ID; MALReceiver extracts the subscription ID from the register/deregister message body. hasSubscriber scans for any entry ending with the given URI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Carry field comments into OperationField runtime metadata Add a comment field to OperationField (with a backward-compatible 4-arg constructor and getComment() accessor) and have the Java generator emit each field's XML comment into the generated ServiceInfo. The comment was already parsed into the generator model (FieldInfo.getFieldComment) but was only used for Javadoc and dropped from the runtime metadata. This makes operation field descriptions available at runtime as compiled constants, with no XML parsing at startup. It lays the groundwork for better MCP integration/support and other metadata-driven tooling (e.g. a CLI) that can render service operations and their fields with their descriptions directly from <Service>Info.OPERATIONS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Carry operation comments into MALOperation runtime metadata Add a comment field to MALOperation (with a getComment() accessor) and thread it through the six interaction-pattern subclasses via backward- compatible constructor overloads that take a trailing comment argument; the existing constructors delegate with a null comment. The Java generator now emits each operation's XML comment as the final argument of the generated MAL*Operation in ServiceInfo. Together with the earlier field-level change, both operation and field descriptions are now available at runtime as compiled constants via <Service>Info.OPERATIONS, with no XML parsing at startup. This furthers the groundwork for better MCP integration/support and other metadata- driven tooling (e.g. a CLI) that renders services, operations and their fields with descriptions directly from the runtime metadata. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Introduce MethodBuilder fluent API for the stub generator Replace the positional addMethodOpenStatement overloads (up to 15 boolean/ string args) with a fluent MethodBuilder, accessed via ClassWriter.method(name). The builder accumulates a language-neutral method description and delegates to the writer's canonical addMethodOpenStatement/addMethodOpenStatementOverride on open(). - Add MethodBuilder with addArgument/addArguments, addThrows (single- and two-arg, coupling the throws clause with its @throws comment), and modifier flags (asStatic/asFinal/asVirtual/asConst/asOverride/deprecated/returnActual). - Add ClassWriter.type(name) / type(area, service, name) and a returns(String) overload so simple return types read as returns("int") instead of a verbose createCompositeElementsDetails(...) construction. - Migrate all call sites across GeneratorLangs, GeneratorJava, GeneratorGwt, JavaConsumer, JavaCompositeClass, JavaEnumerations, JavaLists and JavaServiceInfo; remove now-dead joined-throws/native-type locals and the StubUtils.concatenateArguments/Arrays.asList wrappers feeding args. - Delete the 5 now-unreachable addMethodOpenStatement convenience overloads from ClassWriter and JavaClassWriter, keeping only the 15-arg master and the override variant the builder calls. Generated output is byte-identical except two intentional fixes to pre-existing inconsistencies: the handle* methods' throws clause is reordered to match its javadoc, and registerWithDefaultKeys drops a stray @throws IllegalArgumentException that was never in its throws clause. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Add ClassWriter.field() helper and sweep verbose native-type construction Introduce a field(typeName, fieldName, comment) default on ClassWriter that builds a simple non-list field by reusing type(...) and the CompositeField copy constructor. Replaces the verbose createCompositeElementsDetails(file, ..., createTypeReference(null, null, name, false), ...) pattern at native-typed class variable and argument sites. - Class variables: _SERVICE_NUMBER, _OP_NUMBER, _OBJECT_NUMBER (JavaServiceInfo), _AREA_NUMBER (JavaHelpers), and the enum *_VALUE literal (JavaEnumerations). - Arguments: list initial-capacity constructor (JavaLists), enum value constructor (JavaEnumerations), and errorNumber/extraInfo in generateMOError (JavaServiceInfo), dropping the ref1/ref2 temporaries. Output is byte-identical: addClassVariable and processArgs render only the field name, comment and createLocalType (type-name based), never canBeNull/isStructure/ isActual, so the dropped flags cannot affect output for native types. The helper is intentionally scoped to native/literal types; MAL structure types keep the explicit path where isStructure matters. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Additional improvements in the cleanup of the code * Re-enable PublishRegisterTestProcedure with an isolated domain This procedure was disabled because it passed on FitNesse 20220319 but failed on later versions. The cause was the FitNesse SuiteContentsFinder change (20220319 -> 20220815) switching to alphabetical page ordering, so HeaderTestProcedure now runs before PublishRegisterTestProcedure and seeds shared pub-sub state on the same domain/session. The procedure's expected publish-register transaction id then no longer matched the (spec-correct) id reused by the provider's publisher for PUBLISH / PUBLISH ERROR. Give the procedure its own domain so its publisher, broker registration and cached transaction id cannot collide with any other pub-sub procedure, making it independent of suite execution order. Verified green across JDK 11/17/21 and FitNesse 20220319/20220815/20250223 (old FitNesse still cannot run on JDK >= 18 due to the unrelated Security Manager removal). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Add GitHub workflow to generate DOCX from XML service specifications Mirrors the NMF generate-docs workflow: builds mo-navigator then runs AppGenerateDocx against both xml-ccsds-mo-prototypes and xml-ccsds-mo-standards, uploading the results as timestamped artifacts on every push. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix ESA logo and Maven Central badge in README - ESA logo: replace broken Wikimedia hotlink with esa.int's own GIF - Maven Central: replace defunct maven-badges.herokuapp.com with shields.io pointing to central.sonatype.com for int.esa.ccsds.mo:parent Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Allow Enumeration types as PUB-SUB subscription keys When an XML subscription key has an Enumeration type, the generator previously tried to emit AttributeType.<ENUMNAME>, which does not exist. Enumerations are wire-encoded as UShort ordinals, so map them to AttributeType.USHORT instead. Extracted subscriptionKeyAttributeTypeName() to keep the generation loop readable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Complete removal of setters * Move attribute2double/string/javaType2Attribute to Attribute interface All three conversions now live directly on the Attribute interface: - attribute2double: new static + default instance methods - attribute2string: body was a duplicate; HelperAttributes now delegates - javaType2Attribute: same delegation pattern, now @deprecated in HelperAttributes Callers with Attribute-typed variables updated to use instance methods. Includes minor fix: local variable renamed from newSPF to newSFP in TypeId. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Revert UC1_Ex3_Test to static Attribute.attribute2JavaType() call The instance form att.getValue().attribute2JavaType() fails on CI when testbeds are compiled against a cached artifact that predates the default method addition. Static call works against both old and new API versions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Revert testbed instance method calls to static Attribute form The testbed CI workflow compiles against the published Maven Central snapshot of api-area001-v003-mal, which predates the new default instance methods. Revert attribute2JavaType()/attribute2string() calls in testbed files back to the static Attribute.method(arg) form which works against both old and new API versions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix ESA logo in README by bundling SVG in repo The external ESA logo URLs no longer serve the image directly. Store the current ESA logo SVG (sourced from esa.int) in docs/, with fill color changed from white to ESA deep blue (#003247) so it renders correctly on GitHub's white background. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add typed Subscription Key accessors for PUB-SUB consumers Generate a typed <Op>SubscriptionKeys class per PUB-SUB operation and pass it to the <op>NotifyReceived callback, so consumers read keys by name (keys.getParameterId()) instead of positionally (updateHeader.getKeyValues().get(1)). Resolution is by name, which makes it correct under broker key trimming (CCSDS 521.0-B-3, section 3.6.6.5); a getByName() escape hatch covers custom keys, and the UpdateHeader is never modified. Key points: - Generator (JavaConsumer): emit the per-op keys class (typed getters + getByName), and the 4-argument notifyReceived dispatch that builds it. - MAL API: notifyReceived now carries the subscription's selectedKeys (single 4-argument form on MALInteractionListener/Adapter). - mal-impl: InteractionPubSubMap retains selectedKeys per subscription; MALReceiver supplies them at notify dispatch. - Fix Uinteger -> UInteger typo in the area004-v002 MC service XML so the parameterVersion key resolves to a proper UInteger getter. - Migrate testbed and tooling consumers to the typed accessors and keep null-prone Attribute conversions on the null-safe static form. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Rename auto-placeholder argument names in PUB-SUB testbed overrides Replace the generated _Type<N> placeholder parameter names in the pub-sub / COM-event NotifyReceived (and related) overrides with the names declared by the overridden method, for readability and consistency: - _Identifier0 -> subscriptionId, _UpdateHeaderList1 -> updateHeader/header, _ObjectDetailsList2 -> objectDetails, _ElementList3 -> element/output2 - MonitorActivityScenario: StringList strings -> out1 / out2 - MalSppPubsubTest: TestUpdate output1, Element output2 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Align COM event NotifyReceived override params with the overridden method Rename the pre-existing parameter names in the monitorEventNotifyReceived overrides to match the generated EventAdapter signature: header -> updateHeader, objectDetails -> eventLinks, element -> eventBody (MonitorEventAdapter, TestEventAdapter, ActivityRelayNode), updating body usages and javadoc accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Removes unused dependencies * Surface MO exceptions directly on provider Handler interfaces Patch the generator so each op's dedicated MO exceptions (e.g. InvalidException, UnknownException) are declared on the Handler interface method, and the skeleton dispatch catches MOErrorException and re-wraps it into MALInteractionException — eliminating the double-wrapping pattern in provider implementations. Migrate all service provider impls in services-impl to throw the typed exceptions directly instead of wrapping them, and update throws clauses to match the newly generated Handler interfaces. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Return Enumeration type from subscription key getters instead of UShort Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Replace redundant AtomicLong with plain long in TransactionIdCounter The counter is only ever accessed inside the static synchronized nextTransactionId() method, so the class monitor already guarantees mutual exclusion and memory visibility. The AtomicLong was therefore redundant overhead; a plain long is faster on the uncontended path and equivalent under contention. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Update RELEASE_NOTES.md for version 14.0 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Fix Javadoc generation failures in maven-plugin and MC v002 Migrate StubGenerator Mojo from legacy javadoc tags (@goal/@phase/ @parameter/@required) to @Mojo/@parameter annotations. The generated plugin descriptor for the bound "generate" goal is unchanged (same parameters, required flags, defaults), and the duplicate unused "generate-apis" goal is removed. Fix broken {@link} references and an unescaped ampersand ("M&C") in the MC v002 backend interfaces that were breaking Javadoc generation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Fix genuine Javadoc warnings in hand-written code (Group D) Add missing class descriptions, getter descriptions, and method @param/@return/@throws tags; remove an empty <p> tag. Clears all 58 hand-written Javadoc warnings that were not in the bulk "no comment" or "default constructor" categories, without changing any code logic. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Emit @OverRide on generated consumer adapter dispatcher methods The consumer *Adapter dispatcher methods (submitAckReceived, requestResponseReceived, notifyReceived, etc.) override MALInteractionAdapter but were generated without @OverRide. Route them through asOverride() and make the override writer path preserve the final modifier. Overriding methods inherit their documentation, so no Javadoc is emitted for them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Emit @OverRide on generated provider skeleton methods The provider InheritanceSkeleton/DelegationSkeleton methods that implement an interface (setSkeleton, malInitialize, malFinalize, handleSend/Submit/ Request/Invoke/Progress, and create*Publisher) override their declaring interfaces but were generated without @OverRide. Route them through asOverride(). getConnection is left untouched as it is skeleton-specific and not declared in any interface. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Generate @PARAM and @throws descriptions in the stub output The generated @PARAM tags were emitted with an empty description when the XML field/argument comment was blank, and @throws tags were always blank because error references rarely carry their own comment. Fill the @PARAM description from the field comment, falling back to "The <name> field." when absent, and resolve each @throws to the comment of its referenced error definition (with a generic fallback). Clears the 193 @PARAM and 21 @throws "no description" Javadoc warnings in the generated APIs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Add comments to generated ServiceInfo and Enumeration constructors The generated ServiceInfo no-arg constructor was emitted with an empty Javadoc block, and the Enumeration value constructor had a @PARAM but no main description when the enumeration carried no comment. Give both a meaningful description, clearing the corresponding "empty comment" and "no main description" Javadoc warnings in the generated APIs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Add fallback comments for generated composite fields and classes Generated composite fields and the composite class itself were emitted without a Javadoc comment when the XML carried no comment, producing "no comment" warnings. Fall back to "The <name> field." and "The <name> structure." respectively when the XML comment is absent, while still using the XML comment when present. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Make generated Helper classes non-instantiable Generated *Helper utility classes (static-only) relied on the implicit public constructor, flagged by doclint as an undocumented default constructor. Emit an explicit private constructor (placed after the fields) with a brief in-body note instead of a Javadoc comment, since a private member does not belong in the published API docs. Also stop addMultilineComment from emitting empty "/** */" blocks when the comment has no actual content. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Add InterfaceMethodBuilder for fluent interface method declarations Introduce a standalone InterfaceMethodBuilder, obtained via InterfaceWriter.interfaceMethod(name), that accumulates an interface method declaration fluently and emits it on declare(), replacing the positional addInterfaceMethodDeclaration calls in GeneratorLangs and GeneratorGwt. Throws are added incrementally (getOperationErrorsThrows becomes addOperationErrorsThrows feeding the builder). Also drop the unused "scope" parameter from addInterfaceMethodDeclaration (interface methods are implicitly public and it was never written). The generated interface output is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Code cleanup * Remove dead asVirtual and returnActual flags from the method builder isVirtual and isReturnActual were threaded through MethodBuilder and addMethodOpenStatement but never used by the Java writer (Java has no "virtual" keyword, and the return type is always rendered as-is). Drop the asVirtual()/returnActual() builder methods, their fields, the unused addMethodOpenStatement parameters, and the now-redundant calls at every call site. The generated output is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Remove dead const flags from the method builder isConst and isReturnConst were threaded through MethodBuilder and addMethodOpenStatement but never used by the Java writer (Java has no const concept). Drop the asConst()/returnConst() builder methods, their fields, the unused addMethodOpenStatement parameters, and the calls in addGetter. The generated output is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Decouple type information from GeneratorBase via composition GeneratorBase no longer implements TypeInformation. The type model is now split into two composable pieces in generator-interfaces: - MOTypeRegistry: language-neutral type data, population (loadTypesFrom*/register*) and classification/lookups (isEnum/isAbstract/isComposite/getAttributeDetails/...). - MOTypeInformation implements TypeInformation: composes the registry for classification and adds the config-driven name rendering (createElementType/convertToNamespace/getAreaPackage) plus the ObjectRef helpers. GeneratorBase holds the shared registry and a composed MOTypeInformation; the generators and the eight Java helper classes use that object directly (injected via constructor, no getter on the generator). Generated stub API and DOCX output are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Add ServiceInfo.getOperations() to list a service's operations Exposes the operations held in operationsByNumber so callers can iterate all operations of a service (e.g. when walking a MALArea's services), complementing the existing getOperationByNumber() lookup. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Code cleanup * Code cleanup * Code cleanup (2) * Bump version to 14.0 for release Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: lacourte <lacourte@users.noreply.github.com> Co-authored-by: agmo <agmo@terma.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7038997 commit 78a72d4

277 files changed

Lines changed: 22731 additions & 2514 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Generate MO XML Docs
2+
3+
on: [push]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
generate-docx:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Get Date
13+
id: get-date
14+
run: echo "date=$(/bin/date -u "+%Y-%m-%dT%H-%M-%S")" >> $GITHUB_OUTPUT
15+
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-java@v4
19+
with:
20+
java-version: '11'
21+
distribution: 'temurin'
22+
23+
- name: Cache Maven local repository
24+
uses: actions/cache@v4
25+
with:
26+
path: ~/.m2/repository
27+
key: ${{ runner.os }}-maven-docgen-${{ steps.get-date.outputs.date }}
28+
restore-keys: |
29+
${{ runner.os }}-maven-docgen-
30+
31+
- name: Build mo-navigator (and dependencies only)
32+
run: mvn --batch-mode install -DskipTests -pl tooling/mo-navigator --also-make
33+
34+
- name: Generate DOCX files for XML prototypes
35+
run: |
36+
mkdir -p docx-output/prototypes
37+
java -cp tooling/mo-navigator/target/mo-navigator-jar-with-dependencies.jar \
38+
esa.mo.navigator.AppGenerateDocx \
39+
xml-service-specifications/xml-ccsds-mo-prototypes/src/main/resources/xml \
40+
docx-output/prototypes
41+
42+
- name: Generate DOCX files for XML standards
43+
run: |
44+
mkdir -p docx-output/standards
45+
java -cp tooling/mo-navigator/target/mo-navigator-jar-with-dependencies.jar \
46+
esa.mo.navigator.AppGenerateDocx \
47+
xml-service-specifications/xml-ccsds-mo-standards/src/main/resources/xml \
48+
docx-output/standards
49+
50+
- name: Upload DOCX artifacts for XML prototypes
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: mo-prototypes-docx-${{ steps.get-date.outputs.date }}
54+
path: docx-output/prototypes/
55+
if-no-files-found: error
56+
57+
- name: Upload DOCX artifacts for XML standards
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: mo-standards-docx-${{ steps.get-date.outputs.date }}
61+
path: docx-output/standards/
62+
if-no-files-found: error

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<p align="left">
2-
<a href="https://github.com/esa/mo-services-java">
3-
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/ESA_logo.png/800px-ESA_logo.png" alt="esa logo" title="esa" width="400"/>
2+
<a href="https://www.esa.int/">
3+
<img src="docs/esa_logo.svg" alt="esa logo" title="esa" width="300"/>
44
</a>
55
</p>
66

77
CCSDS MO services - ESA's Java implementation
88
========================
99

10-
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/int.esa.ccsds.mo/mo-services-java/badge.svg)](https://maven-badges.herokuapp.com/maven-central/int.esa.ccsds.mo/mo-services-java)
10+
[![Maven Central](https://img.shields.io/maven-central/v/int.esa.ccsds.mo/parent)](https://central.sonatype.com/artifact/int.esa.ccsds.mo/parent)
1111

1212
CCSDS Mission Operations (MO) services are a set of standard end-to-end services based on a service-oriented architecture defined by the Consultative Committee for Space Data Systems (CCSDS) and it is intended to be used for mission operations of future space missions.
1313

@@ -99,7 +99,7 @@ Bug Reports are directly in the source code repository can be submitted on: [Iss
9999

100100
The CCSDS MO services are **licensed** under: **[European Space Agency Public License (ESA-PL) Weak Copyleft - v2.0]**
101101

102-
[ESAImage]: https://upload.wikimedia.org/wikipedia/commons/a/af/ESA_logo.png
102+
[ESAImage]: http://www.esa.int/esalogo/images/logotype/img_colorlogo_darkblue.gif
103103
[European Space Agency Public License (ESA-PL) Weak Copyleft - v2.0]: LICENCE.md
104104
[GitHub]: https://github.com/esa/mo-services-java
105105
[Release Notes]: RELEASE_NOTES.md

RELEASE_NOTES.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ ESA CCSDS MO services - Release Notes
44
These Release Notes include a short summary of the updates done for each version.
55
The different versions and respective updates are the following:
66

7+
### Version 14.0
8+
* Removes the setters from the auto-generated classes
9+
* Removes deprecated methods
10+
* Adds the partial Monitor & Control service implementations (Action, Alert, and Packet) and respective testbed
11+
* Adds feature to allow Enumeration types to be used as PUB-SUB subscription keys
12+
* Adds typed Subscription Key accessors for PUB-SUB on the consumer side
13+
* Surfaces the MO exceptions directly on the provider Handler interfaces
14+
* Carries the operation and field comments into the runtime metadata (enables MCP servers to be easily plugged in)
15+
* Multiple improvements and cleanup to the api-generator
16+
* Adds a GitHub workflow to generate the .docx files from the XML service specifications
17+
* Fixes the PUB-SUB broker bug that dropped subscriptions on a partial deregister
18+
* Updates the MPS spec with the final version from 26/08/2025
19+
720
### Version 12.3 (27 August 2025)
821
* Updates the MPS spec with the final version from 26/08/2025
922

api-generator/api-generator-maven-plugin/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
<parent>
2020
<groupId>int.esa.ccsds.mo</groupId>
2121
<artifactId>parent</artifactId>
22-
<version>12.3</version>
22+
<version>14.0</version>
2323
<relativePath>../../parent/pom.xml</relativePath>
2424
</parent>
2525

2626
<artifactId>api-generator-maven-plugin</artifactId>
27-
<version>12.3</version>
27+
<version>14.0</version>
2828
<packaging>maven-plugin</packaging>
2929

3030
<name>ESA MO API Generator - Maven Plugin</name>

api-generator/api-generator-maven-plugin/src/main/java/esa/mo/tools/stubgen/StubGenerator.java

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import org.apache.maven.plugin.logging.SystemStreamLog;
4242
import org.apache.maven.plugins.annotations.LifecyclePhase;
4343
import org.apache.maven.plugins.annotations.Mojo;
44+
import org.apache.maven.plugins.annotations.Parameter;
4445
import org.reflections.Reflections;
4546
import org.reflections.scanners.SubTypesScanner;
4647
import org.reflections.util.ClasspathHelper;
@@ -49,79 +50,60 @@
4950

5051
/**
5152
* Generates stubs and skeletons for CCSDS MO Service specifications.
52-
*
53-
* @goal generate
54-
*
55-
* @phase generate-sources
5653
*/
57-
@Mojo(name = "generate-apis", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true)
54+
@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true)
5855
public class StubGenerator extends AbstractMojo {
5956

6057
/**
6158
* The directory for XML files
62-
*
63-
* @parameter default-value="${basedir}/src/main/xml"
64-
* @required
6559
*/
60+
@Parameter(defaultValue = "${basedir}/src/main/xml", required = true)
6661
protected File xmlDirectory;
6762
/**
6863
* The directory for XML reference files
69-
*
70-
* @parameter default-value="${basedir}/src/main/xml-ref"
71-
* @required
7264
*/
65+
@Parameter(defaultValue = "${basedir}/src/main/xml-ref", required = true)
7366
protected File xmlRefDirectory;
7467
/**
7568
* The directory for XSD type reference files
76-
*
77-
* @parameter default-value="${basedir}/src/main/xsd-ref"
78-
* @required
7969
*/
70+
@Parameter(defaultValue = "${basedir}/src/main/xsd-ref", required = true)
8071
protected File xsdRefDirectory;
8172
/**
8273
* The working directory to create the generated java source files.
83-
*
84-
* @parameter
85-
* default-value="${project.build.directory}/generated-sources/stub"
86-
* @required
8774
*/
75+
@Parameter(defaultValue = "${project.build.directory}/generated-sources/stub", required = true)
8876
protected File outputDirectory;
8977
/**
9078
* The target language to create.
91-
*
92-
* @parameter
9379
*/
80+
@Parameter
9481
protected String[] targetLanguages;
9582
/**
9683
* Generate structures code?
97-
*
98-
* @parameter default-value="true"
9984
*/
85+
@Parameter(defaultValue = "true")
10086
protected boolean generateStructures;
10187
/**
10288
* Generate COM code?
103-
*
104-
* @parameter default-value="true"
10589
*/
90+
@Parameter(defaultValue = "true")
10691
protected boolean generateCOM;
10792
/**
10893
* Force generation
109-
*
110-
* @parameter default-value="false"
11194
*/
95+
@Parameter(defaultValue = "false")
11296
protected boolean forceGeneration;
11397
/**
11498
* Extra generator specific properties, held in name/value pairs
115-
*
116-
* @parameter
11799
*/
100+
@Parameter
118101
protected HashMap<String, String> extraProperties;
119102
/**
120103
* Package bindings, held in AREA/package pairs For JAXB bindings, held in
121104
* URI/package pairs
122-
*
123-
* @parameter
124105
*/
106+
@Parameter
125107
protected HashMap<String, String> packageBindings;
126108
private final Map<String, Generator> GENERATOR_MAP = new HashMap<>();
127109
private boolean generatorsLoaded = false;

api-generator/generator-docs/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
<parent>
2020
<groupId>int.esa.ccsds.mo</groupId>
2121
<artifactId>parent</artifactId>
22-
<version>12.3</version>
22+
<version>14.0</version>
2323
<relativePath>../../parent/pom.xml</relativePath>
2424
</parent>
2525

2626
<artifactId>generator-docs</artifactId>
27-
<version>12.3</version>
27+
<version>14.0</version>
2828
<packaging>jar</packaging>
2929

3030
<name>ESA MO API Generator - Documentation</name>

api-generator/generator-docs/src/main/java/esa/mo/tools/stubgen/GeneratorDocument.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ protected GeneratorDocument(GeneratorConfiguration config) {
6565
public CompositeField createCompositeElementsDetails(TargetWriter file,
6666
boolean checkType, String fieldName, TypeReference elementType,
6767
boolean isStructure, boolean canBeNull, String comment) {
68-
if (isAttributeType(elementType)) {
69-
AttributeTypeDetails details = getAttributeDetails(elementType);
68+
if (typeInformation.isAttributeType(elementType)) {
69+
AttributeTypeDetails details = typeInformation.getAttributeDetails(elementType);
7070
return new CompositeField(details.getTargetType(), elementType,
7171
fieldName, elementType.isList(), canBeNull, false,
7272
StdStrings.MAL, "", "", false, "", comment);

api-generator/generator-docs/src/main/java/esa/mo/tools/stubgen/GeneratorDocx.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class GeneratorDocx extends GeneratorDocument {
5555
2250, 2801, 1382, 1185, 1382
5656
};
5757
private static final int[] SERVICE_COM_TYPES_TABLE_WIDTHS = new int[]{
58-
2250, 1685, 2801, 1185, 1185
58+
1010, 2250, 2500, 1150, 2196
5959
};
6060
private static final int[] OPERATION_OVERVIEW_TABLE_WIDTHS = new int[]{
6161
2200, 1700, 800, 4300
@@ -433,19 +433,19 @@ private void drawCOMUsageTables(DocxWriter docxFile, AreaType area, ExtendedServ
433433
docxFile.startTable(SERVICE_COM_TYPES_TABLE_WIDTHS, service.getName() + " Service Object Types");
434434

435435
docxFile.startRow();
436-
docxFile.addCell(0, SERVICE_COM_TYPES_TABLE_WIDTHS, "Object Name", HEADER_COLOUR);
437-
docxFile.addCell(1, SERVICE_COM_TYPES_TABLE_WIDTHS, "Object Number", HEADER_COLOUR);
436+
docxFile.addCell(0, SERVICE_COM_TYPES_TABLE_WIDTHS, "Object Number", HEADER_COLOUR);
437+
docxFile.addCell(1, SERVICE_COM_TYPES_TABLE_WIDTHS, "Object Name", HEADER_COLOUR);
438438
docxFile.addCell(2, SERVICE_COM_TYPES_TABLE_WIDTHS, "Object Body Type", HEADER_COLOUR);
439-
docxFile.addCell(3, SERVICE_COM_TYPES_TABLE_WIDTHS, "Related points to", HEADER_COLOUR);
440-
docxFile.addCell(4, SERVICE_COM_TYPES_TABLE_WIDTHS, "Source points to", HEADER_COLOUR);
439+
docxFile.addCell(3, SERVICE_COM_TYPES_TABLE_WIDTHS, "Related link", HEADER_COLOUR);
440+
docxFile.addCell(4, SERVICE_COM_TYPES_TABLE_WIDTHS, "Source link", HEADER_COLOUR);
441441
docxFile.endRow();
442442

443443
List<String> cmts = new LinkedList<>();
444444

445445
for (ModelObjectType obj : features.getObjects().getObject()) {
446446
docxFile.startRow();
447-
docxFile.addCell(0, SERVICE_COM_TYPES_TABLE_WIDTHS, obj.getName());
448-
docxFile.addCell(1, SERVICE_COM_TYPES_TABLE_WIDTHS, String.valueOf(obj.getNumber()));
447+
docxFile.addCell(0, SERVICE_COM_TYPES_TABLE_WIDTHS, String.valueOf(obj.getNumber()));
448+
docxFile.addCell(1, SERVICE_COM_TYPES_TABLE_WIDTHS, obj.getName());
449449

450450
if (null != obj.getObjectType() && (null != obj.getObjectType().getAny())) {
451451
docxFile.addCell(2, SERVICE_COM_TYPES_TABLE_WIDTHS,
@@ -504,17 +504,17 @@ private void drawCOMUsageTables(DocxWriter docxFile, AreaType area, ExtendedServ
504504
evntTable.startTable(SERVICE_COM_TYPES_TABLE_WIDTHS, service.getName() + " Service Events");
505505

506506
evntTable.startRow();
507-
evntTable.addCell(0, SERVICE_COM_TYPES_TABLE_WIDTHS, "Event Name", HEADER_COLOUR);
508-
evntTable.addCell(1, SERVICE_COM_TYPES_TABLE_WIDTHS, "Object Number", HEADER_COLOUR);
507+
evntTable.addCell(0, SERVICE_COM_TYPES_TABLE_WIDTHS, "Object Number", HEADER_COLOUR);
508+
evntTable.addCell(1, SERVICE_COM_TYPES_TABLE_WIDTHS, "Event Name", HEADER_COLOUR);
509509
evntTable.addCell(2, SERVICE_COM_TYPES_TABLE_WIDTHS, "Object Body Type", HEADER_COLOUR);
510-
evntTable.addCell(3, SERVICE_COM_TYPES_TABLE_WIDTHS, "Related points to", HEADER_COLOUR);
511-
evntTable.addCell(4, SERVICE_COM_TYPES_TABLE_WIDTHS, "Source points to", HEADER_COLOUR);
510+
evntTable.addCell(3, SERVICE_COM_TYPES_TABLE_WIDTHS, "Related link", HEADER_COLOUR);
511+
evntTable.addCell(4, SERVICE_COM_TYPES_TABLE_WIDTHS, "Source link", HEADER_COLOUR);
512512
evntTable.endRow();
513513

514514
for (ModelObjectType evnt : features.getEvents().getEvent()) {
515515
evntTable.startRow();
516-
evntTable.addCell(0, SERVICE_COM_TYPES_TABLE_WIDTHS, evnt.getName(), STD_COLOUR);
517-
evntTable.addCell(1, SERVICE_COM_TYPES_TABLE_WIDTHS, String.valueOf(evnt.getNumber()), STD_COLOUR);
516+
evntTable.addCell(0, SERVICE_COM_TYPES_TABLE_WIDTHS, String.valueOf(evnt.getNumber()), STD_COLOUR);
517+
evntTable.addCell(1, SERVICE_COM_TYPES_TABLE_WIDTHS, evnt.getName(), STD_COLOUR);
518518

519519
if (null != evnt.getObjectType()) {
520520
evntTable.addCell(2, SERVICE_COM_TYPES_TABLE_WIDTHS,
@@ -880,7 +880,7 @@ public int compare(String o1, String o2) {
880880
String errorNumber = "UNKNOWN ERROR NUMBER!";
881881
String es;
882882
if ((err.getType().getArea() == null) || (err.getType().getArea().equals(area.getName()))) {
883-
ErrorDefinitionType edt = getErrorDefinition(err.getType().getName());
883+
ErrorDefinitionType edt = typeInformation.getErrorDefinition(err.getType().getName());
884884
if (edt != null) {
885885
errorNumber = String.valueOf(edt.getNumber());
886886
}

0 commit comments

Comments
 (0)