brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject [59/64] [abbrv] incubator-brooklyn git commit: BROOKLYN-162 - apply org.apache package prefix to core config packages
Date Tue, 18 Aug 2015 15:04:08 GMT
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/config/BrooklynServerPaths.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/config/BrooklynServerPaths.java b/core/src/main/java/org/apache/brooklyn/core/config/BrooklynServerPaths.java
new file mode 100644
index 0000000..87f7a86
--- /dev/null
+++ b/core/src/main/java/org/apache/brooklyn/core/config/BrooklynServerPaths.java
@@ -0,0 +1,281 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.core.config;
+
+import java.io.File;
+import java.util.Map;
+
+import javax.annotation.Nullable;
+
+import org.apache.brooklyn.api.management.ManagementContext;
+import org.apache.brooklyn.config.StringConfigMap;
+import org.apache.brooklyn.core.config.BrooklynServerConfig;
+import org.apache.brooklyn.core.management.internal.ManagementContextInternal;
+import org.apache.brooklyn.core.util.text.TemplateProcessor;
+import org.apache.brooklyn.util.collections.MutableMap;
+import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.apache.brooklyn.util.guava.Maybe;
+import org.apache.brooklyn.util.net.Urls;
+import org.apache.brooklyn.util.os.Os;
+import org.apache.brooklyn.util.text.Identifiers;
+import org.apache.brooklyn.util.text.Strings;
+import org.apache.brooklyn.util.time.Time;
+import org.apache.commons.io.FileUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Objects;
+
+public class BrooklynServerPaths {
+
+    private static final Logger log = LoggerFactory.getLogger(BrooklynServerPaths.class);
+    
+    /** Computes the base dir where brooklyn should read and write configuration.
+     * Defaults to <code>~/.brooklyn/</code>. 
+     * <p>
+     * Also see other variants of this method if a {@link ManagementContext} is not yet available. */
+    public static String getMgmtBaseDir(ManagementContext mgmt) {
+        return getMgmtBaseDir(mgmt.getConfig());
+    }
+    
+    /** @see BrooklynServerPaths#getMgmtBaseDir(ManagementContext) */
+    @SuppressWarnings("deprecation")
+    public static String getMgmtBaseDir(StringConfigMap brooklynProperties) {
+        String base = (String) brooklynProperties.getConfigRaw(BrooklynServerConfig.MGMT_BASE_DIR, true).orNull();
+        if (base==null) {
+            base = brooklynProperties.getConfig(BrooklynServerConfig.BROOKLYN_DATA_DIR);
+            if (base!=null)
+                log.warn("Using deprecated "+BrooklynServerConfig.BROOKLYN_DATA_DIR.getName()+": use "+BrooklynServerConfig.MGMT_BASE_DIR.getName()+" instead; value: "+base);
+        }
+        if (base==null) base = brooklynProperties.getConfig(BrooklynServerConfig.MGMT_BASE_DIR);
+        return Os.tidyPath(base)+File.separator;
+    }
+    /** @see BrooklynServerPaths#getMgmtBaseDir(ManagementContext) */
+    @SuppressWarnings("deprecation")
+    public static String getMgmtBaseDir(Map<String,?> brooklynProperties) {
+        String base = (String) brooklynProperties.get(BrooklynServerConfig.MGMT_BASE_DIR.getName());
+        if (base==null) base = (String) brooklynProperties.get(BrooklynServerConfig.BROOKLYN_DATA_DIR.getName());
+        if (base==null) base = BrooklynServerConfig.MGMT_BASE_DIR.getDefaultValue();
+        return Os.tidyPath(base)+File.separator;
+    }
+    
+    protected static String resolveAgainstBaseDir(StringConfigMap brooklynProperties, String path) {
+        if (!Os.isAbsolutish(path)) path = Os.mergePaths(getMgmtBaseDir(brooklynProperties), path);
+        return Os.tidyPath(path);
+    }
+
+    // ---------- persistence
+    
+    public static final String DEFAULT_PERSISTENCE_CONTAINER_NAME = "brooklyn-persisted-state";
+    /** on file system, the 'data' subdir is used so that there is an obvious place to put backup dirs */ 
+    public static final String DEFAULT_PERSISTENCE_DIR_FOR_FILESYSTEM = Os.mergePaths(DEFAULT_PERSISTENCE_CONTAINER_NAME, "data");
+
+    /** @see PersistencePathResolver */
+    public static PersistencePathResolver newMainPersistencePathResolver(StringConfigMap brooklynProperties) {
+        return new PersistencePathResolver(brooklynProperties);
+    }
+    /** @see PersistencePathResolver */
+    public static PersistencePathResolver newMainPersistencePathResolver(ManagementContext mgmt) {
+        return new PersistencePathResolver(mgmt.getConfig());
+    }
+    
+    /** @see PersistenceBackupPathResolver */
+    public static PersistenceBackupPathResolver newBackupPersistencePathResolver(ManagementContext mgmt) {
+        return new PersistenceBackupPathResolver(mgmt.getConfig());
+    }
+    
+    /**
+     * Utility for computing the path (dir or container name) to use for persistence.
+     * <p>
+     * Usage is to invoke {@link BrooklynServerPaths#newMainPersistencePathResolver(ManagementContext)}
+     * then to set {@link #location(String)} and {@link #dir(String)} as needed, and then to {@link #resolve()}.
+     */
+    public static class PersistencePathResolver {
+        protected final StringConfigMap brooklynProperties;
+        protected String locationSpec;
+        protected String dirOrContainer;
+        private PersistencePathResolver(StringConfigMap brooklynProperties) {
+            this.brooklynProperties = brooklynProperties;
+        }
+        /** 
+         * Optional location spec. If supplied, the {@link #resolve()} will return a container name suitable for use
+         * with the store, based on the {@link #dir(String)}; 
+         * if not supplied, or blank, or localhost this will cause resolution to give a full file system path, 
+         * if relative taken with respect to the {@link BrooklynServerPaths#getMgmtBaseDir(ManagementContext)}. 
+         * Config is <b>not</b> looked up for resolving a location spec. */
+        public PersistencePathResolver location(@Nullable String locationSpec) {
+            this.locationSpec = locationSpec;
+            return this;
+        }
+        /** 
+         * Optional directory (for localhost/filesystem) or container name. 
+         * If null or not supplied, config <b>is</b> looked up (because a value is always needed),
+         * followed by defaults for {@link BrooklynServerPaths#DEFAULT_PERSISTENCE_DIR_FOR_FILESYSTEM} and 
+         * {@link BrooklynServerPaths#DEFAULT_PERSISTENCE_CONTAINER_NAME} are used. */
+        public PersistencePathResolver dir(@Nullable String dirOrContainer) {
+            this.dirOrContainer = dirOrContainer;
+            return this;
+        }
+        
+        public String resolve() {
+            String path = dirOrContainer;
+            if (path==null) path = getDefaultPathFromConfig();
+            if (Strings.isBlank(locationSpec) || "localhost".equals(locationSpec)) {
+                // file system
+                if (Strings.isBlank(path)) path=getDefaultDirForAnyFilesystem();
+                return resolveAgainstBaseDir(brooklynProperties, path);
+            } else {
+                // obj store
+                if (path==null) path=getDefaultContainerForAnyNonFilesystem();
+                return path;
+            }
+        }
+        
+        protected String getDefaultPathFromConfig() {
+            return brooklynProperties.getConfig(BrooklynServerConfig.PERSISTENCE_DIR);
+        }
+        protected String getDefaultDirForAnyFilesystem() {
+            return DEFAULT_PERSISTENCE_DIR_FOR_FILESYSTEM;
+        }
+        protected String getDefaultContainerForAnyNonFilesystem() {
+            return DEFAULT_PERSISTENCE_CONTAINER_NAME;
+        }
+    }
+    
+    /**
+     * Similar to {@link PersistencePathResolver}, but designed for use for backup subpaths.
+     * If the container is not explicitly specified, "backups" is appended to the defaults from {@link PersistencePathResolver}.
+     * <p>
+     * It also includes conveniences for resolving further subpaths, cf {@link PersistenceBackupPathResolver#resolveWithSubpathFor(ManagementContextInternal, String)}.
+     */
+    public static class PersistenceBackupPathResolver extends PersistencePathResolver {
+        private String nonBackupLocationSpec;
+        private PersistenceBackupPathResolver(StringConfigMap brooklynProperties) {
+            super(brooklynProperties);
+        }
+        public PersistenceBackupPathResolver nonBackupLocation(@Nullable String locationSpec) {
+            this.nonBackupLocationSpec = locationSpec;
+            return this;
+        }
+        @Override
+        public PersistenceBackupPathResolver dir(String dirOrContainer) {
+            super.dir(dirOrContainer);
+            return this;
+        }
+        @Override
+        public PersistenceBackupPathResolver location(String backupLocationSpec) {
+            super.location(backupLocationSpec);
+            return this;
+        }
+        protected boolean isBackupSameLocation() {
+            return Objects.equal(locationSpec, nonBackupLocationSpec);
+        }
+        /** Appends a sub-path to the path returned by {@link #resolve()} */
+        public String resolveWithSubpath(String subpath) {
+            return Urls.mergePaths(super.resolve(), subpath);
+        }
+        /** Appends a standard format subpath sub-path to the path returned by {@link #resolve()}.
+         * <p>
+         * For example, this might write to:
+         * <code>~/.brooklyn/brooklyn-persisted-state/backups/2014-11-13-1201-n0deId-promotion-sA1t */
+        public String resolveWithSubpathFor(ManagementContext managementContext, String label) {
+            return resolveWithSubpath(Time.makeDateSimpleStampString()+"-"+managementContext.getManagementNodeId()+"-"+label+"-"+Identifiers.makeRandomId(4));
+        }
+        @Override
+        protected String getDefaultPathFromConfig() {
+            Maybe<Object> result = brooklynProperties.getConfigRaw(BrooklynServerConfig.PERSISTENCE_BACKUPS_DIR, true);
+            if (result.isPresent()) return Strings.toString(result.get());
+            if (isBackupSameLocation()) {
+                return backupContainerFor(brooklynProperties.getConfig(BrooklynServerConfig.PERSISTENCE_DIR));
+            }
+            return null;
+        }
+        protected String backupContainerFor(String nonBackupContainer) {
+            if (nonBackupContainer==null) return null;
+            return Urls.mergePaths(nonBackupContainer, "backups");
+        }
+        @Override
+        protected String getDefaultDirForAnyFilesystem() {
+            return backupContainerFor(DEFAULT_PERSISTENCE_CONTAINER_NAME);
+        }
+        @Override
+        protected String getDefaultContainerForAnyNonFilesystem() {
+            return backupContainerFor(super.getDefaultContainerForAnyNonFilesystem());
+        }
+    }
+    
+    // ------ web
+    
+    public static File getBrooklynWebTmpDir(ManagementContext mgmt) {
+        String brooklynMgmtBaseDir = getMgmtBaseDir(mgmt);
+        File webappTempDir = new File(Os.mergePaths(brooklynMgmtBaseDir, "planes", mgmt.getManagementPlaneId(), mgmt.getManagementNodeId(), "jetty"));
+        try {
+            FileUtils.forceMkdir(webappTempDir);
+            Os.deleteOnExitRecursivelyAndEmptyParentsUpTo(webappTempDir, new File(brooklynMgmtBaseDir)); 
+            return webappTempDir;
+        } catch (Exception e) {
+            Exceptions.propagateIfFatal(e);
+            IllegalStateException e2 = new IllegalStateException("Cannot create working directory "+webappTempDir+" for embedded jetty server: "+e, e);
+            log.warn(e2.getMessage()+" (rethrowing)");
+            throw e2;
+        }
+    }
+
+    public static File getOsgiCacheDir(ManagementContext mgmt) {
+        StringConfigMap brooklynProperties = mgmt.getConfig();
+        String cacheDir = brooklynProperties.getConfig(BrooklynServerConfig.OSGI_CACHE_DIR);
+        
+        // note dir should be different for each instance if starting multiple instances
+        // hence default including management node ID
+        
+        cacheDir = TemplateProcessor.processTemplateContents(cacheDir, (ManagementContextInternal)mgmt, 
+            MutableMap.of(BrooklynServerConfig.MGMT_BASE_DIR.getName(), getMgmtBaseDir(mgmt),
+                BrooklynServerConfig.MANAGEMENT_NODE_ID_PROPERTY, mgmt.getManagementNodeId(),
+                Os.TmpDirFinder.BROOKLYN_OS_TMPDIR_PROPERTY, Os.tmp()));
+        cacheDir = resolveAgainstBaseDir(mgmt.getConfig(), cacheDir);
+        
+        return new File(cacheDir);
+    }
+
+    public static boolean isOsgiCacheForCleaning(ManagementContext mgmt, File cacheDir) {
+        StringConfigMap brooklynProperties = mgmt.getConfig();
+        Boolean clean = brooklynProperties.getConfig(BrooklynServerConfig.OSGI_CACHE_CLEAN);
+        if (clean==null) {
+            // as per javadoc on key, clean defaults to iff it is a node-id-specific directory
+            clean = cacheDir.getName().contains(mgmt.getManagementNodeId());
+        }
+        return clean;
+    }
+    
+    public static File getOsgiCacheDirCleanedIfNeeded(ManagementContext mgmt) {
+        File cacheDirF = getOsgiCacheDir(mgmt);
+        boolean clean = isOsgiCacheForCleaning(mgmt, cacheDirF);
+        log.debug("OSGi cache dir computed as "+cacheDirF.getName()+" ("+
+            (cacheDirF.exists() ? "already exists" : "does not exist")+", "+
+            (clean ? "cleaning now (and on exit)" : "cleaning not requested"));
+
+        if (clean) {
+            Os.deleteRecursively(cacheDirF);
+            Os.deleteOnExitRecursively(cacheDirF);
+        }
+        
+        return cacheDirF;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/config/BrooklynServiceAttributes.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/config/BrooklynServiceAttributes.java b/core/src/main/java/org/apache/brooklyn/core/config/BrooklynServiceAttributes.java
new file mode 100644
index 0000000..9920efc
--- /dev/null
+++ b/core/src/main/java/org/apache/brooklyn/core/config/BrooklynServiceAttributes.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.core.config;
+
+import org.apache.brooklyn.api.management.ManagementContext;
+import org.apache.brooklyn.util.internal.StringSystemProperty;
+
+/** attributes which callers can set and a service application
+ * (such as servlet or osgi) will pay attention to,
+ * contained in one place for convenience
+ * 
+ * @author alex
+ */
+public class BrooklynServiceAttributes {
+
+    /*
+     * These fields are contained here so that they are visible both to web console
+     * and to launcher, without needing a separate web-console-support project,
+     * or battling maven etc to build web-console as jar available to launcher
+     * (which would contain a lot of crap as well).
+     */
+    
+    /** used to hold the instance of ManagementContext which should be used */
+    public static final String BROOKLYN_MANAGEMENT_CONTEXT = ManagementContext.class.getName();
+    
+    /** poor-man's security, to specify a user to be automatically logged in
+     * (e.g. to bypass security, during dev/test); 'admin' is usually a sensible choice.
+     * if not specified (the default) username+password is required. 
+     * @deprecated since 0.6.0; not used; you can now configure security properly instead!
+     * (though this may be useful again when we have users and permissions,
+     * to indicate the user who should be logged in by default...) */ @Deprecated
+    public static final String BROOKLYN_AUTOLOGIN_USERNAME = "brooklyn.autologin.username";
+    
+    /** poor-man's security, to specify a default password for access 
+     * @deprecated since 0.6.0; not used; you can now configure security properly instead! */ @Deprecated
+    public static final String BROOKLYN_DEFAULT_PASSWORD = "brooklyn.default.password";
+
+    // TODO use ConfigKey (or possibly BrooklynSystemProperties ?)
+    
+    /** in some cases localhost does not resolve correctly 
+     * (e.g. to an interface which is defined locally but not in operation,
+     * or where multiple NICs are available and java's InetAddress.getLocalHost() strategy is not doing what is desired);
+     * use this to supply a specific address (e.g. "127.0.0.1" or a specific IP on a specific NIC or FW)
+     */
+    public static StringSystemProperty LOCALHOST_IP_ADDRESS = new StringSystemProperty("brooklyn.location.localhost.address");
+
+    /** Jackson ObjectMapper shared among REST resources */ 
+    public static final String BROOKLYN_REST_OBJECT_MAPPER = "brooklyn.rest.objectMapper";
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/config/ConfigPredicates.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/config/ConfigPredicates.java b/core/src/main/java/org/apache/brooklyn/core/config/ConfigPredicates.java
new file mode 100644
index 0000000..de6f3c8
--- /dev/null
+++ b/core/src/main/java/org/apache/brooklyn/core/config/ConfigPredicates.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.core.config;
+
+import java.util.regex.Pattern;
+
+import javax.annotation.Nullable;
+
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.util.text.WildcardGlobs;
+
+import com.google.common.base.Predicate;
+
+public class ConfigPredicates {
+
+    public static Predicate<ConfigKey<?>> startingWith(final String prefix) {
+        return new Predicate<ConfigKey<?>>() {
+            @Override
+            public boolean apply(@Nullable ConfigKey<?> input) {
+                return (input != null) && input.getName().startsWith(prefix);
+            }
+        };
+    }
+
+    public static Predicate<ConfigKey<?>> matchingGlob(final String glob) {
+        return new Predicate<ConfigKey<?>>() {
+            @Override
+            public boolean apply(@Nullable ConfigKey<?> input) {
+                return (input != null) && WildcardGlobs.isGlobMatched(glob, input.getName());
+            }
+        };
+    }
+
+    public static Predicate<ConfigKey<?>> matchingRegex(final String regex) {
+        final Pattern p = Pattern.compile(regex);
+        return new Predicate<ConfigKey<?>>() {
+            @Override
+            public boolean apply(@Nullable ConfigKey<?> input) {
+                return (input != null) && p.matcher(input.getName()).matches();
+            }
+        };
+    }
+
+    public static Predicate<ConfigKey<?>> nameMatching(final Predicate<String> filter) {
+        return new Predicate<ConfigKey<?>>() {
+            @Override
+            public boolean apply(@Nullable ConfigKey<?> input) {
+                return (input != null) && filter.apply(input.getName());
+            }
+        };
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/config/ConfigUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/config/ConfigUtils.java b/core/src/main/java/org/apache/brooklyn/core/config/ConfigUtils.java
new file mode 100644
index 0000000..8b68155
--- /dev/null
+++ b/core/src/main/java/org/apache/brooklyn/core/config/ConfigUtils.java
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.core.config;
+
+import java.io.File;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.config.ConfigKey.HasConfigKey;
+import org.apache.brooklyn.core.config.BrooklynProperties;
+import org.apache.brooklyn.core.config.ConfigUtils;
+import org.apache.brooklyn.core.config.WrappedConfigKey;
+import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import brooklyn.entity.basic.ConfigKeys;
+import brooklyn.event.basic.BasicConfigKey;
+
+import com.google.common.base.Predicate;
+
+@SuppressWarnings({"unchecked"})
+public class ConfigUtils {
+
+    private static final Logger log = LoggerFactory.getLogger(ConfigUtils.class);
+    
+    public static <T> T getRequiredConfig(Entity entity, ConfigKey<T> key) {
+        T result = entity.getConfig(key);
+        if (result==null) throw new IllegalStateException("Configuration "+key+" is required");
+        return result;
+    }
+    
+    /** prepends the given prefix to the key.  prefix will typically end with a ".".
+     * this is useful for configuration purposes when a subsystem uses a short-name config (e.g. "user")
+     * but in entity config or at the root (brooklyn.properties) there are longer names (e.g. "brooklyn.ssh.config.user"),
+     * and we wish to convert from the shorter names to the longer names. */
+    public static <T> ConfigKey<T> prefixedKey(String prefix, ConfigKey<T> key) {
+        return ConfigKeys.newConfigKeyWithPrefix(prefix, key);
+    }
+    
+    /** removes the given prefix from the key for configuration purposes; logs warning and does nothing if there is no such prefix.
+     * prefix will typically end with a ".".
+     * this is useful for configuration purposes when a subsystem uses a short-name config (e.g. "user")
+     * but in entity config or at the root (brooklyn.properties) there are longer names (e.g. "brooklyn.ssh.config.user"),
+     * and we wish to convert from the longer names to the short-name. */
+    public static <T> ConfigKey<T> unprefixedKey(String prefix, ConfigKey<T> key) {
+        String newName = key.getName();
+        if (newName.startsWith(prefix)) newName = newName.substring(prefix.length());
+        else log.warn("Cannot remove prefix "+prefix+" from key "+key+" (ignoring)");
+        return new BasicConfigKey<T>(key.getTypeToken(), newName, key.getDescription(), key.getDefaultValue());
+    }
+    
+    
+    public static BrooklynProperties loadFromFile(String file) {
+        BrooklynProperties result = BrooklynProperties.Factory.newEmpty();
+        if (file!=null) result.addFrom(new File(file));
+        return result;
+    }
+    
+    public static BrooklynProperties filterFor(BrooklynProperties properties, Predicate<? super String> filter) {
+        BrooklynProperties result = BrooklynProperties.Factory.newEmpty();
+        for (String k: (Collection<String>)properties.keySet()) {
+            if (filter.apply(k)) {
+                result.put(k, properties.get(k));
+            }
+        }
+        return result;
+    }
+    
+    public static BrooklynProperties filterForPrefix(BrooklynProperties properties, String prefix) {
+        BrooklynProperties result = BrooklynProperties.Factory.newEmpty();
+        for (String k: (Collection<String>)properties.keySet()) {
+            if (k.startsWith(prefix)) {
+                result.put(k, properties.get(k));
+            }
+        }
+        return result;
+    }
+    
+    /** prefix generally ends with a full stop */
+    public static BrooklynProperties filterForPrefixAndStrip(Map<String,?> properties, String prefix) {
+        BrooklynProperties result = BrooklynProperties.Factory.newEmpty();
+        for (String k: properties.keySet()) {
+            if (k.startsWith(prefix)) {
+                result.put(k.substring(prefix.length()), properties.get(k));
+            }
+        }
+        return result;
+    }
+
+    @SuppressWarnings("rawtypes")
+    public static Set<HasConfigKey<?>> getStaticKeysOnClass(Class<?> type) {
+        Set<HasConfigKey<?>> result = new LinkedHashSet<ConfigKey.HasConfigKey<?>>();
+        for (Field f: type.getFields()) {
+            try {
+                if ((f.getModifiers() & Modifier.STATIC)==0)
+                    continue;
+                if (ConfigKey.class.isAssignableFrom(f.getType()))
+                    result.add(new WrappedConfigKey((ConfigKey<?>) f.get(null)));
+                else if (HasConfigKey.class.isAssignableFrom(f.getType()))
+                    result.add((HasConfigKey<?>) f.get(null));
+            } catch (Exception e) {
+                log.error("Error retrieving config key for field "+f+" on class "+type+"; rethrowing", e);
+                throw Exceptions.propagate(e);
+            }
+        }
+        return Collections.unmodifiableSet(result);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/config/WrappedConfigKey.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/config/WrappedConfigKey.java b/core/src/main/java/org/apache/brooklyn/core/config/WrappedConfigKey.java
new file mode 100644
index 0000000..0f09ccd
--- /dev/null
+++ b/core/src/main/java/org/apache/brooklyn/core/config/WrappedConfigKey.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.core.config;
+
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.config.ConfigKey.HasConfigKey;
+
+import com.google.common.base.Preconditions;
+
+public class WrappedConfigKey<T> implements HasConfigKey<T> {
+
+    private final ConfigKey<T> key;
+    
+    public WrappedConfigKey(ConfigKey<T> key) {
+        this.key = Preconditions.checkNotNull(key);
+    }
+
+    @Override
+    public ConfigKey<T> getConfigKey() {
+        return key;
+    }
+
+    @Override
+    public String toString() {
+        return key.toString()+"(wrapped)";
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/config/internal/AbstractConfigMapImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/config/internal/AbstractConfigMapImpl.java b/core/src/main/java/org/apache/brooklyn/core/config/internal/AbstractConfigMapImpl.java
new file mode 100644
index 0000000..45da5df
--- /dev/null
+++ b/core/src/main/java/org/apache/brooklyn/core/config/internal/AbstractConfigMapImpl.java
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.core.config.internal;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.concurrent.Future;
+
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.config.ConfigMap;
+import org.apache.brooklyn.config.ConfigKey.HasConfigKey;
+import org.apache.brooklyn.core.util.flags.TypeCoercions;
+import org.apache.brooklyn.core.util.task.DeferredSupplier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import brooklyn.entity.basic.ConfigMapViewWithStringKeys;
+import brooklyn.event.basic.StructuredConfigKey;
+
+public abstract class AbstractConfigMapImpl implements ConfigMap {
+
+    private static final Logger LOG = LoggerFactory.getLogger(AbstractConfigMapImpl.class);
+    
+    protected final ConfigMapViewWithStringKeys mapViewWithStringKeys = new ConfigMapViewWithStringKeys(this);
+    
+    /**
+     * Map of configuration information that is defined at start-up time for the entity. These
+     * configuration parameters are shared and made accessible to the "children" of this
+     * entity.
+     */
+    protected Map<ConfigKey<?>,Object> ownConfig = Collections.synchronizedMap(new LinkedHashMap<ConfigKey<?>, Object>());
+
+    public <T> T getConfig(ConfigKey<T> key) {
+        return getConfig(key, null);
+    }
+    
+    public <T> T getConfig(HasConfigKey<T> key) {
+        return getConfig(key.getConfigKey(), null);
+    }
+    
+    public <T> T getConfig(HasConfigKey<T> key, T defaultValue) {
+        return getConfig(key.getConfigKey(), defaultValue);
+    }
+    
+    @Override @Deprecated
+    public Object getRawConfig(ConfigKey<?> key) {
+        return getConfigRaw(key, true).orNull();
+    }
+    
+    protected Object coerceConfigVal(ConfigKey<?> key, Object v) {
+        Object val;
+        if ((v instanceof Future) || (v instanceof DeferredSupplier)) {
+            // no coercion for these (coerce on exit)
+            val = v;
+        } else if (key instanceof StructuredConfigKey) {
+            // no coercion for these structures (they decide what to do)
+            val = v;
+        } else if ((v instanceof Map || v instanceof Iterable) && key.getType().isInstance(v)) {
+            // don't do coercion on put for these, if the key type is compatible, 
+            // because that will force resolution deeply
+            val = v;
+        } else {
+            try {
+                // try to coerce on input, to detect errors sooner
+                val = TypeCoercions.coerce(v, key.getTypeToken());
+            } catch (Exception e) {
+                throw new IllegalArgumentException("Cannot coerce or set "+v+" to "+key, e);
+                // if can't coerce, we could just log as below and *throw* the error when we retrieve the config
+                // but for now, fail fast (above), because we haven't encountered strong use cases
+                // where we want to do coercion on retrieval, except for the exceptions above
+//                Exceptions.propagateIfFatal(e);
+//                LOG.warn("Cannot coerce or set "+v+" to "+key+" (ignoring): "+e, e);
+//                val = v;
+            }
+        }
+        return val;
+    }
+
+    
+    @Override
+    public Map<String,Object> asMapWithStringKeys() {
+        return mapViewWithStringKeys;
+    }
+
+    @Override
+    public int size() {
+        return ownConfig.size();
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return ownConfig.isEmpty();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/config/render/RendererHints.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/config/render/RendererHints.java b/core/src/main/java/org/apache/brooklyn/core/config/render/RendererHints.java
new file mode 100644
index 0000000..fd5ba83
--- /dev/null
+++ b/core/src/main/java/org/apache/brooklyn/core/config/render/RendererHints.java
@@ -0,0 +1,284 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.core.config.render;
+
+import groovy.lang.Closure;
+
+import java.util.Set;
+
+import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.api.event.AttributeSensor;
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.render.RendererHints;
+import org.apache.brooklyn.util.GroovyJavaMethods;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.annotations.Beta;
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Function;
+import com.google.common.base.Functions;
+import com.google.common.base.Objects;
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Predicates;
+import com.google.common.base.Strings;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.LinkedHashMultimap;
+import com.google.common.collect.Multimaps;
+import com.google.common.collect.SetMultimap;
+import com.google.common.collect.Sets;
+
+/**
+ * Registry of hints for displaying items such as sensors, e.g. in the web console.
+ */
+public class RendererHints {
+
+    private static final Logger log = LoggerFactory.getLogger(RendererHints.class);
+    
+    private static SetMultimap<Object, Hint<?>> registry = Multimaps.synchronizedSetMultimap(LinkedHashMultimap.<Object, Hint<?>>create());
+
+    @VisibleForTesting
+    public static SetMultimap<Object, Hint<?>> getRegistry() { return registry; }
+    
+    /**
+     * Registers a {@link Hint} against the given element.
+     * <p>
+     * Returns the element, for convenience when used in a with block after defining the element.
+     */
+    public static <T> AttributeSensor<T> register(AttributeSensor<T> element, Hint<? super T> hintForThatElement) { return _register(element, hintForThatElement); }
+    /** as {@link #register(AttributeSensor, Hint)} */
+    public static <T> ConfigKey<T> register(ConfigKey<T> element, Hint<? super T> hintForThatElement) { return _register(element, hintForThatElement); }
+    /** as {@link #register(AttributeSensor, Hint)} */
+    public static <T> Class<T> register(Class<T> element, Hint<? super T> hintForThatElement) { return _register(element, hintForThatElement); }
+    
+    private static <T> T _register(T element, Hint<?> hintForThatElement) {
+        if (element==null) {
+            // can happen if being done in a static initializer in an inner class
+            log.error("Invalid null target for renderer hint "+hintForThatElement, new Throwable("Trace for invalid null target for renderer hint"));
+        }
+        registry.put(element, hintForThatElement);
+        return element;
+    }
+
+    /** Returns all registered hints against the given element */
+    public static Set<Hint<?>> getHintsFor(AttributeSensor<?> element) { return _getHintsFor(element, null); }
+    /** as {@link #getHintsFor(AttributeSensor)} */
+    public static Set<Hint<?>> getHintsFor(ConfigKey<?> element) { return _getHintsFor(element, null); }
+    /** as {@link #getHintsFor(AttributeSensor)} */
+    public static Set<Hint<?>> getHintsFor(Class<?> element) { return _getHintsFor(element, null); }
+
+    @Deprecated /** @deprecated since 0.7.0 only supported for certain types */
+    public static Set<Hint<?>> getHintsFor(Object element) { return getHintsFor(element, null); }
+
+    @Deprecated /** @deprecated since 0.7.0 only supported for certain types */
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+    public static Set<Hint<?>> getHintsFor(Object element, Class<? extends Hint> optionalHintSuperClass) { return (Set<Hint<?>>) _getHintsFor(element, optionalHintSuperClass); }
+    
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+    private static <T extends Hint> Set<T> _getHintsFor(Object element, Class<T> optionalHintSuperClass) {
+        Set<Hint<?>> found = ImmutableSet.copyOf(registry.get(element));
+        if (found.isEmpty() && element instanceof Class && !Object.class.equals(element)) {
+            // try superclasses of the element; this seems overkill for the main use case, Entity;
+            // (other classes registered are typically final)
+            found = (Set<Hint<?>>) _getHintsFor(((Class)element).getSuperclass(), optionalHintSuperClass);
+            if (found.isEmpty()) {
+                for (Class<?> parentInterface: ((Class)element).getInterfaces()) {
+                    found = (Set<Hint<?>>) _getHintsFor(parentInterface, optionalHintSuperClass);
+                    if (!found.isEmpty())
+                        break;
+                }
+            }
+        }
+        if (optionalHintSuperClass != null) {
+            return (Set<T>)Sets.filter(found, Predicates.instanceOf(optionalHintSuperClass));
+        } else {
+            return (Set<T>)found;
+        }
+    }
+
+    /** Applies the (first) display value hint registered against the given target to the given initialValue */  
+    public static Object applyDisplayValueHint(AttributeSensor<?> target, Object initialValue) { return applyDisplayValueHintUnchecked(target, initialValue); }
+    /** as {@link #applyDisplayValueHint(AttributeSensor, Object)} */
+    public static Object applyDisplayValueHint(ConfigKey<?> target, Object initialValue) { return applyDisplayValueHintUnchecked(target, initialValue); }
+    /** as {@link #applyDisplayValueHint(AttributeSensor, Object)} */
+    public static Object applyDisplayValueHint(Class<?> target, Object initialValue) { return applyDisplayValueHintUnchecked(target, initialValue); }
+    
+    /** as {@link #applyDisplayValueHint(AttributeSensor, Object)}, but without type checking; public for those few cases where we may have lost the type */
+    @Beta
+    public static Object applyDisplayValueHintUnchecked(Object target, Object initialValue) { return _applyDisplayValueHint(target, initialValue, true); }
+    @SuppressWarnings("rawtypes")
+    private static Object _applyDisplayValueHint(Object target, Object initialValue, boolean includeClass) {
+        Iterable<RendererHints.DisplayValue> hints = RendererHints._getHintsFor(target, RendererHints.DisplayValue.class);
+        if (Iterables.size(hints) > 1) {
+            log.warn("Multiple display value hints set for {}; Only one will be applied, using first", target);
+        }
+
+        Optional<RendererHints.DisplayValue> hint = Optional.fromNullable(Iterables.getFirst(hints, null));
+        Object value = hint.isPresent() ? hint.get().getDisplayValue(initialValue) : initialValue;
+        if (includeClass && value!=null && !(value instanceof String) && !(value instanceof Number) && !(value.getClass().isPrimitive())) {
+            value = _applyDisplayValueHint(value.getClass(), value, false);
+        }
+        return value;
+    }
+
+
+    /** Parent marker class for hints. */
+    public static abstract class Hint<T> { }
+
+    public static interface NamedAction {
+        String getActionName();
+    }
+    
+    /**
+     * This hint describes a named action possible on something, e.g. a sensor;
+     * currently used in web client to show actions on sensors
+     */
+    public static class NamedActionWithUrl<T> extends Hint<T> implements NamedAction {
+        private final String actionName;
+        private final Function<T, String> postProcessing;
+
+        public NamedActionWithUrl(String actionName) {
+            this(actionName, (Function<T, String>)null);
+        }
+
+        @SuppressWarnings("unchecked") @Deprecated /** @deprecated since 0.7.0 use Function */
+        public NamedActionWithUrl(String actionName, Closure<String> postProcessing) {
+            this.actionName = actionName;
+            this.postProcessing = (Function<T, String>) ((postProcessing == null) ? null : GroovyJavaMethods.functionFromClosure(postProcessing));
+        }
+
+        public NamedActionWithUrl(String actionName, Function<T, String> postProcessing) {
+            this.actionName = actionName;
+            this.postProcessing = postProcessing;
+        }
+
+        /** @deprecated since 0.7.0 call {@link #getUrlFromValue(Object)}, parsing the sensor value yourself */ @Deprecated
+        public String getUrl(Entity e, AttributeSensor<T> s) {
+            return getUrlFromValue(e.getAttribute(s));
+        }
+
+        public String getActionName() {
+            return actionName;
+        }
+
+        /** this is the method invoked by web console SensorSummary, at the moment */
+        public String getUrlFromValue(T v) {
+            String v2;
+            if (postProcessing != null) {
+                v2 = postProcessing.apply(v);
+            } else {
+                v2 = (v==null ? null : v.toString());
+            }
+            if (v2 == null) return v2;
+            return v2.toString();
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hashCode(actionName, postProcessing);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (!(obj instanceof NamedActionWithUrl)) return false;
+            NamedActionWithUrl<?> o = (NamedActionWithUrl<?>) obj;
+            return Objects.equal(actionName, o.actionName) && Objects.equal(postProcessing, o.postProcessing);
+        }
+    }
+
+    /**
+     * This hint describes a transformation used to generate a display value for config keys and sensors.
+     * <p>
+     * <em><strong>Warning</strong> This is currently a {@link Beta} implementation, and
+     * may be changed or removed if there is a suitable alternative mechanism to achieve
+     * this functionality.</em>
+     */
+    @Beta
+    public static class DisplayValue<T> extends Hint<T> {
+        private final Function<Object, String> transform;
+
+        @SuppressWarnings("unchecked")
+        protected DisplayValue(Function<?, String> transform) {
+            this.transform = (Function<Object, String>) Preconditions.checkNotNull(transform, "transform");
+        }
+
+        public String getDisplayValue(Object v) {
+            String dv = transform.apply(v);
+            return Strings.nullToEmpty(dv);
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hashCode(transform);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (obj == null || !(obj instanceof DisplayValue)) return false;
+            return Objects.equal(transform, ((DisplayValue<?>)obj).transform);
+        }
+    }
+
+    @Beta
+    public static <T> DisplayValue<T> displayValue(Function<T,String> transform) {
+        return new DisplayValue<T>(transform);
+    }
+
+    @Beta
+    public static <T> NamedActionWithUrl<T> namedActionWithUrl(String actionName, Function<T,String> transform) {
+        return new NamedActionWithUrl<T>(actionName, transform);
+    }
+
+    @Beta
+    public static <T> NamedActionWithUrl<T> namedActionWithUrl(String actionName) {
+        return new NamedActionWithUrl<T>(actionName);
+    }
+
+    @Beta
+    public static <T> NamedActionWithUrl<T> namedActionWithUrl(Function<T,String> transform) {
+        return openWithUrl(transform);
+    }
+
+    @Beta
+    public static <T> NamedActionWithUrl<T> namedActionWithUrl() {
+        return openWithUrl();
+    }
+
+    @Beta
+    public static <T> NamedActionWithUrl<T> openWithUrl() {
+        return openWithUrl((Function<T,String>) null);
+    }
+
+    @Beta
+    public static <T> NamedActionWithUrl<T> openWithUrl(Function<T,String> transform) {
+        return new NamedActionWithUrl<T>("Open", transform);
+    }
+
+    /**
+     * Forces the given sensor or config key's value to be censored. It will be
+     * presented as <code>********</code>.
+     */
+    @Beta
+    public static <T> DisplayValue<T> censoredValue() {
+        return new DisplayValue<T>(Functions.constant("********"));
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/internal/BrooklynFeatureEnablement.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/internal/BrooklynFeatureEnablement.java b/core/src/main/java/org/apache/brooklyn/core/internal/BrooklynFeatureEnablement.java
index 047e3a8..a4813dd 100644
--- a/core/src/main/java/org/apache/brooklyn/core/internal/BrooklynFeatureEnablement.java
+++ b/core/src/main/java/org/apache/brooklyn/core/internal/BrooklynFeatureEnablement.java
@@ -21,13 +21,12 @@ package org.apache.brooklyn.core.internal;
 import java.util.Map;
 
 import org.apache.brooklyn.api.management.ha.HighAvailabilityMode;
+import org.apache.brooklyn.core.config.BrooklynProperties;
 import org.apache.brooklyn.core.internal.storage.BrooklynStorage;
 import org.apache.brooklyn.core.util.internal.ssh.ShellTool;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import brooklyn.config.BrooklynProperties;
-
 import com.google.common.annotations.Beta;
 import com.google.common.collect.Maps;
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/management/entitlement/Entitlements.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/management/entitlement/Entitlements.java b/core/src/main/java/org/apache/brooklyn/core/management/entitlement/Entitlements.java
index 24a9f5e..9fe0d4e 100644
--- a/core/src/main/java/org/apache/brooklyn/core/management/entitlement/Entitlements.java
+++ b/core/src/main/java/org/apache/brooklyn/core/management/entitlement/Entitlements.java
@@ -30,6 +30,7 @@ import org.apache.brooklyn.api.management.entitlement.EntitlementClass;
 import org.apache.brooklyn.api.management.entitlement.EntitlementContext;
 import org.apache.brooklyn.api.management.entitlement.EntitlementManager;
 import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.BrooklynProperties;
 import org.apache.brooklyn.core.management.internal.ManagementContextInternal;
 import org.apache.brooklyn.core.util.task.Tasks;
 import org.apache.brooklyn.util.exceptions.Exceptions;
@@ -47,7 +48,6 @@ import com.google.common.base.Predicates;
 import com.google.common.collect.ImmutableList;
 import com.google.common.reflect.TypeToken;
 
-import brooklyn.config.BrooklynProperties;
 import brooklyn.entity.basic.BrooklynTaskTags;
 import brooklyn.entity.basic.ConfigKeys;
 import brooklyn.entity.basic.Entities;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/management/entitlement/PerUserEntitlementManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/management/entitlement/PerUserEntitlementManager.java b/core/src/main/java/org/apache/brooklyn/core/management/entitlement/PerUserEntitlementManager.java
index 923479b..be8b734 100644
--- a/core/src/main/java/org/apache/brooklyn/core/management/entitlement/PerUserEntitlementManager.java
+++ b/core/src/main/java/org/apache/brooklyn/core/management/entitlement/PerUserEntitlementManager.java
@@ -24,13 +24,13 @@ import org.apache.brooklyn.api.management.entitlement.EntitlementClass;
 import org.apache.brooklyn.api.management.entitlement.EntitlementContext;
 import org.apache.brooklyn.api.management.entitlement.EntitlementManager;
 import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.BrooklynProperties;
+import org.apache.brooklyn.core.config.ConfigPredicates;
 import org.apache.brooklyn.util.collections.MutableMap;
 import org.apache.brooklyn.util.text.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import brooklyn.config.BrooklynProperties;
-import brooklyn.config.ConfigPredicates;
 import brooklyn.entity.basic.ConfigKeys;
 
 import com.google.common.base.Preconditions;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/management/ha/HighAvailabilityManagerImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/management/ha/HighAvailabilityManagerImpl.java b/core/src/main/java/org/apache/brooklyn/core/management/ha/HighAvailabilityManagerImpl.java
index 1a3a21c..f29225f 100644
--- a/core/src/main/java/org/apache/brooklyn/core/management/ha/HighAvailabilityManagerImpl.java
+++ b/core/src/main/java/org/apache/brooklyn/core/management/ha/HighAvailabilityManagerImpl.java
@@ -45,6 +45,7 @@ import org.apache.brooklyn.api.management.ha.ManagementPlaneSyncRecordPersister.
 import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.core.catalog.internal.BasicBrooklynCatalog;
 import org.apache.brooklyn.core.catalog.internal.CatalogDto;
+import org.apache.brooklyn.core.config.BrooklynServerConfig;
 import org.apache.brooklyn.core.internal.BrooklynFeatureEnablement;
 import org.apache.brooklyn.core.management.ha.BasicMasterChooser.AlphabeticMasterChooser;
 import org.apache.brooklyn.core.management.internal.BrooklynObjectManagementMode;
@@ -65,7 +66,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import brooklyn.BrooklynVersion;
-import brooklyn.config.BrooklynServerConfig;
 import brooklyn.entity.basic.BrooklynTaskTags;
 import brooklyn.entity.basic.ConfigKeys;
 import brooklyn.entity.basic.EntityInternal;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/management/ha/OsgiManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/management/ha/OsgiManager.java b/core/src/main/java/org/apache/brooklyn/core/management/ha/OsgiManager.java
index 4d52960..080246e 100644
--- a/core/src/main/java/org/apache/brooklyn/core/management/ha/OsgiManager.java
+++ b/core/src/main/java/org/apache/brooklyn/core/management/ha/OsgiManager.java
@@ -40,6 +40,8 @@ import brooklyn.BrooklynVersion;
 import org.apache.brooklyn.api.catalog.CatalogItem.CatalogBundle;
 import org.apache.brooklyn.api.management.ManagementContext;
 import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.BrooklynServerConfig;
+import org.apache.brooklyn.core.config.BrooklynServerPaths;
 import org.apache.brooklyn.core.util.osgi.Osgis;
 import org.apache.brooklyn.core.util.osgi.Osgis.BundleFinder;
 import org.apache.brooklyn.util.collections.MutableMap;
@@ -52,9 +54,6 @@ import org.apache.brooklyn.util.repeat.Repeater;
 import org.apache.brooklyn.util.text.Strings;
 import org.apache.brooklyn.util.time.Duration;
 
-import brooklyn.config.BrooklynServerConfig;
-import brooklyn.config.BrooklynServerPaths;
-
 import com.google.common.base.Throwables;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/management/internal/AbstractManagementContext.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/management/internal/AbstractManagementContext.java b/core/src/main/java/org/apache/brooklyn/core/management/internal/AbstractManagementContext.java
index 7765b9a..ae158fa 100644
--- a/core/src/main/java/org/apache/brooklyn/core/management/internal/AbstractManagementContext.java
+++ b/core/src/main/java/org/apache/brooklyn/core/management/internal/AbstractManagementContext.java
@@ -54,6 +54,7 @@ import org.apache.brooklyn.config.StringConfigMap;
 import org.apache.brooklyn.core.catalog.internal.BasicBrooklynCatalog;
 import org.apache.brooklyn.core.catalog.internal.CatalogInitialization;
 import org.apache.brooklyn.core.catalog.internal.CatalogUtils;
+import org.apache.brooklyn.core.config.BrooklynProperties;
 import org.apache.brooklyn.core.internal.storage.BrooklynStorage;
 import org.apache.brooklyn.core.internal.storage.DataGrid;
 import org.apache.brooklyn.core.internal.storage.DataGridFactory;
@@ -67,7 +68,6 @@ import org.apache.brooklyn.core.util.config.ConfigBag;
 import org.apache.brooklyn.core.util.task.BasicExecutionContext;
 import org.apache.brooklyn.core.util.task.Tasks;
 
-import brooklyn.config.BrooklynProperties;
 import brooklyn.entity.basic.AbstractEntity;
 import brooklyn.entity.basic.BrooklynTaskTags;
 import brooklyn.entity.basic.EntityInternal;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/management/internal/BrooklynGarbageCollector.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/management/internal/BrooklynGarbageCollector.java b/core/src/main/java/org/apache/brooklyn/core/management/internal/BrooklynGarbageCollector.java
index a336845..4525278 100644
--- a/core/src/main/java/org/apache/brooklyn/core/management/internal/BrooklynGarbageCollector.java
+++ b/core/src/main/java/org/apache/brooklyn/core/management/internal/BrooklynGarbageCollector.java
@@ -40,6 +40,7 @@ import org.apache.brooklyn.api.location.Location;
 import org.apache.brooklyn.api.management.HasTaskChildren;
 import org.apache.brooklyn.api.management.Task;
 import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.BrooklynProperties;
 import org.apache.brooklyn.core.internal.storage.BrooklynStorage;
 import org.apache.brooklyn.core.util.task.BasicExecutionManager;
 import org.apache.brooklyn.core.util.task.ExecutionListener;
@@ -54,7 +55,6 @@ import org.apache.brooklyn.util.time.Duration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import brooklyn.config.BrooklynProperties;
 import brooklyn.entity.basic.BrooklynTaskTags;
 import brooklyn.entity.basic.BrooklynTaskTags.WrappedEntity;
 import brooklyn.entity.basic.BrooklynTaskTags.WrappedStream;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/management/internal/EntityManagementUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/management/internal/EntityManagementUtils.java b/core/src/main/java/org/apache/brooklyn/core/management/internal/EntityManagementUtils.java
index d75fa19..b07bbac 100644
--- a/core/src/main/java/org/apache/brooklyn/core/management/internal/EntityManagementUtils.java
+++ b/core/src/main/java/org/apache/brooklyn/core/management/internal/EntityManagementUtils.java
@@ -37,6 +37,7 @@ import org.apache.brooklyn.camp.spi.Assembly;
 import org.apache.brooklyn.camp.spi.AssemblyTemplate;
 import org.apache.brooklyn.camp.spi.instantiate.AssemblyTemplateInstantiator;
 import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.BrooklynServerConfig;
 import org.apache.brooklyn.core.management.classloading.JavaBrooklynClassLoadingContext;
 import org.apache.brooklyn.core.util.task.TaskBuilder;
 import org.apache.brooklyn.core.util.task.Tasks;
@@ -50,7 +51,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import brooklyn.camp.brooklyn.api.AssemblyTemplateSpecInstantiator;
-import brooklyn.config.BrooklynServerConfig;
 import brooklyn.entity.basic.BrooklynTaskTags;
 import brooklyn.entity.basic.ConfigKeys;
 import brooklyn.entity.basic.Entities;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/management/internal/LocalEntityManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/management/internal/LocalEntityManager.java b/core/src/main/java/org/apache/brooklyn/core/management/internal/LocalEntityManager.java
index 772d513..4da8c66 100644
--- a/core/src/main/java/org/apache/brooklyn/core/management/internal/LocalEntityManager.java
+++ b/core/src/main/java/org/apache/brooklyn/core/management/internal/LocalEntityManager.java
@@ -43,6 +43,7 @@ import org.apache.brooklyn.api.policy.Enricher;
 import org.apache.brooklyn.api.policy.EnricherSpec;
 import org.apache.brooklyn.api.policy.Policy;
 import org.apache.brooklyn.api.policy.PolicySpec;
+import org.apache.brooklyn.core.config.BrooklynLogging;
 import org.apache.brooklyn.core.internal.storage.BrooklynStorage;
 import org.apache.brooklyn.core.util.task.Tasks;
 import org.apache.brooklyn.util.collections.MutableSet;
@@ -53,7 +54,6 @@ import org.apache.brooklyn.util.time.Duration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import brooklyn.config.BrooklynLogging;
 import brooklyn.entity.basic.AbstractEntity;
 import brooklyn.entity.basic.BrooklynTaskTags;
 import brooklyn.entity.basic.Entities;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/management/internal/LocalLocationManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/management/internal/LocalLocationManager.java b/core/src/main/java/org/apache/brooklyn/core/management/internal/LocalLocationManager.java
index 5f13331..fff12ac 100644
--- a/core/src/main/java/org/apache/brooklyn/core/management/internal/LocalLocationManager.java
+++ b/core/src/main/java/org/apache/brooklyn/core/management/internal/LocalLocationManager.java
@@ -30,6 +30,8 @@ import org.apache.brooklyn.api.location.LocationSpec;
 import org.apache.brooklyn.api.location.ProvisioningLocation;
 import org.apache.brooklyn.api.management.AccessController;
 import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.BrooklynLogging;
+import org.apache.brooklyn.core.config.BrooklynLogging.LoggingLevel;
 import org.apache.brooklyn.core.internal.storage.BrooklynStorage;
 import org.apache.brooklyn.core.management.entitlement.Entitlements;
 import org.apache.brooklyn.core.util.config.ConfigBag;
@@ -37,8 +39,6 @@ import org.apache.brooklyn.core.util.task.Tasks;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import brooklyn.config.BrooklynLogging;
-import brooklyn.config.BrooklynLogging.LoggingLevel;
 import brooklyn.entity.basic.ConfigKeys;
 import brooklyn.entity.basic.Lifecycle;
 import brooklyn.entity.proxying.InternalLocationFactory;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/management/internal/LocalManagementContext.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/management/internal/LocalManagementContext.java b/core/src/main/java/org/apache/brooklyn/core/management/internal/LocalManagementContext.java
index 02f33a7..28f55bd 100644
--- a/core/src/main/java/org/apache/brooklyn/core/management/internal/LocalManagementContext.java
+++ b/core/src/main/java/org/apache/brooklyn/core/management/internal/LocalManagementContext.java
@@ -42,6 +42,8 @@ import org.apache.brooklyn.api.management.ManagementContext;
 import org.apache.brooklyn.api.management.SubscriptionManager;
 import org.apache.brooklyn.api.management.Task;
 import org.apache.brooklyn.api.management.TaskAdaptable;
+import org.apache.brooklyn.core.config.BrooklynProperties;
+import org.apache.brooklyn.core.config.BrooklynProperties.Factory.Builder;
 import org.apache.brooklyn.core.internal.BrooklynFeatureEnablement;
 import org.apache.brooklyn.core.internal.storage.DataGridFactory;
 import org.apache.brooklyn.core.management.entitlement.Entitlements;
@@ -57,8 +59,6 @@ import org.apache.brooklyn.util.text.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import brooklyn.config.BrooklynProperties;
-import brooklyn.config.BrooklynProperties.Factory.Builder;
 import brooklyn.entity.drivers.downloads.BasicDownloadsManager;
 import brooklyn.entity.effector.Effectors;
 import brooklyn.entity.proxying.InternalEntityFactory;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/management/internal/ManagementContextInternal.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/management/internal/ManagementContextInternal.java b/core/src/main/java/org/apache/brooklyn/core/management/internal/ManagementContextInternal.java
index 4aad93a..9ca737c 100644
--- a/core/src/main/java/org/apache/brooklyn/core/management/internal/ManagementContextInternal.java
+++ b/core/src/main/java/org/apache/brooklyn/core/management/internal/ManagementContextInternal.java
@@ -30,12 +30,12 @@ import org.apache.brooklyn.api.location.Location;
 import org.apache.brooklyn.api.management.ManagementContext;
 import org.apache.brooklyn.api.management.Task;
 import org.apache.brooklyn.core.catalog.internal.CatalogInitialization;
+import org.apache.brooklyn.core.config.BrooklynProperties;
 import org.apache.brooklyn.core.internal.storage.BrooklynStorage;
 import org.apache.brooklyn.core.management.ha.OsgiManager;
 import org.apache.brooklyn.core.util.task.TaskTags;
 import org.apache.brooklyn.util.guava.Maybe;
 
-import brooklyn.config.BrooklynProperties;
 import brooklyn.entity.basic.BrooklynTaskTags;
 import brooklyn.entity.proxying.InternalEntityFactory;
 import brooklyn.entity.proxying.InternalLocationFactory;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/management/internal/NonDeploymentManagementContext.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/management/internal/NonDeploymentManagementContext.java b/core/src/main/java/org/apache/brooklyn/core/management/internal/NonDeploymentManagementContext.java
index 2a66a35..eacd5c6 100644
--- a/core/src/main/java/org/apache/brooklyn/core/management/internal/NonDeploymentManagementContext.java
+++ b/core/src/main/java/org/apache/brooklyn/core/management/internal/NonDeploymentManagementContext.java
@@ -61,13 +61,13 @@ import org.apache.brooklyn.api.mementos.BrooklynMementoPersister;
 import org.apache.brooklyn.api.mementos.BrooklynMementoRawData;
 import org.apache.brooklyn.config.StringConfigMap;
 import org.apache.brooklyn.core.catalog.internal.CatalogInitialization;
+import org.apache.brooklyn.core.config.BrooklynProperties;
 import org.apache.brooklyn.core.internal.storage.BrooklynStorage;
 import org.apache.brooklyn.core.management.entitlement.Entitlements;
 import org.apache.brooklyn.core.management.ha.OsgiManager;
 import org.apache.brooklyn.util.guava.Maybe;
 import org.apache.brooklyn.util.time.Duration;
 
-import brooklyn.config.BrooklynProperties;
 import brooklyn.entity.basic.AbstractEntity;
 import brooklyn.entity.proxying.InternalEntityFactory;
 import brooklyn.entity.proxying.InternalLocationFactory;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/policy/basic/ConfigMapImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/policy/basic/ConfigMapImpl.java b/core/src/main/java/org/apache/brooklyn/core/policy/basic/ConfigMapImpl.java
index 9422638..591c204 100644
--- a/core/src/main/java/org/apache/brooklyn/core/policy/basic/ConfigMapImpl.java
+++ b/core/src/main/java/org/apache/brooklyn/core/policy/basic/ConfigMapImpl.java
@@ -26,6 +26,7 @@ import java.util.Map;
 import org.apache.brooklyn.api.entity.basic.EntityLocal;
 import org.apache.brooklyn.api.management.ExecutionContext;
 import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.internal.AbstractConfigMapImpl;
 import org.apache.brooklyn.core.util.flags.TypeCoercions;
 import org.apache.brooklyn.core.util.internal.ConfigKeySelfExtracting;
 import org.apache.brooklyn.util.guava.Maybe;
@@ -36,7 +37,6 @@ import com.google.common.base.Preconditions;
 import com.google.common.base.Predicate;
 import com.google.common.collect.Maps;
 
-import brooklyn.config.internal.AbstractConfigMapImpl;
 import brooklyn.entity.basic.ConfigKeys;
 import brooklyn.entity.basic.EntityInternal;
 import brooklyn.entity.basic.Sanitizer;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/util/BrooklynNetworkUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/util/BrooklynNetworkUtils.java b/core/src/main/java/org/apache/brooklyn/core/util/BrooklynNetworkUtils.java
index 654aeb2..5b1bd68 100644
--- a/core/src/main/java/org/apache/brooklyn/core/util/BrooklynNetworkUtils.java
+++ b/core/src/main/java/org/apache/brooklyn/core/util/BrooklynNetworkUtils.java
@@ -20,8 +20,7 @@ package org.apache.brooklyn.core.util;
 
 import java.net.InetAddress;
 
-import brooklyn.config.BrooklynServiceAttributes;
-
+import org.apache.brooklyn.core.config.BrooklynServiceAttributes;
 import org.apache.brooklyn.core.util.flags.TypeCoercions;
 import org.apache.brooklyn.location.geo.LocalhostExternalIpLoader;
 import org.apache.brooklyn.util.JavaGroovyEquivalents;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/core/util/task/ssh/SshTasks.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/util/task/ssh/SshTasks.java b/core/src/main/java/org/apache/brooklyn/core/util/task/ssh/SshTasks.java
index 04d6cf3..0a8827b 100644
--- a/core/src/main/java/org/apache/brooklyn/core/util/task/ssh/SshTasks.java
+++ b/core/src/main/java/org/apache/brooklyn/core/util/task/ssh/SshTasks.java
@@ -30,6 +30,7 @@ import org.apache.brooklyn.api.management.TaskAdaptable;
 import org.apache.brooklyn.api.management.TaskFactory;
 import org.apache.brooklyn.api.management.TaskQueueingContext;
 import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.ConfigUtils;
 import org.apache.brooklyn.core.util.ResourceUtils;
 import org.apache.brooklyn.core.util.config.ConfigBag;
 import org.apache.brooklyn.core.util.internal.ssh.SshTool;
@@ -41,7 +42,6 @@ import org.apache.brooklyn.core.util.task.system.ProcessTaskWrapper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import brooklyn.config.ConfigUtils;
 import brooklyn.entity.basic.BrooklynTaskTags;
 import brooklyn.entity.basic.ConfigKeys;
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/location/basic/BasicLocationRegistry.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/location/basic/BasicLocationRegistry.java b/core/src/main/java/org/apache/brooklyn/location/basic/BasicLocationRegistry.java
index 29142e1..59db891 100644
--- a/core/src/main/java/org/apache/brooklyn/location/basic/BasicLocationRegistry.java
+++ b/core/src/main/java/org/apache/brooklyn/location/basic/BasicLocationRegistry.java
@@ -42,6 +42,8 @@ import org.apache.brooklyn.api.location.LocationSpec;
 import org.apache.brooklyn.api.management.ManagementContext;
 import org.apache.brooklyn.config.ConfigMap;
 import org.apache.brooklyn.core.catalog.CatalogPredicates;
+import org.apache.brooklyn.core.config.ConfigPredicates;
+import org.apache.brooklyn.core.config.ConfigUtils;
 import org.apache.brooklyn.core.management.internal.LocalLocationManager;
 import org.apache.brooklyn.core.util.config.ConfigBag;
 import org.apache.brooklyn.util.collections.MutableMap;
@@ -54,9 +56,6 @@ import org.apache.brooklyn.util.text.WildcardGlobs;
 import org.apache.brooklyn.util.text.StringEscapes.JavaStringEscapes;
 import org.apache.brooklyn.util.text.WildcardGlobs.PhraseTreatment;
 
-import brooklyn.config.ConfigPredicates;
-import brooklyn.config.ConfigUtils;
-
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Suppliers;
 import com.google.common.collect.ImmutableMap;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/location/basic/LocationPropertiesFromBrooklynProperties.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/location/basic/LocationPropertiesFromBrooklynProperties.java b/core/src/main/java/org/apache/brooklyn/location/basic/LocationPropertiesFromBrooklynProperties.java
index b52ba34..7791ab7 100644
--- a/core/src/main/java/org/apache/brooklyn/location/basic/LocationPropertiesFromBrooklynProperties.java
+++ b/core/src/main/java/org/apache/brooklyn/location/basic/LocationPropertiesFromBrooklynProperties.java
@@ -23,6 +23,9 @@ import static com.google.common.base.Preconditions.checkArgument;
 import java.io.File;
 import java.util.Map;
 
+import org.apache.brooklyn.core.config.BrooklynProperties;
+import org.apache.brooklyn.core.config.BrooklynServerConfig;
+import org.apache.brooklyn.core.config.ConfigUtils;
 import org.apache.brooklyn.core.util.config.ConfigBag;
 import org.apache.brooklyn.core.util.internal.ssh.SshTool;
 import org.apache.brooklyn.util.collections.MutableMap;
@@ -30,10 +33,6 @@ import org.apache.brooklyn.util.os.Os;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import brooklyn.config.BrooklynProperties;
-import brooklyn.config.BrooklynServerConfig;
-import brooklyn.config.ConfigUtils;
-
 import com.google.common.base.Predicates;
 import com.google.common.base.Strings;
 import com.google.common.collect.Maps;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/main/java/org/apache/brooklyn/location/basic/SshMachineLocation.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/location/basic/SshMachineLocation.java b/core/src/main/java/org/apache/brooklyn/location/basic/SshMachineLocation.java
index ef8c6d8..1195849 100644
--- a/core/src/main/java/org/apache/brooklyn/location/basic/SshMachineLocation.java
+++ b/core/src/main/java/org/apache/brooklyn/location/basic/SshMachineLocation.java
@@ -53,6 +53,8 @@ import org.apache.brooklyn.api.location.PortSupplier;
 import org.apache.brooklyn.api.management.Task;
 import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.config.ConfigKey.HasConfigKey;
+import org.apache.brooklyn.core.config.BrooklynLogging;
+import org.apache.brooklyn.core.config.ConfigUtils;
 import org.apache.brooklyn.core.util.ResourceUtils;
 import org.apache.brooklyn.core.util.config.ConfigBag;
 import org.apache.brooklyn.core.util.crypto.SecureKeys;
@@ -93,8 +95,6 @@ import com.google.common.collect.Sets;
 import com.google.common.net.HostAndPort;
 import com.google.common.reflect.TypeToken;
 
-import brooklyn.config.BrooklynLogging;
-import brooklyn.config.ConfigUtils;
 import brooklyn.entity.basic.BrooklynConfigKeys;
 import brooklyn.entity.basic.BrooklynTaskTags;
 import brooklyn.entity.basic.ConfigKeys;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/test/java/brooklyn/camp/lite/CampPlatformWithJustBrooklynMgmt.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/camp/lite/CampPlatformWithJustBrooklynMgmt.java b/core/src/test/java/brooklyn/camp/lite/CampPlatformWithJustBrooklynMgmt.java
index 9fe5910..9bea0e1 100644
--- a/core/src/test/java/brooklyn/camp/lite/CampPlatformWithJustBrooklynMgmt.java
+++ b/core/src/test/java/brooklyn/camp/lite/CampPlatformWithJustBrooklynMgmt.java
@@ -20,10 +20,10 @@ package brooklyn.camp.lite;
 
 import org.apache.brooklyn.api.management.ManagementContext;
 import org.apache.brooklyn.camp.BasicCampPlatform;
+import org.apache.brooklyn.core.config.BrooklynProperties;
+import org.apache.brooklyn.core.config.BrooklynServerConfig;
 
 import brooklyn.camp.brooklyn.api.HasBrooklynManagementContext;
-import brooklyn.config.BrooklynProperties;
-import brooklyn.config.BrooklynServerConfig;
 
 public class CampPlatformWithJustBrooklynMgmt extends BasicCampPlatform implements HasBrooklynManagementContext {
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/test/java/brooklyn/config/BrooklynPropertiesBuilderTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/config/BrooklynPropertiesBuilderTest.java b/core/src/test/java/brooklyn/config/BrooklynPropertiesBuilderTest.java
deleted file mode 100644
index 3941942..0000000
--- a/core/src/test/java/brooklyn/config/BrooklynPropertiesBuilderTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.config;
-
-import static org.testng.Assert.assertEquals;
-
-import java.io.File;
-
-import org.apache.brooklyn.util.os.Os;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Charsets;
-import com.google.common.io.Files;
-
-@Test
-public class BrooklynPropertiesBuilderTest {
-
-    private File globalPropertiesFile;
-    private File localPropertiesFile;
-
-    @BeforeMethod(alwaysRun=true)
-    public void setUp() throws Exception {
-        globalPropertiesFile = Os.newTempFile(getClass(), ".global.properties");
-        localPropertiesFile = Os.newTempFile(getClass(), "local.properties");
-    }
-    
-    @AfterMethod(alwaysRun=true)
-    public void tearDown() throws Exception {
-        if (globalPropertiesFile != null) globalPropertiesFile.delete();
-        if (localPropertiesFile != null) localPropertiesFile.delete();
-    }
-    
-    @Test
-    public void testSetGlobalBrooklynPropertiesFile() throws Exception {
-        String globalPropertiesContents = "brooklyn.mykey=myval";
-        Files.write(globalPropertiesContents, globalPropertiesFile, Charsets.UTF_8);
-        
-        BrooklynProperties props = new BrooklynProperties.Factory.Builder()
-                .globalPropertiesFile(globalPropertiesFile.getAbsolutePath())
-                .build();
-        
-        assertEquals(props.get("brooklyn.mykey"), "myval");
-    }
-    
-    @Test
-    public void testSetLocalBrooklynPropertiesFile() throws Exception {
-        String globalPropertiesContents = "brooklyn.mykey=myvalglobal"+"\n"+
-                "brooklyn.mykey2=myvalglobal2"+"\n";
-        Files.write(globalPropertiesContents, globalPropertiesFile, Charsets.UTF_8);
-        
-        String localPropertiesContents = "brooklyn.mykey=myvaloverriding"+"\n"+
-                "brooklyn.mykeyLocal=myvallocal2"+"\n";
-        Files.write(localPropertiesContents, localPropertiesFile, Charsets.UTF_8);
-        
-        BrooklynProperties props = new BrooklynProperties.Factory.Builder()
-                .globalPropertiesFile(globalPropertiesFile.getAbsolutePath())
-                .localPropertiesFile(localPropertiesFile.getAbsolutePath())
-                .build();
-        
-        assertEquals(props.get("brooklyn.mykey"), "myvaloverriding");
-        assertEquals(props.get("brooklyn.mykey2"), "myvalglobal2");
-        assertEquals(props.get("brooklyn.mykeyLocal"), "myvallocal2");
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68240194/core/src/test/java/brooklyn/config/BrooklynPropertiesFromGroovyTest.groovy
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/config/BrooklynPropertiesFromGroovyTest.groovy b/core/src/test/java/brooklyn/config/BrooklynPropertiesFromGroovyTest.groovy
deleted file mode 100644
index e68935c..0000000
--- a/core/src/test/java/brooklyn/config/BrooklynPropertiesFromGroovyTest.groovy
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.config;
-
-import static org.testng.Assert.assertEquals
-import static org.testng.Assert.fail
-
-import org.testng.annotations.Test
-
-import org.apache.brooklyn.util.collections.MutableMap;
-
-import com.google.common.collect.ImmutableList
-import com.google.common.collect.ImmutableMap
-
-public class BrooklynPropertiesFromGroovyTest {
-
-    @Test
-    public void testGetFirstUsingFailIfNoneWithClosure() {
-        BrooklynProperties props = BrooklynProperties.Factory.newEmpty().addFromMap(ImmutableMap.of("akey", "aval", "bkey", "bval"));
-        Object keys;
-        try {
-            props.getFirst(MutableMap.of("failIfNone", { keys = it }), "notThere");
-        } catch (NoSuchElementException e) {
-            // expected
-        }
-        assertEquals(keys, "notThere");
-    }
-    
-    @Test
-    public void testGetFirstMultiArgUsingFailIfNoneWithClosure() {
-        BrooklynProperties props = BrooklynProperties.Factory.newEmpty().addFromMap(ImmutableMap.of("akey", "aval", "bkey", "bval"));
-        Object keys;
-        try {
-            props.getFirst(MutableMap.of("failIfNone", { it1, it2 -> keys = [it1, it2] }), "notThere", "notThere2");
-        } catch (NoSuchElementException e) {
-            // expected
-        }
-        assertEquals(keys, ImmutableList.of("notThere", "notThere2"));
-    }
-}


Mime
View raw message