|
From: Craig G. (opennms) <cg...@op...> - 2012-08-15 19:09:04
|
Hi,
In the PM dependencies model we have to return to the problem of how do
we deal with association classes. It appears that we never satisfactory
resolved this issue in the past because we didn't need association
classes in our models. It is now returning to haunt us. I have looked
carefully at the generated XSD's and it is clear that the present
solution in the Soap generator does not work in a useful way. In the JVT
generated code I have an alternative solution but it does not match the
SOAP generator (see attached Java classes).
The PM Dependency model contains one association class called the
PerformanceIndicatorSpecRelationship.
This has one attribute; String relationshipType. This generates the
following XSD which has no reference to either end of the relationship.
<xsd:element name="performanceIndicatorSpecRelationship"
type="tns:PerformanceIndicatorSpecRelationship"/>
<xsd:complexType name="PerformanceIndicatorSpecRelationship">
<xsd:annotation>
<xsd:documentation>
<p>An association between two
PerformanceIndicatorSpecifications, such as one indicator derived from
another.</p>
<p>This association class is optional</p>
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="relationshipType" type="xsd:string"
minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
<p>A categorization of the relationship, such as
derived from, composite/atomic, and so forth.</p>
<p>This element is generated from an attribute.</p>
<p>This attribute is optional</p>
<p>This attribute is AVC enabled</p>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
Similarly the generated PerformanceIndicatorSpecification entities which
are linked by this association class do not reference the association
class. In fact, it appears that the the association class between
PerformanceIndicatorSpecification entities is not generated at all.
<xsd:complexType name="PerformanceIndicatorSpecification">
<xsd:annotation>
<xsd:documentation>
<p>A measure of a specific aspect of the performance of an
entity, such as a lost packets or average jitter, defined for a
PeformanceSpecification that may trigger the creation of a
PerformanceConsequence.</p>
<p>This entity is optional</p>
<p>This entity is extendable</p>
<p>This entity does not generate Object Creation
notifications (NA)</p>
<p>This entity does not generate Object Deletion
notifications (NA)</p>
<p>This entity does not generate Object Discovery
notifications (NA)</p>
<p>This entity generates Attribute Value Change
notifications.</p>
</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="entity:EntityBase">
<xsd:sequence>
<xsd:element name="name" type="xsd:string" minOccurs="1"
maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
<p>A word, term, or phrase by which a
PerformanceIndicatorSpecification is known and distinguished from other
PerformanceIndicatorSpecifications.</p>
<p>This element is generated from an attribute.</p>
<p>This attribute is mandatory</p>
<p>This attribute is AVC enabled</p>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="description" type="xsd:string"
minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
<p>A narrative that explains in detail what the
PerformanceIndicatorSpecification is.</p>
<p>This element is generated from an attribute.</p>
<p>This attribute is optional</p>
<p>This attribute is AVC enabled</p>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="perspective" type="xsd:string"
minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
<p>The point of view for the
PerformanceIndicatorSpecification, such as a single user instance or an
aggregation.</p>
<p>This element is generated from an attribute.</p>
<p>This attribute is optional</p>
<p>This attribute is AVC enabled</p>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="indicatorCategory" type="xsd:string"
minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
<p>A grouping or set of
PerformanceIndicatorSpecifications that are classified together because
of common characteristics, such as technology specific, service
specific, or technology/service independent.</p>
<p>This element is generated from an attribute.</p>
<p>This attribute is optional</p>
<p>This attribute is AVC enabled</p>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="indicatorType"
type="perf:IndicatorType" minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
<p>A kind of value that the
PerformanceIndicator can take on, such as numeric, text, and so forth.</p>
<p>This element is generated from an attribute.</p>
<p>This attribute is mandatory</p>
<p>This attribute is AVC enabled</p>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="derivationAlgorithm"
type="xsd:string" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
<p>A step-by-step procedure used to calculate
the value of the PerformanceIndicator.</p>
<p>This element is generated from an attribute.</p>
<p>This attribute is optional</p>
<p>This attribute is AVC enabled</p>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="derivationMethod" type="xsd:string"
minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
<p>For simple calculations, the method used to
calculate the value of a PerformanceIndicator, such as average, minimum,
maximum, sum, and so forth.</p>
<p>This element is generated from an attribute.</p>
<p>This attribute is optional</p>
<p>This attribute is AVC enabled</p>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="collectionType"
type="perf:CollectionType" minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
<p>The type of the collection such as: gauge,
commulative, status inspection. Indicators can be produced using these
methods.</p>
<p>This element is generated from an attribute.</p>
<p>This attribute is mandatory</p>
<p>This attribute is AVC enabled</p>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="indicatorUnit" type="xsd:string"
minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
<p>The unit by which the indicator is measured.
For example: seconds, KBs, rate per second, etc.</p>
<p>This element is generated from an attribute.</p>
<p>This attribute is optional</p>
<p>This attribute is AVC enabled</p>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="ArrayOfPerformanceIndicatorSpecification">
<xsd:sequence>
<xsd:element name="item"
type="tns:PerformanceIndicatorSpecification" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
In short, we are generating an XSD for an assocation class in the
model which is not referenced by any entity and which cannot be
retrieved across the interface which seems fairly useless.
So my question is;
What is the PerformanceIndicatorSpecRelationship for?
Should association classes actually be treated as Entities so that they
can be referenced through entity identifiers and be used for indirection
between A and Z end's ( that way when an association changes, it makes
sense to send an association value change event) .
Or or should they be treated a data types which are embedded in entities
and contain the entity identifier of the other end artefact. Whatever
the answer is, we aren't doing anything useful at the moment.
Please see the generated Java implementation attached for some ideas.
This is a blocking issue for completing the RI/CTK code for PM
Craig
|