Repository: incubator-tamaya Updated Branches: refs/heads/master 47bc4ab6a -> 54d8c21dc
TAMAYA-182: Adapted öatest changes. Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/54d8c21d Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/54d8c21d Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/54d8c21d Branch: refs/heads/master Commit: 54d8c21dc719c71052a46303548710cce19e1675 Parents: 47bc4ab Author: anatole <[email protected]> Authored: Wed Nov 9 02:01:33 2016 +0100 Committer: anatole <[email protected]> Committed: Wed Nov 9 02:02:03 2016 +0100 ---------------------------------------------------------------------- src/site/asciidoc/extensions/mod_filter.adoc | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/54d8c21d/src/site/asciidoc/extensions/mod_filter.adoc ---------------------------------------------------------------------- diff --git a/src/site/asciidoc/extensions/mod_filter.adoc b/src/site/asciidoc/extensions/mod_filter.adoc index 9b3cd0f..0df0035 100644 --- a/src/site/asciidoc/extensions/mod_filter.adoc +++ b/src/site/asciidoc/extensions/mod_filter.adoc @@ -15,19 +15,19 @@ // specific language governing permissions and limitations // under the License. -= Apache Tamaya -- Extension: Integration with etcd (Core OS) += Apache Tamaya -- Extension: User Filtering toc::[] [[Optional]] -== COnfiguration Filtering (Extension Module) +== User Filtering (Extension Module) === Overview The Tamaya filter module provides a simple singleton accessor that allows to explicitly add +PropertyFilter+ instances active on the current thread only. This can be very useful in many scenarios. Additionally this module adds standard filters that hide metadata entries when the full configuration map is accessed. When keys are accessed -explcitily no filtering is applied and everything is visible. +explicitily no filtering is applied and everything is visible. === Compatibility @@ -50,7 +50,7 @@ To benefit from configuration builder support you only must add the correspondin === The Extensions Provided -Tamaya Filter comes basically with 1 artifact: +Tamaya Filter comes basically with 3 artifacts: * The +org.apache.tamaya.filter.ConfigurationFilter+ provides several static methods to register +PropertyFilter+ instances on the current thread. @@ -60,7 +60,7 @@ instances on the current thread. === The ConfigurationFilter -The accessor mentioned implements the API for for adding 1PropertyFilters+ to the current thread (as thread local): +The accessor mentioned implements the API for for adding +PropertyFilters+ to the current thread (as thread local): [source, java] ----------------------------------------------- @@ -73,20 +73,20 @@ public final class ConfigurationFilter implements PropertyFilter{ * @see #clearFilters() * @param active true,to enable metadata filtering (default). */ - public static void setMetadataFilter(boolean active); + public static void setFilterMetadata(boolean active); /** * Access the filtering configuration that is used for filtering single property values accessed. * @return the filtering config, never null. */ - public static ProgrammableFilter getSingleFilters(); + public static FilterContext getSingleFilterContext(); /** * Access the filtering configuration that is used for filtering configuration properties accessed as full * map. * @return the filtering config, never null. */ - public static ProgrammableFilter getMapFilters(); + public static FilterContext getMapFilters(); /** * Removes all programmable filters active on the current thread. @@ -104,7 +104,7 @@ is part of this module, So you can add a customized filter as follows: [source, java] ----------------------------------------------- try{ - ConfigurationFilter.getMapFilters().addFilter(new RegexPropertyFilter("\\_.*")); + ConfigurationFilter.getMapFilters().addFilter(new myFilter()); // do your code with filtering active } @@ -114,19 +114,19 @@ finally{ } ----------------------------------------------- -The +ProgrammableFilter+ is a simple structure just providing some handy accessors to the dynamic thread-local +The +FilterContext+ is a simple structure just providing some handy accessors to the dynamic thread-local managed filters: [source, java] ----------------------------------------------- -public final class ProgrammableFilter implements PropertyFilter{ +public final class FilterContext implements PropertyFilter{ - public void addFilter(PropertyFilter filter); - public void addFilter(int pos, PropertyFilter filter); + public void addIncludes(PropertyFilter filter); + public void addExcludes(int pos, PropertyFilter filter); public PropertyFilter removeFilter(int pos); public void clearFilters(); - public void setFilters(PropertyFilter... filters); - public void setFilters(Collection<PropertyFilter> filters); + public void setIncludes(PropertyFilter... filters); + public void setExcludes(Collection<PropertyFilter> filters); public List<PropertyFilter> getFilters(); }
