Return-Path: X-Original-To: apmail-tamaya-commits-archive@minotaur.apache.org Delivered-To: apmail-tamaya-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3A30218C91 for ; Fri, 31 Jul 2015 22:40:32 +0000 (UTC) Received: (qmail 80446 invoked by uid 500); 31 Jul 2015 22:40:32 -0000 Delivered-To: apmail-tamaya-commits-archive@tamaya.apache.org Received: (qmail 80421 invoked by uid 500); 31 Jul 2015 22:40:32 -0000 Mailing-List: contact commits-help@tamaya.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tamaya.incubator.apache.org Delivered-To: mailing list commits@tamaya.incubator.apache.org Received: (qmail 80410 invoked by uid 99); 31 Jul 2015 22:40:32 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2015 22:40:32 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A4842C0337 for ; Fri, 31 Jul 2015 22:40:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.77 X-Spam-Level: * X-Spam-Status: No, score=1.77 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id tmcEE-XfE_Q3 for ; Fri, 31 Jul 2015 22:40:29 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id C3FEC2134F for ; Fri, 31 Jul 2015 22:40:28 +0000 (UTC) Received: (qmail 80399 invoked by uid 99); 31 Jul 2015 22:40:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2015 22:40:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 62084E050A; Fri, 31 Jul 2015 22:40:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: anatole@apache.org To: commits@tamaya.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-tamaya git commit: Initial partial draft of a model component for documenting, validating of configuration during runtime. Date: Fri, 31 Jul 2015 22:40:28 +0000 (UTC) Repository: incubator-tamaya Updated Branches: refs/heads/master 3c79a69c7 -> c4822f3e7 Initial partial draft of a model component for documenting, validating of configuration during runtime. Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/c4822f3e Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/c4822f3e Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/c4822f3e Branch: refs/heads/master Commit: c4822f3e7e0b3066a88d05b304ea78c46698ef07 Parents: 3c79a69 Author: anatole Authored: Sat Aug 1 00:40:04 2015 +0200 Committer: anatole Committed: Sat Aug 1 00:40:04 2015 +0200 ---------------------------------------------------------------------- sandbox/model/pom.xml | 50 ++++++++++ .../src/test/resources/examples/configmodel.ini | 56 +++++++++++ .../test/resources/examples/configmodel.json | 98 ++++++++++++++++++++ .../src/test/resources/examples/configmodel.xml | 68 ++++++++++++++ .../test/resources/examples/configmodel.yaml | 70 ++++++++++++++ 5 files changed, 342 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c4822f3e/sandbox/model/pom.xml ---------------------------------------------------------------------- diff --git a/sandbox/model/pom.xml b/sandbox/model/pom.xml new file mode 100644 index 0000000..0b2b502 --- /dev/null +++ b/sandbox/model/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + + + org.apache.tamaya.ext + tamaya-sandbox + 0.1-incubating-SNAPSHOT + .. + + + org.apache.tamaya.ext.model + tamaya-model + Apache Tamaya Extension Modules: Configuration Model Infrastructure + This extension module provides functionality to describe, document and + validate configuration during runtime. + + jar + + + + scm:git://git.apache.org/incubator-tamaya.git + + + scm:git://git.apache.org/incubator-tamaya.git + + + https://git-wip-us.apache.org/repos/asf?p=incubator-tamaya.git + + + + http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c4822f3e/sandbox/model/src/test/resources/examples/configmodel.ini ---------------------------------------------------------------------- diff --git a/sandbox/model/src/test/resources/examples/configmodel.ini b/sandbox/model/src/test/resources/examples/configmodel.ini new file mode 100644 index 0000000..1171228 --- /dev/null +++ b/sandbox/model/src/test/resources/examples/configmodel.ini @@ -0,0 +1,56 @@ +#################################################################################### +# Example of a configuration metamodel expressed via ini(tm). +#################################################################################### + +#################################################################################### +# Metamodel information +#################################################################################### +[__meta-model] +name = testmodel, +provider = ConfigModel Extension, +version = 1.0, +release-date = 2001-01-23, +author = Anatole Tresch, +# model-format = alternate format reader type +comments : = Late afternoon is best.\ + Backup contact is Nancy. + +#################################################################################### +# Description of Configuration Sections (minimal, can be extended by other modules). +# By default its interpreted as a section ! +#################################################################################### +[a] +# Paramname Type Validations Description +params2 = String, required, "a required parameter" +paramInt = Integer, "an optional parameter (default)" + +[a.b.c] +__desc = Just a test section + +[a.b.c.aRequiredSection] +__validations = required +__desc = A section containing required parameters is called a required section.\ + Sections can also explicitly be defined to be required, but without\ + specifying the paramteres to be contained., + +[a.b.c.aRequiredSection.subsection] +# Paramname Type Validations Description +param0 = String, "a minmally documented String parameter" +# A minmal String parameter +param00 = String +# description is optional +param1 = String, required +intParam = Integer, "an optional parameter (default)" + +[a.b.c.aRequiredSection.nonempty-subsection] +__validations = required + +[a.b.c.aRequiredSection.optional-subsection] + +[a.b.c.aValidatedSection] +__desc = "A validated section." +__validations = org.apache.tamaya.model.TestValidator?max=3 + + + + http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c4822f3e/sandbox/model/src/test/resources/examples/configmodel.json ---------------------------------------------------------------------- diff --git a/sandbox/model/src/test/resources/examples/configmodel.json b/sandbox/model/src/test/resources/examples/configmodel.json new file mode 100644 index 0000000..b5e3043 --- /dev/null +++ b/sandbox/model/src/test/resources/examples/configmodel.json @@ -0,0 +1,98 @@ +//################################################################################## +// Example of a configuration metamodel expressed via YAML(tm). +// Structure is shown through indentation (one or more spaces). +// Sequence items are denoted by a dash, +// key value pairs within a map are separated by a colon. +//################################################################################## + +//################################################################################## +// Metamodel information +//################################################################################## +{ + "__meta-model": { + "name": "testmodel", + "provider": "ConfigModel Extension", + "version": "1.0", + "release-date": "2001-01-23", + "author": "Anatole Tresch", + // "modelformat": "alternate format reader type" + "comments": "Late afternoon is best. Backup contact is Nancy." + }, + //################################################################################## + // Description of Configuration Sections (minimal, can be extended by other modules). + //################################################################################## + "a": { + // Paramname Type Validations Description + "params2": [ + "String", + "required", + "a required parameter" + ], + "paramInt": [ + "Integer", + "an optional parameter (default)" + ], + "sections": [ + "b.c" + : + { + "__desc": "Just a test section." + } + ], + }, + "a.b.c.aRequiredSection": { + "__validations": "required", + "__desc": "A section containing required parameters is called a required section. + Sections + can + also + explicitly + be + defined + to + be + required, + but + without + specifying + the + paramteres + to + be + contained + . + " + }, + "a.b.c.aRequiredSection.subsection": { + // Paramname Type Validations Description + "param0": [ + "String", + "a minmally documented String parameter" + ], + // A minmally defined String parameter + "param00": [ + "String" + ], + "param1": [ + "String", + "required", + "a required parameter" + ], + "intParam": [ + "Integer", + "an optional parameter (default)" + ] + }, + "a.b.c.aRequiredSection.nonempty-subsection": { + "__validations": "required" + }, + "a.b.c.aRequiredSection.optional-subsection": {}, + "a.b.c.aRequiredSection.aValidatedSection": { + "__desc": "A validated section.", + "__validations": [ + "org.apache.tamaya.model.validation.MaxItemValidator?max=3" + ] + } +} + + http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c4822f3e/sandbox/model/src/test/resources/examples/configmodel.xml ---------------------------------------------------------------------- diff --git a/sandbox/model/src/test/resources/examples/configmodel.xml b/sandbox/model/src/test/resources/examples/configmodel.xml new file mode 100644 index 0000000..5bdcb44 --- /dev/null +++ b/sandbox/model/src/test/resources/examples/configmodel.xml @@ -0,0 +1,68 @@ + + + + + + + testmodel + ConfigModel Extension + 1.0 + 2001-01-23 + Anatole Tresch + + Late afternoon is best. + Backup contact is Nancy. + + + + +
+ a required parameter + an optional parameter (default) +
+ Just a test section. +
+
+
+ A section containing required parameters is called a required section. + Sections can also explicitly be defined to be required, but without + specifying the paramteres to be contained. + +
+
+ + http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c4822f3e/sandbox/model/src/test/resources/examples/configmodel.yaml ---------------------------------------------------------------------- diff --git a/sandbox/model/src/test/resources/examples/configmodel.yaml b/sandbox/model/src/test/resources/examples/configmodel.yaml new file mode 100644 index 0000000..30b0e58 --- /dev/null +++ b/sandbox/model/src/test/resources/examples/configmodel.yaml @@ -0,0 +1,70 @@ +#################################################################################### +# Example of a configuration metamodel expressed via YAML(tm). +# Structure is shown through indentation (one or more spaces). +# Sequence items are denoted by a dash, +# key value pairs within a map are separated by a colon. +#################################################################################### + +#################################################################################### +# Metamodel information +#################################################################################### +__meta-model: { + name : 'testmodel', + provider : 'ConfigModel Extension', + version : '1.0', + release-date : 2001-01-23, + author : 'Anatole Tresch', + # model-format: 'alternate format reader type' + comments: > + Late afternoon is best. + Backup contact is Nancy. +} + +#################################################################################### +# Description of Configuration Sections (minimal, can be extended by other modules). +#################################################################################### +--- +a: { +# Paramname Type Validations Description + params2: 'String', 'required', 'a required parameter', + paramInt: 'Integer', 'an optional parameter (default)', +} +--- +a.b.c: { + __desc: 'Just a test section.' +} +--- +a.b.c.aRequiredSection: { + __validations: 'required', + __desc: | + A section containing required parameters is called a required section. + Sections can also explicitly be defined to be required, but without + specifying the paramteres to be contained., +} +--- +a.b.c.aRequiredSection.subsection: { +# Paramname Type Validations Description + param0: 'String', 'a minmally documented String parameter}', + param00: 'String', # A minmally defined String parameter + param1: 'String', 'required', 'a required parameter', + intParam: 'Integer', 'an optional parameter (default)' +} +... + +--- +a.b.c.aRequiredSection.nonempty-subsection: { + __validations: 'required' +} +... + +--- +a.b.c.aRequiredSection.optional-subsection: {} +... + +--- +a.b.c.aRequiredSection.aValidatedSection: { + __desc: 'A validated section.', + __validations: 'org.apache.tamaya.model.validation.MaxItemValidator?max=3' +} + +