From commits-return-6346-archive-asf-public=cust-asf.ponee.io@tamaya.incubator.apache.org Sun Dec 16 00:22:35 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 4F373180679 for ; Sun, 16 Dec 2018 00:22:34 +0100 (CET) Received: (qmail 12429 invoked by uid 500); 15 Dec 2018 23:22:33 -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 12376 invoked by uid 99); 15 Dec 2018 23:22:33 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Dec 2018 23:22:33 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id CD68185278; Sat, 15 Dec 2018 23:22:32 +0000 (UTC) Date: Sat, 15 Dec 2018 23:22:33 +0000 To: "commits@tamaya.apache.org" Subject: [incubator-tamaya-extensions] 01/05: TAMAYA-372: Clarified default metadata format. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: anatole@apache.org In-Reply-To: <154491615260.23724.14700216563213957106@gitbox.apache.org> References: <154491615260.23724.14700216563213957106@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-tamaya-extensions X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 74a7a9b18ae548c6fa053c69877e3c19460315e5 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20181215232232.CD68185278@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. anatole pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-tamaya-extensions.git commit 74a7a9b18ae548c6fa053c69877e3c19460315e5 Author: Anatole Tresch AuthorDate: Tue Dec 11 11:00:34 2018 +0100 TAMAYA-372: Clarified default metadata format. --- .../META-INF/javaconfiguration.properties | 42 +++++++++++----------- .../consul/AbstractConsulPropertySource.java | 16 ++++----- .../filter/internal/DefaultMetadataFilter.java | 2 +- .../hazelcast/AbstractHazelcastPropertySource.java | 6 ++-- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/modules/collections/src/test/resources/META-INF/javaconfiguration.properties b/modules/collections/src/test/resources/META-INF/javaconfiguration.properties index 6e6b436..b0d66f3 100644 --- a/modules/collections/src/test/resources/META-INF/javaconfiguration.properties +++ b/modules/collections/src/test/resources/META-INF/javaconfiguration.properties @@ -24,46 +24,46 @@ base.map=1:a, 2:b, 3:c, [4: ] # Config for tests with explcit implementation types typed2.arraylist=1,2,3,4,5,6,7,8,9,0 -[META]typed2.arraylist.collection-type=ArrayList +[(META)typed2.arraylist].collection-type=ArrayList typed2.linkedlist=1,2,3,4,5,6,7,8,9,0 -[META]typed2.linkedlist.collection-type=java.util.LinkedList +[(META)typed2.linkedlist].collection-type=java.util.LinkedList typed2.hashset=1,2,3,4,5,6,7,8,9,0 -[META]typed2.hashset.collection-type=HashSet +[(META)typed2.hashset].collection-type=HashSet typed2.treeset=1,2,3,4,5,6,7,8,9,0 -[META]typed2.treeset.collection-type=TreeSet +[(META)typed2.treeset].collection-type=TreeSet typed2.hashmap=1:a, 2:b, 3:c, [4: ] -[META]typed2.hashmap.collection-type=java.util.HashMap +[(META)typed2.hashmap].collection-type=java.util.HashMap typed2.treemap=1:a, 2:b, 3:c, [4: ] -[META]typed2.treemap.collection-type=TreeMap +[(META)typed2.treemap].collection-type=TreeMap # Config for tests with combination policy, writable typed.arraylist=1,2,3,4,5,6,7,8,9,0 -[META]typed.arraylist.collection-type=ArrayList -[META]typed.arraylist.read-only=true +[(META)typed.arraylist].collection-type=ArrayList +[(META)typed.arraylist].read-only=true typed.linkedlist=1,2,3,4,5,6,7,8,9,0 -[META]typed.linkedlist.collection-type=java.util.LinkedList +[(META)typed.linkedlist.collection-type=java.util.LinkedList typed.hashset=1,2,3,4,5,6,7,8,9,0 -[META]typed.hashset.collection-type=HashSet +[(META)typed.hashset].collection-type=HashSet typed.treeset=1,2,3,4,5,6,7,8,9,0 -[META]typed.treeset.collection-type=TreeSet +[(META)typed.treeset].collection-type=TreeSet typed.hashmap=1:a, 2:b, 3:c, [4: ] -[META]typed.hashmap.collection-type=java.util.HashMap -[META]typed.hashmap.read-only=true +[(META)typed.hashmap].collection-type=java.util.HashMap +[(META)typed.hashmap].read-only=true typed.treemap=1:a, 2:b, 3:c, [4: ] -[META]typed.treemap.collection-type=TreeMap +[(META)typed.treemap].collection-type=TreeMap # Config for advanced tests sep-list=a,b,c|d,e,f|g,h,i -[META]sep-list.collection-type=List -[META]sep-list.item-separator=| +[(META)sep-list].collection-type=List +[(META)sep-list].item-separator=| currency-list=CHF,USD,USS -[META]currency-list.collection-type=List +[(META)currency-list].collection-type=List parser-list=a,b,c -[META]parser-list.collection-type=List -[META]parser-list.item-converter=org.apache.tamaya.collections.MyUpperCaseConverter +[(META)parser-list].collection-type=List +[(META)parser-list].item-converter=org.apache.tamaya.collections.MyUpperCaseConverter redefined-map=0==none | 1==single | 2==any -[META]redefined-map.map-entry-separator=== -[META]redefined-map.item-separator=| +[(META)redefined-map].map-entry-separator=== +[(META)redefined-map].item-separator=| diff --git a/modules/consul/src/main/java/org/apache/tamaya/consul/AbstractConsulPropertySource.java b/modules/consul/src/main/java/org/apache/tamaya/consul/AbstractConsulPropertySource.java index 8b11eeb..0b2b871 100644 --- a/modules/consul/src/main/java/org/apache/tamaya/consul/AbstractConsulPropertySource.java +++ b/modules/consul/src/main/java/org/apache/tamaya/consul/AbstractConsulPropertySource.java @@ -149,18 +149,18 @@ implements MutablePropertySource{ public PropertyValue get(String key) { checkRefresh(); String reqKey = key; - if(key.startsWith("[META]")){ - reqKey = key.substring("[META]".length()); - if(reqKey.endsWith(".createdIndex")){ - reqKey = reqKey.substring(0,reqKey.length()-".createdIndex".length()); + if(key.startsWith("[(META)")){ + reqKey = key.substring("[(META)".length()); + if(reqKey.endsWith("].createdIndex")){ + reqKey = reqKey.substring(0,reqKey.length()-"].createdIndex".length()); } else if(reqKey.endsWith(".modifiedIndex")){ - reqKey = reqKey.substring(0,reqKey.length()-".modifiedIndex".length()); + reqKey = reqKey.substring(0,reqKey.length()-"].modifiedIndex".length()); } else if(reqKey.endsWith(".ttl")){ - reqKey = reqKey.substring(0,reqKey.length()-".ttl".length()); + reqKey = reqKey.substring(0,reqKey.length()-"].ttl".length()); } else if(reqKey.endsWith(".expiration")){ - reqKey = reqKey.substring(0,reqKey.length()-".expiration".length()); + reqKey = reqKey.substring(0,reqKey.length()-"].expiration".length()); } else if(reqKey.endsWith(".source")){ - reqKey = reqKey.substring(0,reqKey.length()-".source".length()); + reqKey = reqKey.substring(0,reqKey.length()-"].source".length()); } } PropertyValue val = this.configMap.get(reqKey); diff --git a/modules/filter/src/main/java/org/apache/tamaya/filter/internal/DefaultMetadataFilter.java b/modules/filter/src/main/java/org/apache/tamaya/filter/internal/DefaultMetadataFilter.java index 2a543ef..a946d32 100644 --- a/modules/filter/src/main/java/org/apache/tamaya/filter/internal/DefaultMetadataFilter.java +++ b/modules/filter/src/main/java/org/apache/tamaya/filter/internal/DefaultMetadataFilter.java @@ -34,7 +34,7 @@ public final class DefaultMetadataFilter implements PropertyFilter{ return valueToBeFiltered; } if(ThreadBasedConfigurationFilter.isMetadataFiltered()) { - if (context.getProperty().getKey().startsWith("[META]")) { + if (context.getProperty().getKey().startsWith("[(META)")) { // Hide metadata entries. return null; } diff --git a/modules/hazelcast/src/main/java/org/apache/tamaya/hazelcast/AbstractHazelcastPropertySource.java b/modules/hazelcast/src/main/java/org/apache/tamaya/hazelcast/AbstractHazelcastPropertySource.java index 117bb2c..6084b63 100644 --- a/modules/hazelcast/src/main/java/org/apache/tamaya/hazelcast/AbstractHazelcastPropertySource.java +++ b/modules/hazelcast/src/main/java/org/apache/tamaya/hazelcast/AbstractHazelcastPropertySource.java @@ -218,10 +218,10 @@ implements MutablePropertySource{ for(String key: configChange.getRemovedProperties()){ config.remove(key); } - IList taList = getHazelcastInstance().getList("[META]tamaya.transactions"); + IList taList = getHazelcastInstance().getList("[(META)tamaya.transactions]"); taList.add(configChange.getTransactionID()); - config.put("[META]tamaya.transaction.lastId", configChange.getTransactionID(), 1, TimeUnit.DAYS); - config.put("[META]tamaya.transaction.startedAt", String.valueOf(configChange.getStartedAt()), 1, TimeUnit.DAYS); + config.put("[(META)tamaya.transaction].lastId", configChange.getTransactionID(), 1, TimeUnit.DAYS); + config.put("[(META)tamaya.transaction].startedAt", String.valueOf(configChange.getStartedAt()), 1, TimeUnit.DAYS); config.flush(); refresh(); }