summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/resources/schema/common.rnc
blob: 859637641393cd5e7fcc7bdad3b2f5c707b6202e (plain) (blame)
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
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
service.attlist &= attribute hostalias { xsd:NCName }
service.attlist &= attribute baseport { xsd:unsignedShort }?
service.attlist &= attribute jvmargs { text }?
# preload is for internal use only
service.attlist &= attribute preload { text }?

anyElement = element * {
   (attribute * { text }
    | text
    | anyElement)*
}

# Valid qualified java class name. See http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.8
JavaId = xsd:string { pattern = "([a-zA-Z_$][a-zA-Z\d_$]*\.)*[a-zA-Z_$][a-zA-Z\d_$]*" }

Nodes = element nodes {
    attribute count { xsd:positiveInteger } &
    attribute flavor { xsd:string }? &
    attribute docker-image { xsd:string }?
}

OptionalDedicatedNodes = element nodes {
    attribute count { xsd:positiveInteger } &
    attribute flavor { xsd:string }? &
    attribute required { xsd:boolean }? &
    attribute docker-image { xsd:string }? &
    attribute dedicated { xsd:boolean }? &
    attribute exclusive { xsd:boolean }?
}

GenericConfig = element config {
    attribute name { text },
    attribute namespace { text }?,
    attribute version { text }?,
    anyElement +
}

ComponentSpec =
    ( attribute id { xsd:Name | JavaId } | attribute idref { xsd:Name } | attribute ident { xsd:Name } )

ComponentId =
    ComponentSpec

BundleSpec =
    attribute class { xsd:Name | JavaId }? &
    attribute bundle { xsd:Name }?

Component = element component {
   ComponentDefinition
}

ComponentDefinition =
   ComponentId &
   BundleSpec &
   GenericConfig* &
   Component*