We are only going to support the latest version of metadata models.
This means that there will only 1 version that represent the standard metadata model (ra.xml), and
1 metadata model for the activation metadata.
So
1..1 standard metadata: We will mark w/ a flag the version of parsed XML file. Obtained through
META-INF/ra.xml
Connector annotations
Fields not present in previous version and/or not specified will take defaults.
0..n activation metadata: Generated by parsing both ironjacamar.xml and -ra.xml files, having in fact same content
-ra.xml: Archive name will be obtained from the definition itself
ironjacamar.xml: Archive name will be defined by the deployer chain
Richer model
We need a richer metadata model, containing not only the value of a field, but also other information, and able to handle standard operations.
Requirements:
Extend an Attribute extends Object> generic class
'Name' containing the name of the attribute or element
'Value' is immutable
'Value' is always an Object subtype (String, Integer, Float....) and not a primitive type (int, float...)
'Value' must have a default
'Value' with "null" means container default
'Mandatory' defines if the attribute or element is mandatory
Have an optional validator handler. We will have standard implementations (IntegerValidator, StringValidator, IntegerRangeValidator and so on), but of course a specific implementation can be specified for integration
Have an optional error handler to permit better integration. Default implementation is just logging and rethrow exception, most likely incapsulated in our own exception
Parser requirements:
Implement the XML parser SPI
ParserFactory based on service activation, e.g. available parsers resolved at runtime
Have a StAX based implementation for IronJacamar/Standalone and IronJacamar/Embedded
The names of the attributes and elements must be centrally defined. A decorator pattern could be used in the parsing phase.
Metadata transformers
There must be transformers for older versions of the ironjacmar.xml and -ra.xml activation models.
The transformer could be attached to the individual metadata model node. Ignore and reject cases must be handled.