aboutsummaryrefslogtreecommitdiff
path: root/schemas
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2014-07-09 05:39:54 +0000
committerRob Austein <sra@hactrn.net>2014-07-09 05:39:54 +0000
commited6e675ccbe2a3e2c57dfb35e4c71684a25110b0 (patch)
treed790587c217adec5327ec42a2e4774e3587de3d7 /schemas
parent13a65b463cd0acedd3bc36c9437d5ee8b2e26b60 (diff)
Add withdrawal hashes to publication and rrdp.
svn path=/branches/tk705/; revision=5888
Diffstat (limited to 'schemas')
-rw-r--r--schemas/relaxng/publication.rnc26
-rw-r--r--schemas/relaxng/publication.rng59
-rw-r--r--schemas/relaxng/rrdp.rnc14
-rw-r--r--schemas/relaxng/rrdp.rng37
4 files changed, 90 insertions, 46 deletions
diff --git a/schemas/relaxng/publication.rnc b/schemas/relaxng/publication.rnc
index 3a519543..8c129546 100644
--- a/schemas/relaxng/publication.rnc
+++ b/schemas/relaxng/publication.rnc
@@ -44,10 +44,16 @@ version = "3"
# Top level PDU is either a query or a reply.
-start = element msg {
- attribute version { version } ,
- ( ( attribute type { "query" }, query_elt* ) |
- ( attribute type { "reply" }, reply_elt* ) )
+start |= element msg {
+ attribute version { version },
+ attribute type { "query" },
+ query_elt*
+}
+
+start |= element msg {
+ attribute version { version },
+ attribute type { "reply" },
+ reply_elt*
}
# PDUs allowed in queries and replies.
@@ -67,19 +73,23 @@ base64 = xsd:base64Binary
uri = attribute uri { xsd:anyURI { maxLength="4096" } }
+# Digest of objects being withdrawn
+
+hash = attribute hash { xsd:string { pattern = "[0-9a-fA-F]+" } }
+
# Error codes.
error = xsd:token { maxLength="1024" }
# <publish/> element
-publish_query |= element publish { tag?, uri, base64 }
-publish_reply |= element publish { tag?, uri }
+publish_query = element publish { tag?, uri, hash?, base64 }
+publish_reply = element publish { tag?, uri }
# <withdraw/> element
-withdraw_query |= element withdraw { tag?, uri }
-withdraw_reply |= element withdraw { tag?, uri }
+withdraw_query = element withdraw { tag?, uri, hash }
+withdraw_reply = element withdraw { tag?, uri }
# <report_error/> element
diff --git a/schemas/relaxng/publication.rng b/schemas/relaxng/publication.rng
index 2990ec97..fed494b2 100644
--- a/schemas/relaxng/publication.rng
+++ b/schemas/relaxng/publication.rng
@@ -43,29 +43,30 @@
<value>3</value>
</define>
<!-- Top level PDU is either a query or a reply. -->
- <start>
+ <start combine="choice">
<element name="msg">
<attribute name="version">
<ref name="version"/>
</attribute>
- <choice>
- <group>
- <attribute name="type">
- <value>query</value>
- </attribute>
- <zeroOrMore>
- <ref name="query_elt"/>
- </zeroOrMore>
- </group>
- <group>
- <attribute name="type">
- <value>reply</value>
- </attribute>
- <zeroOrMore>
- <ref name="reply_elt"/>
- </zeroOrMore>
- </group>
- </choice>
+ <attribute name="type">
+ <value>query</value>
+ </attribute>
+ <zeroOrMore>
+ <ref name="query_elt"/>
+ </zeroOrMore>
+ </element>
+ </start>
+ <start combine="choice">
+ <element name="msg">
+ <attribute name="version">
+ <ref name="version"/>
+ </attribute>
+ <attribute name="type">
+ <value>reply</value>
+ </attribute>
+ <zeroOrMore>
+ <ref name="reply_elt"/>
+ </zeroOrMore>
</element>
</start>
<!-- PDUs allowed in queries and replies. -->
@@ -102,6 +103,14 @@
</data>
</attribute>
</define>
+ <!-- Digest of objects being withdrawn -->
+ <define name="hash">
+ <attribute name="hash">
+ <data type="string">
+ <param name="pattern">[0-9a-fA-F]+</param>
+ </data>
+ </attribute>
+ </define>
<!-- Error codes. -->
<define name="error">
<data type="token">
@@ -109,16 +118,19 @@
</data>
</define>
<!-- <publish/> element -->
- <define name="publish_query" combine="choice">
+ <define name="publish_query">
<element name="publish">
<optional>
<ref name="tag"/>
</optional>
<ref name="uri"/>
+ <optional>
+ <ref name="hash"/>
+ </optional>
<ref name="base64"/>
</element>
</define>
- <define name="publish_reply" combine="choice">
+ <define name="publish_reply">
<element name="publish">
<optional>
<ref name="tag"/>
@@ -127,15 +139,16 @@
</element>
</define>
<!-- <withdraw/> element -->
- <define name="withdraw_query" combine="choice">
+ <define name="withdraw_query">
<element name="withdraw">
<optional>
<ref name="tag"/>
</optional>
<ref name="uri"/>
+ <ref name="hash"/>
</element>
</define>
- <define name="withdraw_reply" combine="choice">
+ <define name="withdraw_reply">
<element name="withdraw">
<optional>
<ref name="tag"/>
diff --git a/schemas/relaxng/rrdp.rnc b/schemas/relaxng/rrdp.rnc
index 5b47c90b..2829605d 100644
--- a/schemas/relaxng/rrdp.rnc
+++ b/schemas/relaxng/rrdp.rnc
@@ -61,11 +61,21 @@ start |= element deltas {
attribute to { serial },
element delta {
attribute serial { serial },
- ( element publish { attribute uri { uri }, base64 } |
- element withdraw { attribute uri { uri } } )+
+ delta_element+
}+
}
+delta_element |= element publish {
+ attribute uri { uri },
+ attribute hash { hash }?,
+ base64
+}
+
+delta_element |= element withdraw {
+ attribute uri { uri },
+ attribute hash { hash }
+}
+
# Local Variables:
# indent-tabs-mode: nil
# comment-start: "# "
diff --git a/schemas/relaxng/rrdp.rng b/schemas/relaxng/rrdp.rng
index 197a15b3..27ba741d 100644
--- a/schemas/relaxng/rrdp.rng
+++ b/schemas/relaxng/rrdp.rng
@@ -124,24 +124,35 @@
<ref name="serial"/>
</attribute>
<oneOrMore>
- <choice>
- <element name="publish">
- <attribute name="uri">
- <ref name="uri"/>
- </attribute>
- <ref name="base64"/>
- </element>
- <element name="withdraw">
- <attribute name="uri">
- <ref name="uri"/>
- </attribute>
- </element>
- </choice>
+ <ref name="delta_element"/>
</oneOrMore>
</element>
</oneOrMore>
</element>
</start>
+ <define name="delta_element" combine="choice">
+ <element name="publish">
+ <attribute name="uri">
+ <ref name="uri"/>
+ </attribute>
+ <optional>
+ <attribute name="hash">
+ <ref name="hash"/>
+ </attribute>
+ </optional>
+ <ref name="base64"/>
+ </element>
+ </define>
+ <define name="delta_element" combine="choice">
+ <element name="withdraw">
+ <attribute name="uri">
+ <ref name="uri"/>
+ </attribute>
+ <attribute name="hash">
+ <ref name="hash"/>
+ </attribute>
+ </element>
+ </define>
</grammar>
<!--
Local Variables: