Skip to content

Commit

Permalink
Refs #100984 Add schemas and validation examples for StrategySelection.
Browse files Browse the repository at this point in the history
Michael Plass committed Aug 23, 2013
1 parent 18f25d2 commit c3b3c15
Showing 4 changed files with 37 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doc/technical/Registration.txt
Original file line number Diff line number Diff line change
@@ -252,7 +252,7 @@ already addressed the appropriate node).
PublisherPublicKeyDigest is always present in a response.

=== StrategyID
Is a strategy identifier.
Is a strategy identifier. Present in responses and in `setstrategy` requests.
It is limited to 15 characters, chosen from the set of characters that are
legal in a c language identifier.

@@ -262,6 +262,7 @@ procedure.
The format of this string may differ by strategy, but it is recommended that
a form similar to the query portion of a URI be used.
Documentation for individual strategies should specify what this string may contain.
May be present in responses and in `setstrategy` requests.

=== FreshnessSeconds
FreshnessSeconds is optional in a request.
10 changes: 10 additions & 0 deletions schema/ccnx.dtd
Original file line number Diff line number Diff line change
@@ -207,6 +207,16 @@

<!ELEMENT ForwardingFlags (#PCDATA)> <!-- nonNegativeInteger -->

<!ELEMENT StrategySelection (Action?,
Name?,
PublisherPublicKeyDigest?,
StrategyID?,
StrategyParameters?,
FreshnessSeconds?)>

<!ELEMENT StrategyID (#PCDATA)> <!-- string, 1-15 alpha_numeric -->
<!ELEMENT StrategyParameters (#PCDATA)> <!-- string -->

<!ELEMENT StatusResponse (StatusCode, StatusText?)>
<!ELEMENT StatusCode (#PCDATA)> <!-- nonNegativeInteger -->
<!ELEMENT StatusText (#PCDATA)> <!-- textual description of error or other condition -->
12 changes: 12 additions & 0 deletions schema/ccnx.xsd
Original file line number Diff line number Diff line change
@@ -391,6 +391,18 @@
</xs:sequence>
</xs:complexType>

<xs:element name="StrategySelection" type="StrategySelectionType"/>
<xs:complexType name="StrategySelectionType">
<xs:sequence>
<xs:element name="Action" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="Name" type="NameType" minOccurs="0" maxOccurs="1"/>
<xs:element name="PublisherPublicKeyDigest" type="DigestType" minOccurs="0" maxOccurs="1"/>
<xs:element name="StrategyID" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="StrategyParameters" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="FreshnessSeconds" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="StatusResponseType">
<xs:sequence>
<xs:element name="StatusCode" type="xs:nonNegativeInteger" minOccurs="1" maxOccurs="1"/>
13 changes: 13 additions & 0 deletions schema/validation/ccn-test23.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<StrategySelection>
<Action>setstrategy</Action>
<Name>
<Component ccnbencoding="base64Binary">VGhpc0lzUGFydE9mVGhlTmFtZQ==</Component>
</Name>
<PublisherPublicKeyDigest ccnbencoding="base64Binary">
AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM=
</PublisherPublicKeyDigest>
<StrategyID>random</StrategyID>
<StrategyParameters>a=42</StrategyParameters>
<FreshnessSeconds>9999999</FreshnessSeconds>
</StrategySelection>

0 comments on commit c3b3c15

Please sign in to comment.