summaryrefslogtreecommitdiff
path: root/management/core/etc/cml.xsd
blob: 3ee4c9a58406481f32c7d0a42619f40b52d50a8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?xml version="1.0" encoding="UTF-8"?>
<!--
 -
 - Licensed to the Apache Software Foundation (ASF) under one
 - or more contributor license agreements.  See the NOTICE file
 - distributed with this work for additional information
 - regarding copyright ownership.  The ASF licenses this file
 - to you under the Apache License, Version 2.0 (the
 - "License"); you may not use this file except in compliance
 - with the License.  You may obtain a copy of the License at
 - 
 -   http://www.apache.org/licenses/LICENSE-2.0
 - 
 - Unless required by applicable law or agreed to in writing,
 - software distributed under the License is distributed on an
 - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 - KIND, either express or implied.  See the License for the
 - specific language governing permissions and limitations
 - under the License.
 -
 -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.apache.org/qpid/schema/cml" xmlns="http://www.apache.org/qpid/schema/cml"
    elementFormDefault="qualified">
    <xs:element name="cml">
        <xs:annotation>
            <xs:documentation>Defines a CML document as a schema or a...</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:choice>
                <xs:element name="schema-request" minOccurs="0"/>
                <xs:element name="schema-reply" type="schema-reply-type" minOccurs="0" >
                    <!--<xs:key name="classkey">
                        <xs:selector xpath="class"/>
                        <xs:field xpath="@name"/>
                    </xs:key>-->
                </xs:element>
                <xs:element name="inspect-request" type="inspect-request-type" minOccurs="0"/>
                <xs:element name="inspect-reply" type="inspect-reply-type" minOccurs="0" />
                <xs:element name="method-request" type="method-request-type" minOccurs="0"/>
                <xs:element name="method-reply" type="method-reply-type" minOccurs="0" />
             </xs:choice>
            <xs:attribute name="version" type="xs:string" use="required"/>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="schema-reply-type">
        <xs:annotation>
            <xs:documentation>Client request for a schema</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="class" type="class-type" minOccurs="1" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="version" type="xs:string" use="required"/>
        <xs:attribute name="status">
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="ok"/>
                    <xs:enumeration value="not ok"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
    </xs:complexType>
    <xs:complexType name="class-type">
        <xs:annotation>
            <xs:documentation>Defines a class which is a managable object</xs:documentation>
        </xs:annotation>
        <xs:choice>
            <xs:element name="field" type="field-type" minOccurs="0" maxOccurs="unbounded">
                <xs:unique name="uniqueFieldName">
                    <xs:selector xpath="field"/>
                    <xs:field xpath="@name"/>
                </xs:unique>
            </xs:element>
            <xs:element name="method" type="method-type" minOccurs="0" maxOccurs="unbounded">
                <xs:unique name="uniqueMethodName">
                    <xs:selector xpath="method"/>
                    <xs:field xpath="@name"/>
                </xs:unique>
            </xs:element>
        </xs:choice>
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="field-type">
        <xs:annotation>
            <xs:documentation>Defines a field within a class</xs:documentation>
        </xs:annotation>
        <xs:simpleContent>
            <xs:extension base="xs:string">
                <xs:attribute name="name" type="xs:string" use="required"/>
                <xs:attribute name="type" use="optional" default="string">
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            <xs:enumeration value="bool"/>
                            <xs:enumeration value="string"/>
                            <xs:enumeration value="int"/>
                            <xs:enumeration value="objref"/>
                            <xs:enumeration value="time"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:attribute>
                <xs:attribute name="label" type="xs:string" use="optional"/>
                <xs:attribute name="repeat" type="xs:boolean" use="optional" default="false"/>
                <xs:attribute name="modify" type="xs:boolean" use="optional" default="false"/>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="method-type">
        <xs:annotation>
            <xs:documentation>Defines a method within a class</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="field" type="field-type" minOccurs="0" maxOccurs="unbounded">
                <xs:unique name="uniqueArgumentName">
                    <xs:selector xpath="field"/>
                    <xs:field xpath="@name"/>
                </xs:unique>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="inspect-request-type">
        <xs:annotation>
            <xs:documentation>A request to get the property values of an instance</xs:documentation>
        </xs:annotation>
        <xs:attribute name="object" type="xs:int" use="required"/>
    </xs:complexType>
    <xs:complexType name="inspect-reply-type">
        <xs:annotation>
            <xs:documentation>A response containing the properties of an instance</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="field" type="field-type" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="object" type="object-type" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="class" type="xs:string" use="optional"/>
        <xs:attribute name="status" use="optional">
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="ok"/>
                    <xs:enumeration value="notfound"/>
                    <xs:enumeration value="noaccess"/>
                    <xs:enumeration value="invalid"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute name="object" type="xs:int" use="required"/>
    </xs:complexType>
    <xs:complexType name="object-type">
        <xs:annotation>
            <xs:documentation>A reference to an object instance</xs:documentation>
        </xs:annotation>
        <xs:attribute name="class" type="xs:string" use="required"/>
        <xs:attribute name="id" type="xs:int" use="required"/>
    </xs:complexType>
    <xs:complexType name="method-request-type">
        <xs:annotation>
            <xs:documentation>A request to invoke a method</xs:documentation>
        </xs:annotation>
        <xs:attribute name="object" type="xs:int" use="required"/>
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="method-reply-type">
        <xs:annotation>
            <xs:documentation>A reply to a method invocation request</xs:documentation>
        </xs:annotation>
        <xs:attribute name="object" type="xs:int" use="required"/>
        <xs:attribute name="status" use="required">
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="ok"/>
                    <xs:enumeration value="notfound"/>
                    <xs:enumeration value="noaccess"/>
                    <xs:enumeration value="invalid"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
    </xs:complexType>
</xs:schema>